Class cc.ResolutionPolicy

Class Summary
Constructor Attributes Constructor Name and Description
 

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

Method Summary

Class Detail

cc.ResolutionPolicy()

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

Method Detail

  • {object} apply(view, designedResolution)
    Function to apply this resolution policy 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
    The target view
    {cc.Size} designedResolution
    The user defined design resolution
    Returns:
    {object} An object contains the scale X/Y values and the viewport rect
  • postApply(view)
    Manipulation after appyling the strategy
    Parameters:
    {cc.view} view
    The target view
  • preApply(view)
    Manipulation before applying the resolution policy
    Parameters:
    {cc.view} view
    The target view
  • setContainerStrategy(containerStg)
    Setup the container's scale strategy
    Parameters:
    {cc.ContainerStrategy} containerStg
  • setContentStrategy(contentStg)
    Setup the content's scale strategy
    Parameters:
    {cc.ContentStrategy} contentStg