Hi, I'm trying to basically scale up a button as soon as a touch is detected. Here's my Scene:
@implementation HomeScene
-(id) init
{
if((self = [super init])) {
...
// sp_btn_story is retained...
sp_btn_story = [[CCSprite spriteWithFile:@"main_menu_btn.png"] retain];
sp_btn_story.position = ccp(size.width - 146, 110);
[self addChild: sp_btn_story];
...
}
return self;
}
-(void) onEnter
{
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
}
-(void) onExit
{
[[CCTouchDispatcher sharedDispatcher] removeDelegate:self];
}
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
NSLog(@"tapped!");
sp_btn_story.scaleX = 2;
[sp_btn_story stopAllActions];
[sp_btn_story runAction: [CCScaleTo actionWithDuration:0.5f scale:1.2f]];
return YES;
}
...
@end
It scales the X just fine, as expected. (I threw that in there to test.) But the action is not running for some reason. :( Anyone have any ideas?
Edit: using cocos2d 0.99 btw.