Created
November 4, 2010 18:42
-
-
Save rolandoam/662931 to your computer and use it in GitHub Desktop.
SectionalMenu.h
This file contains 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
SectionalButton *it1 = [SectionalButton buttonWithFile:@"Images/home/classic.png" target:self]; | |
SectionalButton *it2 = [SectionalButton buttonWithFile:@"Images/home/gad.png" target:self]; | |
[it1 addSelector:@selector(help1) section:CGRectMake(0, 0, it1.contentSize.width, it1.contentSize.height/3)]; | |
[it1 addSelector:@selector(play1) section:CGRectMake(0, it1.contentSize.height/3, it1.contentSize.width, 2*it1.contentSize.height/3)]; | |
[it2 addSelector:@selector(help2) section:CGRectMake(0, 0, it2.contentSize.width, it2.contentSize.height/3)]; | |
[it2 addSelector:@selector(play2) section:CGRectMake(0, it2.contentSize.height/3, it2.contentSize.width, 2*it2.contentSize.height/3)]; | |
// create a section with data, and disable that section | |
int selIdx = [it2 addSelector:@selector(selectSomethingWithData:) | |
withData:someObj | |
section:CGRectMake(0, 70+(101*j), 71, 101)]; | |
[it2 enableSection:selIdx enabled:NO]; | |
it1.rotation = -20.0f; // target: 20 | |
it2.rotation = -55.0f; // target: -15 | |
SectionalMenu *menu = [SectionalMenu node]; | |
[menu addChild:it1 z:0 tag:kItem1Tag]; | |
[menu addChild:it2 z:0 tag:kItem2Tag]; | |
[self addChild:menu z:1 tag:kMenuTag]; | |
... | |
- (void)selectSomethingWithData:(id)data { | |
// do something with data here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment