1
    blue = [CCMenuItemImage itemFromNormalImage:@"blue.png" selectedImage:@"blueclick.png"];
    [blue setPosition:ccp(175, 350)];
    blue.scale = .75;
    [self addChild:blue  z: 5];



 id move = [CCMoveBy actionWithDuration:1.0f position:CGPointMake(334, 321.75)];
    [blue runAction:move];

Why won't it change to the second image (blueclick.png) when I click it? ALSO how would I delay this function?

  • Could not find relation to Xcode. Removing tag. –  Mar 18 '13 at 22:15
  • image change occurs while you click & hold on the menu item, not when/after you clicked it. To delay actions use CCDelay action and a ccsequence. – CodeSmile Mar 19 '13 at 00:58

1 Answers1

0

Try this code to run action with delay:

      id delay    = [CCDelayTime actionWithDuration:delay];
      id move     = [CCMoveTo actionWithDuration:0.4 position:ccp(x, y)];
      id sequence = [CCSequence actions:delay, move, nil];
      [card.sprite runAction:sequence];
Guru
  • 21,652
  • 10
  • 63
  • 102