Game Development Reference
In-Depth Information
Figure 8-3
.
The Scroll View node selected in SpriteBuilder. Notice the page image being left aligned within
the Scroll View. The background and button nodes have been hidden for visual clarity
Showing the Scroll View Popover
Before you can try out the
Scroll View
, you'll have to create the
MainMenuLevelSelect
class and the
_levelSelectScrollView
ivar. Let's do
the ivar first.
Open
MainScene.m
in Xcode. Add the code highlighted in
Listing 8-1
.
Listing 8-1
.
Adding the CCScrollView ivar
#import "MainScene.h"
@implementation MainScene
{
__weak CCScrollView* _levelSelectScrollView;
}
-(void) didLoadFromCCB
{
NSLog(@"scroll view: %@", _levelSelectScrollView);
}
@end
The
NSLog
line exists only to verify the assignment was done properly. It should log
something similar to this:
Search WWH ::
Custom Search