Cocos Creator API

1.0.0

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

ContentStrategy

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

Methods

preApply
(
  • view
)

Manipulation before applying the strategy

name type description
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

name type description
view View
designedResolution Size

returns:

type: Object

scaleAndViewportRect

postApply
(
  • view
)

Manipulation after applying the strategy

name type description
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