ContentStrategy Class

Module: _decorator Parent Module: cc

cc.ContentStrategy class is the root strategy class of content's scale strategy, it controls the behavior of how to scale the scene and setup the viewport for the game

Index

Methods
  • preApply Manipulation before applying the strategy
  • apply Function to apply this strategy The return value is {scale: [scaleX, scaleY], viewport: {cc.Rect}}, The target view can then apply these value to itself, it's preferred not to modify directly its private variables
  • postApply Manipulation after applying the strategy

Details

Methods

preApply

Manipulation before applying the strategy

meta description
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCView.js:1137
Parameters
  • view View The target view
apply

Function to apply this strategy The return value is {scale: [scaleX, scaleY], viewport: {cc.Rect}}, The target view can then apply these value to itself, it's preferred not to modify directly its private variables

meta description
Returns Object
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCView.js:1145
Parameters
postApply

Manipulation after applying the strategy

meta description
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/CCView.js:1158
Parameters
  • view View The target view

results matching ""

    No results matching ""