• ResolutionPolicy 类型
    • 索引
      • 属性(properties)
      • 方法
  • Details
    • 属性(properties)
      • EXACT_FIT
      • NO_BORDER
      • SHOW_ALL
      • FIXED_HEIGHT
      • FIXED_WIDTH
      • UNKNOWN
        • 参数列表
      • preApply
        • 参数列表
      • apply
        • 参数列表
      • postApply
        • 参数列表
      • setContainerStrategy
        • 参数列表
      • setContentStrategy
        • 参数列表

    ResolutionPolicy 类型

    模块: _decorator父模块: cc

    cc.ResolutionPolicy class is the root strategy class of scale strategy,its main task is to maintain the compatibility with Cocos2d-x

    索引

    属性(properties)
    • EXACT_FIT Number The entire application is visible in the specified area without trying to preserve the original aspect ratio….
    • NO_BORDER Number The entire application fills the specified area, without distortion but possibly with some cropping,…
    • SHOW_ALL Number The entire application is visible in the specified area without distortion while maintaining the original…
    • FIXED_HEIGHT Number The application takes the height of the design resolution size and modifies the width of the internal…
    • FIXED_WIDTH Number The application takes the width of the design resolution size and modifies the height of the internal…
    • UNKNOWN Number Unknow policy
    方法
    • constructor
    • preApply 策略应用前的操作
    • apply 调用策略方法
    • postApply 策略应用之后的操作
    • setContainerStrategy 设置容器的适配策略
    • setContentStrategy 设置内容的适配策略

    Details

    属性(properties)

    EXACT_FIT
    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.
    metadescription
    类型Number
    定义于cocos2d/core/platform/CCView.js:1463
    NO_BORDER
    The entire application fills the specified area, without distortion but possibly with some cropping,while maintaining the original aspect ratio of the application.
    metadescription
    类型Number
    定义于cocos2d/core/platform/CCView.js:1472
    SHOW_ALL
    The entire application is visible in the specified area without distortion while maintaining the originalaspect ratio of the application. Borders can appear on two sides of the application.
    metadescription
    类型Number
    定义于cocos2d/core/platform/CCView.js:1481
    FIXED_HEIGHT
    The application takes the height of the design resolution size and modifies the width of the internalcanvas so that it fits the aspect ratio of the deviceno distortion will occur however you must make sure your application works on differentaspect ratios
    metadescription
    类型Number
    定义于cocos2d/core/platform/CCView.js:1490
    FIXED_WIDTH
    The application takes the width of the design resolution size and modifies the height of the internalcanvas so that it fits the aspect ratio of the deviceno distortion will occur however you must make sure your application works on differentaspect ratios
    metadescription
    类型Number
    定义于cocos2d/core/platform/CCView.js:1501
    UNKNOWN
    Unknow policy
    metadescription
    类型Number
    定义于cocos2d/core/platform/CCView.js:1512



    #### 方法



    ##### constructor


    metadescription
    定义于cocos2d/core/platform/CCView.js:1378
    参数列表
    • containerStg ContainerStrategy The container strategy
    • contentStg ContentStrategy The content strategy
    preApply

    策略应用前的操作

    metadescription
    定义于cocos2d/core/platform/CCView.js:1397
    参数列表
    • view View The target view
    apply

    调用策略方法

    metadescription
    返回Object
    定义于cocos2d/core/platform/CCView.js:1408
    参数列表
    • view View The target view
    • designedResolution Size The user defined design resolution
    postApply

    策略应用之后的操作

    metadescription
    定义于cocos2d/core/platform/CCView.js:1423
    参数列表
    • view View The target view
    setContainerStrategy

    设置容器的适配策略

    metadescription
    定义于cocos2d/core/platform/CCView.js:1434
    参数列表
    • containerStg ContainerStrategy
    setContentStrategy

    设置内容的适配策略

    metadescription
    定义于cocos2d/core/platform/CCView.js:1446
    参数列表
    • contentStg ContentStrategy