I have a CCLayer with stuff (sprites, label, etc) on it.
This CCLayer is called normally with a :
[[CCDirector sharedDirector] pushScene:[CCTransitionFade transitionWithDuration:1.0 scene:[AdventureLayer sceneWithLevel:[itemPassedIn tag]] withColor:ccWHITE]];
It comes with some kind of white fading of 1 sec.
However, on this layer, I also have a UITextField added to the CCDirector
[[[CCDirector sharedDirector] view] addSubview:textField];
The problem is : When the layer is showed up, everything goes accordingly with the fading effect EXCEPT the UITextField which is already showed up.
This is too “brutal”, and I would like to have some fading effect on it.
How should I proceed ? (I am working with cocos2d v2)
You could use an additional animation on the UITextfield. A normal UIView animation which is quite simple. Or maybe find some equivalent for a UITextField in Cocos2d, here is a possible solution from clarus: http://www.cocos2d-iphone.org/forum/topic/20993
EDIT:
Here is a tutorial for UIView Animations.
The code will look something like this: