getAction() generates actions between 2 keyframes, but we should add an extra action for the first key frame for “visible” animation,
otherwise the node will not be shown if:
- it’s visible property is false. (but we expect it’ll be shown by the “visible” animation")
- The timeline is in a looped chian.
here’s a patch:
if (timeFirst > 0)
{
actions->addObject(CCDelayTime::create(timeFirst));
}
// Patch Begin
if (strcmp(pSeqProp->getName(), "visible") == 0) {
if( numKeyframes > 0 ) {
CCBKeyframe *kf0 = (CCBKeyframe*)keyframes->objectAtIndex(0);
CCBValue *val = (CCBValue *)kf0->getValue();
if( val->getBoolValue() )
actions->addObject(CCShow::create());
else
actions->addObject(CCHide::create());
}
}
// Patch Ends
for (int i = 0; i < numKeyframes - 1; ++i)