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

class

ContentStrategy

Hierarchy

  • ContentStrategy

Index

Constructors

constructor

Properties

Private result

result: object

Type declaration

  • scale: number[]
  • viewport: null | Rect

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): object
  • Parameters

    • containerW: any
    • containerH: any
    • contentW: any
    • contentH: any
    • scaleX: any
    • scaleY: any

    Returns object

    • scale: number[]
    • viewport: null | Rect

apply

  • apply(_view: any, designedResolution: any): object
  • 调用策略方法

    method

    apply

    Parameters

    • _view: any
    • designedResolution: any

    Returns object

    scaleAndViewportRect

    • scale: number[]

postApply

  • postApply(_view: any): void

preApply

  • preApply(_view: any): void

Generated using TypeDoc