How to create a cc.LayerColor?

How to create a cc.LayerColor?



I’m trying to convert my project using Cocos Creator, which seems to be a great tool, thanks for making this possible!

However, I’m having some troubles using ‘simple’ components like cc.LayerColor: how can I create one using Cocos Creator?

Also, all exemples are using black backgrounds, including browser borders, and I want all to be white => is there any way to change the default settings, to have:

  • preview display white borders ?
  • generated index.html use my own preferences, instead of having to modify it at every build?

Thank you!


Found some answers, putting them here in case someone else is interrested.

After some digging (by the way, tutorial is great, as is doc in general, including invaluable API reference:, it seems there is no more layer in Cocos Creator.

I didn’t found drawing primitives, like drawRect, so how are we supposed to draw simple stuff like lines, circles, rectangles?

About modifying background color, this does the trick (it modify the color used when clearing screen):

About the last part of my question, I didn’t found where are located the templates used by Cocos Creator (I’m using Mac Version).

If someone have any idea, I would love to know.




hi @cocosdan. Do you know how to change resolution policy in Cocos Creator? I cannot find the option to change it editor and files. Thanks.


Modify the properties of Canvas in the Inspector (design resolution, fit height and fit width).

It is fully explained here:



I try to apply fit height and fit width but the device screen will have visible border. There is no way to cover the entire screen.


Did you tried to put your actual device screen size into main canvas design resolution?
(it is 960x640 by default, but you can put the values you want)



Yes, I did change the value. I don’t think it help either. There are too many types of devices out there with different screen size. For example, iPhone 5 with longer screen size will have black border space.

Actually I am looking for exact_fit to fill all the screen to remove the border space but there is no option for this.


The possibility to modify the predefined templates will be provided in v1.0.


@pandamicro when will v1.0 be released? Is there somwehere a roadmap? Would be nice to know, what is planned in which timeframe.


Thanks! Can’t wait for that. Cocos Creator is really nice to use :smile:


The english roadmap: Cocos Creator RoadMap - UPDATED thru 11/2016

@logidzk Thank you for your support