移動後に画像切り替えの例
CCMoveBy* moveBy = [CCMoveBy actionWithDuration:1.0 position:ccp(100, 100)]; CCCallBlock* block = [CCCallBlock actionWithBlock:^{ //アクション後に画像切り替え CCTexture2D *texture = [[CCTextureCache sharedTextureCache] addImage:@"image.png"]; [sprite setTexture:texture]; [sprite setTextureRect:CGRectMake(0, 0, texture.contentSize.width, texture.contentSize.height)]; }]; CCSequence* seq = [CCSequence actions:moveBy, block, nil]; [sprite runAction:seq];
0 件のコメント:
コメントを投稿