Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ContentStrategy

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

Hierarchy

  • ContentStrategy

Index

Constructors

constructor

Properties

Private _result

_result: AdaptResult

name

name: string = "ContentStrategy"

Static EXACT_FIT

EXACT_FIT: any

Static FIXED_HEIGHT

FIXED_HEIGHT: any

Static FIXED_WIDTH

FIXED_WIDTH: any

Static NO_BORDER

NO_BORDER: any

Static SHOW_ALL

SHOW_ALL: any

Methods

buildResult

  • buildResult(containerW: any, containerH: any, contentW: any, contentH: any, scaleX: any, scaleY: any): AdaptResult

apply

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

    Parameters

    Returns AdaptResult

    The result scale and viewport rect

postApply

  • postApply(_view: View): void

preApply

  • preApply(_view: View): void

Generated using TypeDoc