在我的一层中,我有这个按钮。现在我怎样才能在这个按钮上添加动作,比如跳跃、跑步等?
SneakyButtonSkinnedBase *jumpbuttonBase=[SneakyButtonSkinnedBase new];
jumpbuttonBase.position=jumpButtonPosition;
jumpbuttonBase.defaultSprite=[CCSprite spriteWithFile:@"jumpUp.png"];
jumpbuttonBase.activatedSprite=[CCSprite spriteWithFile:@"jumpDown.png"];
jumpbuttonBase.pressSprite=[CCSprite spriteWithFile:@"jumpDown.png"];
jumpbuttonBase.button=[[SneakyButton alloc]initWithRect:jumpButtonDimensions];
jumpButton=[jumpbuttonBase.button retain];
jumpButton.isToggleable=NO;
[self addChild:jumpbuttonBase];