In the current game that I’m developing, we are using a design resolution of 480x320 (Landscape) and using a FIXED_HEIGHT Resolution policy. Im using HDR graphics for the bigger resolutions, but in the iPad4 the graphics are displayed in poor quality since the canvas size instead of being 2048x1536 is 1024x768.
How can I fix this issue and make the canvas size equal to the real size of the device screen? I was using 2.2.1 and now I updated to 2.2.2.
Hey!, thanks for the quick support.
I tested and the graphics look fine now. Also I remote debugging using Safari and i can see that the gamecanvas have the right dimensions, but the Cocos2dGameContainer have another dimensions.
Example:
Thats not a problem, but… how can I get the device dimensions ie. 1960x1306, in order to load the HDR graphics on some devices? Using cc.EGLView.getInstance().getFrameSize(); returns the Cocos2dGameContainers dimensions.
The canvas style size and the container size is the trick to make the retina adaptation work.
For reference of your canvas real size in pixel, you can use cc.Director.getInstance().getWinSizeInPixels(). Otherwise, cc.EGLView.getInstance().getDevicePixelRatio() will give you the retina display pixel ratio, by multiplying it with the frame size, you should get the real size of your canvas also.