cocos2d iphone - On CCBitmapFontAtlas effect (Display on by one) -


I am trying to make an effect using CCBitmapFontAtlas, here is what I need:

< P> The string says that "ABCDFG" is transmitted one by one, each one is not displayed until it is fully displayed.

And what I have tried here:

  - (init)  

{if ((self = [super init ])) {

  label = [CCBitmapFontAtlas bitmapFontAtlasWithString: @ "ABC" fntFile: @ "bitmapFontTest.fnt"]; [Self-combined: label]; CGSize s = [[CCCceteror ShareDirector] winSize]; Label.position = CCP (S. Width / 2, S. High / 2); Label.anchorPoint = CCP (0.5 F, 0.5F); Label.visible = NO; // hide it first [[CCTch Sponsored Shared Depot] addTargetedDelegate: Self priority: 0 Swallow Touch: Yes]; } Healthy return; Document: (UIEvent *) event    

}

- (BOOL) ccTouchBegan: (UITouch *) document with touch: P> {CCSprakash Acres = (CCSPRITA ) [label found Childbaytag: 0]; CCSPritees Bisar = (CCSprita ) [label found Childbaytag: 1]; CCSPritees CCR = (CCSprita ) [Childbay Tag: 2];
  id fade_in = [ccephaddine actionwidth dictionary: 3]; the label. View = yes; [Hier run action: feed_in]; [Beat run action: feed_in]; [Caesar Playing Action: feed_in]; Yes come back  

}

The effect is "ABC" once I touched the screen, then I used the callfind to fade to the next string call while the current string Is displayed. But it seems that things are very complicated.

Is there an easy way to accomplish this effect? Any suggestions would be appreciated.

I think you are going in the right direction with this one. You can each letter be a separate sprite and keep them in the array and then you can run them one by one.

The call function can be started by:

  [self-display next source: Pratayarere Next Index: 0];  

And the function is:

  // Warning, it assumes that you are not giving it an empty array, you want to put it in check Are that - (zero) displayNextSprite: (NSMutableArray *) spriteArray nextIndex: (NSUInteger) nextIndex {CCSprite * nextSprite = [spriteArray objectAtIndex: nextIndex]; ID Action 1 = [CCFade in Action with Dislocation: 3]; // or = [CCPropertyAction Procedure duration: 3 keys: @ "Opacity" from: 0 to: 255]; // Last letter if (next index == ([Spreeyre counting] - 1)) ([Augustus Run Action: Action 1];} and // Next Letter (IID Callfunc [[CCCLfunk ActionWide Goal: Self Selector: @Selector ( DisplayPrint: Spitierre Next Index: Next Index + 1)]; Id Sequence = [CCSequence actionOne: action1] Two: callFunc; [Action of Next Empowerment: Sequence];}}  

Comments