diff options
| author | Starla Insigna <starla4444@gmail.com> | 2011-08-23 07:52:24 -0400 |
|---|---|---|
| committer | Starla Insigna <starla4444@gmail.com> | 2011-08-23 07:52:24 -0400 |
| commit | c9337218ef1660360097928c753bde1c79775618 (patch) | |
| tree | 3cd6f9926cbe092c98776673800b830eef27ca01 /Classes/TouchDelegatingView.m | |
| parent | 2ac50443ddbf69b7594808ba4e6de49eecbc0b84 (diff) | |
| download | cartcollect-c9337218ef1660360097928c753bde1c79775618.tar.gz cartcollect-c9337218ef1660360097928c753bde1c79775618.tar.bz2 cartcollect-c9337218ef1660360097928c753bde1c79775618.zip | |
Added scrolling to level selection screen
Using http://www.xcombinator.com/2010/09/08/a-paging-uiscrollview-in-cocos2d-with-previews/ as a base, I was able to implement a paging scroller for the level selection screen so players can swipe through available levels and choose one to play. At this point, the level selection screen is practically done--the only other thing I want to add is a UIPageControl to interact with the scrolling and give the player an indication of how many levels there are. Refs #207
Diffstat (limited to 'Classes/TouchDelegatingView.m')
| -rwxr-xr-x | Classes/TouchDelegatingView.m | 26 |
1 files changed, 26 insertions, 0 deletions
| diff --git a/Classes/TouchDelegatingView.m b/Classes/TouchDelegatingView.m new file mode 100755 index 0000000..83bda73 --- /dev/null +++ b/Classes/TouchDelegatingView.m | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | // | ||
| 2 | // TouchDelegatingView.m | ||
| 3 | // Jacob's Shapes | ||
| 4 | // | ||
| 5 | // Created by Nate Murray on 8/23/10. | ||
| 6 | // Copyright 2010 LittleHiccup. All rights reserved. | ||
| 7 | // | ||
| 8 | |||
| 9 | #import "TouchDelegatingView.h" | ||
| 10 | |||
| 11 | @implementation TouchDelegatingView | ||
| 12 | @synthesize scrollView; | ||
| 13 | |||
| 14 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { | ||
| 15 | if ([self pointInside:point withEvent:event]) { | ||
| 16 | return self.scrollView; | ||
| 17 | } | ||
| 18 | return nil; | ||
| 19 | } | ||
| 20 | |||
| 21 | -(void) dealloc { | ||
| 22 | self.scrollView = nil; | ||
| 23 | [super dealloc]; | ||
| 24 | } | ||
| 25 | |||
| 26 | @end | ||
