CocosBuilder
CocosBuilder copied to clipboard
[2.1rc1/0] SubCCB-Animations Bug?
If you have a spritesheet timeline in a CCSprite CCB file (a monkey scratching). This animation will appear in CocosBuilder when placed in the Level. However it does not play on xCode/iOS.
Reverting to CCBReader+CCBAnimationManger/CocosBuilder 2.1Beta2 and it works as expected. Unfortunately the Beta build is not suitable for our game (several other bugs), so will have to progress on the RCs.
The issue appears to be with the CocosBuilder xCode libraries and not the application - to some degree... The Beta will play the sub-CCB animation but we are unable to animate the CCB in a CCLayer -> this was fixed in RC0 but appears to have damaged playing CCB files. I believe issue 105 was to correct this behavior?
In the current application, we have animated CCLayers and CCSprites. The CCLayers animations work without any issue (they are not animated in the Root Node) on 2.1RCx however (as above) the CCSprites' timelines do not run (CCSprites are animated in the Root Node)....
Upon further investigation, the CCAnimationManagerDelegate is never called for the subCCSprites. If you change CCBReader lines 886-888 to (i.e. revert):
embeddedNode.ignoreAnchorPointForPosition = ccbFileNode.ignoreAnchorPointForPosition; //[actionManager moveAnimationsFromNode:ccbFileNode toNode:embeddedNode];
The CCSprite timelines function without any issue, however they can not be animated in the Root CCLayer. Restoring these changes, the CCSprite is animated in the CCLayer without their timelines.
EDIT 01: Disabling line 391 ( [node stopAllActions]; ) of CCAnimationManager.m kinda helps with the issue > The delegates are called as expected etc. I think the issue may be the initial CCB fromNode/toNode which animates the CCBfile in the CCLayer is preventing any future animations?
EDIT 02: I have not been able to find a solution to this issue after my several hours of attempting to isolate the issue... :-(
It appears I was mistaken.... Both sub CCLayer and CCSprite with animations in the Root CCLayer are animated at that level and never play their Timelines....
Our sprites have several animations and custom properties and need to be in a sub CCSprite with movement animated in a root CCLayer.
I've been looking at this a bit more this morning. Unfortunately it is pretty complex to support animations for sub ccb-files at the root node level in run time. The reason it works inside of CocosBuilder is that it uses an empty node in between the sub ccb-file and the parent document, when loaded by CCBReader this middle node is removed.
The solution is to use a CCNode as the base for your sub-ccb and add an animated CCSprite to it. Very sorry if this causes any problems for you.
@vlidholt : Thank you for response. We have remade our one level (9 animated sprites) using a CCNode BEFORE the CCB-CCSprite file. This does allow us to animate the objects and play sub animations.
However, as soon as we edit a property of the CCB-CCSprite we are unable to play any animations. This still occurs even removing all the animations. The only work around is to delete the CCB-CCSprite and re-add them.
@vlidholt has any progress been made to this issue in later releases or may be in sprite builder that can be fixed in cocosbuilder as well ?
I seem to face the same issue as mentioned in the thread below - http://discuss.cocos2d-x.org/t/bugs-ccb-file-sub-ccbfile-cannot-run-loop-animation/7264