cocos2d-x FrameSize VisibleSize WinSize
更新:HHH   时间:2023-1-7


FrameSize  屏幕分辨率

WinSize   DisignReslution

VisibleSize  在WinSize之内,小于或者等于WinSize


屏幕分辨率适配模式:

1.kResolutionExactFit   横向按横向比拉伸,纵向按纵向比拉伸

2.kResolutionNoBorder  MAC(横向比,纵向比) 拉伸 ,会裁切

3.kResolutionShowAll   MIN(横向比,纵向比) 拉伸  ,会出现黑边

4.kResolutionFixedHeight   高度撑满,纵向裁切 ,配合缩放因子 RH/DH

5.kResolutionFixedWidth  宽度撑满,纵向裁切 ,配合缩放因子 RW/DW

6.kResolutionUnKnown

enum ResolutionPolicy
{
    // The entire application is visible in the specified area without trying to preserve the original aspect ratio.
    // Distortion can occur, and the application may appear stretched or compressed.
    kResolutionExactFit,
    // The entire application fills the specified area, without distortion but possibly with some cropping,
    // while maintaining the original aspect ratio of the application.
    kResolutionNoBorder,
    // The entire application is visible in the specified area without distortion while maintaining the original
    // aspect ratio of the application. Borders can appear on two sides of the application.
    kResolutionShowAll,
    // The application takes the height of the design resolution size and modifies the width of the internal
    // canvas so that it fits the aspect ratio of the device
    // no distortion will occur however you must make sure your application works on different
    // aspect ratios
    kResolutionFixedHeight,
    // The application takes the width of the design resolution size and modifies the height of the internal
    // canvas so that it fits the aspect ratio of the device
    // no distortion will occur however you must make sure your application works on different
    // aspect ratios
    kResolutionFixedWidth,

    kResolutionUnKnown,
};


返回游戏开发教程...