How to contral my game window size

I don’t want my game size adapt the window size.
and I want my game window are always in the center of window.
I try to contral the

. but it doesn’t work. The canvas’s size are always the same as the window size

Hi

It’s because we use resolution policy by default, you can find cc.EGLView.getInstance().setDesignResolutionSize, and remove this line of code, then you can use css to configure your canvas

Or you can wrap your canvas into a div which is centered and sized in the document body.

For more details: http://www.cocos2d-x.org/cocos-docs/manual/framework/html5/resolution-policy-design/zh

Huabin

thank you