Class cc.ContentStrategy

Class Summary
Constructor Attributes Constructor Name and Description
 

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

Method Summary

Class Detail

cc.ContentStrategy()

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

Method Detail

  • {object} apply(view, designedResolution)
    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
    Parameters:
    {cc.view} view
    {cc.Size} designedResolution
    Returns:
    {object} scaleAndViewportRect
  • postApply(view)
    Manipulation after applying the strategy
    Parameters:
    {cc.view} view
    The target view
  • preApply(view)
    Manipulation before applying the strategy
    Parameters:
    {cc.view} view
    The target view