More bugs (or missing features) on CCBReader

Hi,

I’d like to notify about several bugs:

1- If you create a scene in Cocosbuilder, and create a visibility animation (invisible in first frame, and visible in frame X), it will always start visible. This is, cocos2dx ignores the visible property.
2- If you set up a position animation in CocosBuilder, and configure it to be instant (not linear), cocos2d-x ignores this and smoothly moves the sprite from position A to position B, instead of just modifying the position.

I hope those bugs can be fixed soon… I’d love to know if it’s possible to have them fixed in the next scheduled build, thanks.

Jesús

u can use the opacity instead of the visible

@Jesus Bosch
What’s the version of CocosBuilder you used?

Jetion Cry wrote:

u can use the opacity instead of the visible

it doesn’t work neither, it generates a fade-in effect (the “instant” transition type doesn’t seem to be correctly implemented in cocos2dx’s CCBReader).

Minggo Zhang wrote:

@Jesus Bosch
What’s the version of CocosBuilder you used?

Hi Zhang and other colleagues,

I’ve prepared a very simple example to illustrate the situation. You can have a look here:

http://www.plungeinteractive.com/external/experiment.zip

It contains:

  • CocosBuilder project, generated with CCB 3.0 (the latest available download).
  • Texture packer project, and example generated spritesheet
  • XCODE Project made with the latest cocos2d-x available version that executes two CCBI files.
    ~~> The first should start with a hidden asset , and show it after two seconds. But it will be shown from the beginning, so this demonstrates the ISSUE 1 that I have mentioned in my original post
    ~~> The second (example2.ccbi) should start with start with a hidden asset also (opacity property set to 0 at the timeline, and the transition mode set to “instant” and not “linear”). When you run it, you will see a fade in effect, what demonstrates the ISSUE 2.

I hope this helps.

Best,

Jesús Bosch

hi, is the issue clear after the explanations and the code sample?

Thanks.

Jesús

hi? :frowning: is everyone on holidays?

Jesus Bosch

Thank you. I will test it ASAP.

#1639 is created for it.

I have fixed issue1 in this commit https://github.com/minggo/cocos2d-x/commit/c02d6469e1371654f920fb62acb0c3f276a3f7d6.
I will checkout issue 2 ASAP.

wow, I didn’t expect a fix so fast. Many thanks Minggo :slight_smile:

About issue 2, it exists in cocos2d-iphone too. I am curious why it runs correctly in CocosBuilder.

CCBAnimationManager::getAction() return CCFadeTo when property name is “opacity”. So it run CCFadeTo action in issue 2.
I have sent an email to the author of CocosBuilder saying about this issue.

Hi Minggo,

Thanks for the fixing the issue #1. Saved my day. I have noticed another bug with CocosBuilder for Cocos2d-x.

BUG: In CocosBuilder, for TTF font Label, if you set font size property as “Multiply by resolution scale” then it still not working on Cocos2dx.

Would it possible to check for the same?

Thanks,
Paras Mendiratta

The resolution scale in CCBReader always returns 1.

float CCBReader::getResolutionScale()
{
    return 1;
}

Cocos2d-X has its own Multi-resolution support. You just need one Design Resolution(e.g. 480x320), and it can be fit for all device resolution.
So i think you just need one ccbi files but different resources.

Paras Mendiratta wrote:

Hi Minggo,
>
Thanks for the fixing the issue #1. Saved my day. I have noticed another bug with CocosBuilder for Cocos2d-x.
>
BUG: In CocosBuilder, for TTF font Label, if you set font size property as “Multiply by resolution scale” then it still not working on Cocos2dx.
>
Would it possible to check for the same?
>
Thanks,
Paras Mendiratta

I am using the same technique for multi-resolution. Though I am still working on porting. Using percentage in cocosbuilder and different resources is giving good results so far.

For TTF label, it’s not possible to use the above technique. I have written a custom method for that while loading the font via ccbi file.

Nothing special just calculating the scale factor based upon visible rect and rounding it either 0.5, 1.0, 1.5, 2.0 or 4.0 as used in CocosBuilder application.