Reputation: 9606
how could I tweak CCMenuItemSprite to support only one sprite?
Currently I have:
[CCMenuItemSprite itemWithNormalSprite:one selectedSprite:selectedOne]
But would like to have:
[CCMenuItemSprite itemWithNormalSprite:one]
EDIT: I want to modify CCMenuItem to work only with one CCSprite and not two. So I need to change also the internal methods.
Upvotes: 0
Views: 419
Reputation: 22042
try this, just change colour of seleted sprite.
CCSprite *sprite1 = [CCSprite spriteWithFile:@"Button.png"];
CCSprite * sprite2 = [CCSprite spriteWithFile:@"Button.png"];
sprite2.color = ccc3(128, 128, 128);
CCMenuItemImage *itemEasyLevelImage = [CCMenuItemImage itemWithNormalSprite:sprite1
selectedSprite:sprite2
block:^(id sender){}];
Upvotes: 0
Reputation: 1908
You could just use
[CCMenuItemSprite itemWithNormalSprite:one selectedSprite:one]
this way, nothing would happen when you select the sprite
Upvotes: 1
Reputation: 2153
You can just use the same (normal) sprite as the selected sprite. When clicked, the button will then do nothing.
Upvotes: 1