C++ support for Cocos Creator

C++ support for Cocos Creator


Alright so it sounds like you guys are just about done with this, looking forward to full C++ support around December 12th!

Given that it didn’t support C++ out of the box, what was the expected like workaround for all the devs in the meantime? I’ve been on 3.10 the whole time, waiting for this, but it’s surprising that it seems like C++ isn’t a priority for cocos.


Yes, can’t wait for this. I was shocked when building apk for simple game using Cocos Creator is way bigger in size. I hope with C++ support, it can reduce the size of exported apk. Thanks for C++ support.


@ricardo Awesome work!!! keep it up :smiley:


some quick update:
The past days I worked on fixing bugs for v3.14, so I didn’t make any progress on it.
But I started working on it again.

We are going to support flatbuffers, and the Lua version will use the flatbuffers as well. So both Lua/C++ languages will be supported with this.

The previous work that I did (generating C++ files) helped me understand the requirements (and most of not all of the needed changes will be part of v3.14).

Now I’m working on the schema (the fbs files for Flatbuffers) and the parser of the generated files and some changes in the python script. It needs to output json files instead of c++ files.


Now I’m working on the schema (the fbs files for Flatbuffers) and the parser of the generated file…

It seems you are on the right track! Great job!


Can you also add a feature to auto remove the libraries which are not used in the game?
By default all the libraries are included unless explicitly removed!

Plz see this post for reference:

Thanks :slight_smile:



we could do that, but how is this related to creator c++ support?


Actually, you were talking about cocos2d-x v3.14. So, I thought of bringing it up. :slight_smile:


so, the flatbuffer thing is working more or less ok.
for the moment, only labels are working, but I’ll add the remaining features next week.


Is there some TODO list to see how’s progress?


sprites almost working… there is a bug when reusing the sprite frames.

No TODO list, but basically I have to port to flatbuffers everything that I did for generating c++ files.

  • canvas / design resolution: done
  • sprite sheets: almost there
  • labels: done
  • sprites: almost there
  • scrollview: 20%
  • buttons: 20%
  • tmx: 20%
  • particles: 20%


  • flatbuffers schema: missing a few fields, but almost there, and happy with its size
  • reader: missing a few fields, but happy with the performance size. super simple, super fast.
  • python parser: missing to parse a few fields. code is Ok…, but I’m not that happy with it. But no need to refactor it now.


  • scrollview: done
  • editbox: done
  • button: done
  • progressbar: not working atm


  • fix bugs in spriteframes
  • polish the python script

tomorrow I’ll have it ready.


awesome… you’re pretty fast :stuck_out_tongue:


spritesheets: almost there… only a minor bug with size is still present.

I’ll continue tomorrow…


today I added:

  • sprites: blendFunc (it seems to be broken in Creator, but works ok in cocos2d-x)
  • labels: wrapmode
  • tilemap support: works with correct scale
  • particles: working Ok
  • started RichText support (experimental)

…and other bug fixes.

I only need to add more documentation, and it is finished!


And here you can compare cocos2d-x (left) vs. Cocos Creator (right).

Labels: RichText support is experimental… as you can see (top labels are RichText). And LineHeight is different (see multilines labels)

Sprites: BlendFunction seems to be broken on Creator (bottom left sprites look Ok on cocos2d-x but not on Creator). Only Raw+untrimmed sprites are supported. Not sure how to handle “trimmed” sprites.

ProgressBar: work in progress (top-left). Label in Buttons seems to have an incorrect vertical position (at least when the label is using TTF fonts).

tmx + particles: working Ok


And here it is:

This is an alpha version. If anyone is interested in testing it, please let me know and I’ll happily help you. Thanks!


I kept fixing some bugs. The limitation of having only a max of 9 tiled sprites is fixed. Now you can have any size:

see bottom right: the tile includes like 32 tiled sprites.


Added spine support. working on native Creator animations.


awesome… you’re great. Do you have a plan to support nested node ?