Sizes in Cocos2d-x
From: http://discuss.cocos2d-x.org/t/visibile-size-window-size-etc/10592/4
With introduction of “Design Resolution”, there came various sizes in Cocos2d-x: FrameSize, WindowSize, and VisibleSize.
- getFrameSize() returns the accessible part of the screen resolution (and always when mentioned, the screen resolution, it is meant available screen resolution).
- getWinSize() returns the design resolution, but as can be noticed (in another topic) in the case of using FIXED_WIDTH /FIXED_HEIGHT , the design resolution is recalculated so to have the same aspect ratio as the screen resolution.
- getVisibleSize() returns the part of the design resolution which will be visible after the transformation from the “Design Resolution” to the “Screen Resolution”.
Thus the getFrameSize() can be used to get the device’s hardware screen resolution, while getVisibleSize() should be used to place visible components on the screen.