C++ support for Cocos Creator

I’ll do research about it after finishing the “UI” nodes.

daily update:

Buttons working, finally! (there are a few bugs out there that should be fixed, but I’m happy with it so far).

  • I’m reusing UIButton. I needed to make some minor changes that are 100% backward compatible
  • Buttons are clickable (of course). And the callback could be added by getting the node by name.
  • supports scale 9 sprites (this works because now Scale9Sprite is a subclass of Sprite and Sprite has the scale9 feature)
  • supports any kind of label + font

Left: Cocos Creator. Right: cocos2d-x

7 Likes

daily update:

ScrollView is working. I’m just reusing ui::ScrollView. So it doesn’t have all the CocosCreator’s ScrollView features, but has most of them.

Video showing it working:

5 Likes

If it’s not too much trouble it might be nice to get a list of any new features in CocosCreator code base that are not yet in the c++ codebase. Unless you plan to implement them fully yourself.

yes. sure. I’ll create the list next week. I still need to add support for a few more widgets, fix some bugs, and then release an alpha version. It will include only the Renderer Nodes and some UI nodes.
I’ll add more features based on the user’s feedback.

1 Like

daily update
EditBox works… working on ProgressBar and then fix bugs and fix bugs before releasing an alpha version.

left: cocos2d-x c++
right: cocos creator simulator

3 Likes

daily update:
fixing bugs in Scale9prite regarding trimmed vs. untrimmed setCenterRect.
As mentioned in a previous message, Cocos Creator uses the trimmed rectangle as its reference, while Scale9Sprite uses its untrimmed rectangle (which I think is the correct way to do it).
But since I modified the Srpite code to be compatible with Creator, now I’m fixing that in Scale9Sprite.
I haven’t finish it yet, but almost there.

2 Likes

Crossed fingers for your work! Keep it up!

daily update: I kept fixing bugs in Scale9Sprite… hopefully all of the bugs will be fixed by tomorrow.

3 Likes

daily update:
more fixes in Sprite and Scale9Sprite. The goal is to have Scale9Sprite 100% backward compatible before submitting the PR. And I rewrote Scale9Sprite as a subclass of Sprite. Most of the bugs are fixed, but there are known bugs:

  • capInsets + rotated frame: doesn’t look ok.
  • scale9 disabled: position is not ok.

I’ll fix them this monday and I’ll clean the PR so that it can be merged.

2 Likes
  • scale9 disabled: fixed
  • artifacts in patch9: fixed
  • capInsets + rotated frame: argh… not fixed yet… but much better. too tired to fixed it now, but it seems trivial. I’m not calculating the offset correctly. I’ll fix it tomorrow morning and send the PR.

6 Likes

Keep up the good work. The world waiting for you. :smiley:

:slight_smile:

Yay… here is the PR. Finally I finished the Scale9Sprite refactor. It took me more time than I expected, but it was worth it.

Now, I should continue polishing the .py script.

5 Likes

Did you released the python script? It would be very useful :slight_smile:

It is here:
https://github.com/ricardoquesada/CreatorTest/blob/master/parser.py

any documentation how to convert cocos creator to cocos2d-x project? thanks :slight_smile:

There will be documentation at the v3.14 release.

When would v3.14 be coming :smiley:

December 12, give or take a few days as a buffer.

2 Likes

Leave time, it’s ok, for christmas. :smiley:

1 Like