Vishal Avalani
Vishal Avalani

Reputation: 381

Actions like CCMoveTo, CCRotateTo,CCBlink etc not working

I have created a loading scene separate class derived from CCScene which I can reuse in other projects. I have added a label called "Loading.." inside it.

@interface LoadingScene : CCScene
{
TargetScenes targetScene_;
}

I want to give effects to label while other scene is loading but I am not able to do so..

In .m file here goes the code for adding labels:

-(id) initWithTargetScene:(TargetScenes)targetScene
{
if ((self = [super init]))
{
targetScene_ = targetScene;

CCLabelTTF* label = [CCLabelTTF labelWithString:@"Loading ..." fontName:@"Marker Felt" fontSize:64];
label.color = ccWHITE;
CGSize size = [[CCDirector sharedDirector] winSize];
label.position = CGPointMake(size.width / 2, size.height / 2);
CCBlink *blink = [CCBlink actionWithDuration:2 blinks:10];
[label runAction:blink];
[self addChild:label];

}

return self;
}

The blink is not work.. None of the actions are working and giving me big headache...

Please can someone let me know the reason behind it? Also, How to overcome it?

Upvotes: 1

Views: 1358

Answers (1)

James Webster
James Webster

Reputation: 32066

Have you overridden onEnter in your class? Did you remember to call [super onEnter]?

Upvotes: 4

Related Questions