Cocos Creator API

1.2.0

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

ContentStrategy

模块: 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

方法

preApply
(
  • view
)

Manipulation before applying the strategy

名称 类型 描述
view View

The target view

apply
(
  • view
  • designedResolution
)
Object

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

名称 类型 描述
view View
designedResolution Size

返回:

类型: Object

scaleAndViewportRect

postApply
(
  • view
)

Manipulation after applying the strategy

名称 类型 描述
view View

The target view

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index