Created
June 29, 2014 11:01
-
-
Save is8r/43f012ab06a9feee391e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) initScrollLayer | |
{ | |
int pageMax = 3;//ページ数 | |
CGSize s = [[CCDirector sharedDirector] winSize]; | |
//ScrollLayer | |
scroll = [ScrollLayer node]; | |
[scroll changeContentWidth:s.width*pageMax]; | |
[self addChild:scroll]; | |
//Label | |
CCLabel* l0 = [CCLabel labelWithString:@"PAGE01" | |
dimensions:CGSizeMake(320, 16) | |
alignment:UITextAlignmentCenter | |
fontName:@"Helvetica" | |
fontSize:16 | |
]; | |
l0.position = ccp( 160 , 240-8 ); | |
[scroll addScrollChild:l0]; | |
CCLabel* l1 = [CCLabel labelWithString:@"PAGE02" | |
dimensions:CGSizeMake(320, 16) | |
alignment:UITextAlignmentCenter | |
fontName:@"Helvetica" | |
fontSize:16 | |
]; | |
l1.position = ccp( 160+320 , 240-8 ); | |
[scroll addScrollChild:l1]; | |
CCLabel* l2 = [CCLabel labelWithString:@"PAGE03" | |
dimensions:CGSizeMake(320, 16) | |
alignment:UITextAlignmentCenter | |
fontName:@"Helvetica" | |
fontSize:16 | |
]; | |
l2.position = ccp( 160+(320*2) , 240-8 ); | |
[scroll addScrollChild:l2]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment