Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Stage

舞台类 负责场景添加、切换、运行 负责画布、设备、帧率等设置

export

Hierarchy

Index

Constructors

Properties

_activeScene: any
_autoResize: any
_curViewport: any
_deltaTime: any
_engine: any
_frameRate: any
_listeners: Map<string, TinoeEventListener[]>
_scenes: any
_ticker: any
parent: EventEmitter
screenMode: ScreenMode

Accessors

  • Returns TinoeScene

  • Returns TinoeEngine

  • get frameRate(): number
  • set frameRate(val: number): void
  • Returns number

  • Parameters

    • val: number

    Returns void

  • Returns Ticker

Methods

  • addEventListener(type: string, handler: ((data: any) => any), once?: boolean): void
  • 注册handler

    memberof

    EventEmitter

    Parameters

    • type: string
    • handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    • Optional once: boolean

    Returns void

  • clear(): void
  • 清理

    Returns void

  • destroy(): void
  • 销毁

    memberof

    Stage

    Returns void

  • dispatch(type: string, data?: any): void
  • 派发事件

    memberof

    EventEmitter

    Parameters

    • type: string
    • Optional data: any

    Returns void

  • loop(sceneOrRenderFn: ((t?: number) => void) | TinoeScene): void
  • 开启主循环

    memberof

    Stage

    Parameters

    • sceneOrRenderFn: ((t?: number) => void) | TinoeScene

    Returns void

  • off(type?: string, handler?: ((data: any) => any)): void
  • 注销事件

    memberof

    EventEmitter

    Parameters

    • Optional type: string
    • Optional handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    Returns void

    {void}

  • on(type: string, handler: ((data: any) => any), once?: boolean): void
  • 注册handler

    memberof

    EventEmitter

    Parameters

    • type: string
    • handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    • Optional once: boolean

    Returns void

  • removeEventListener(type?: string, handler?: ((data: any) => any), once?: boolean): void
  • 注销handler

    memberof

    EventEmitter

    Parameters

    • Optional type: string
    • Optional handler: ((data: any) => any)
        • (data: any): any
        • Parameters

          • data: any

          Returns any

    • Optional once: boolean

    Returns void

  • resize(...props: any[]): void
  • 改变画布大小

    memberof

    Stage

    Parameters

    • Rest ...props: any[]

    Returns void

  • 渲染场景

    memberof

    Stage

    Parameters

    Returns void

  • setPixelRatio(dpr: number): void
  • 设置dpr

    memberof

    Stage

    Parameters

    • dpr: number

    Returns void

  • setViewport(x: any, y: any, width: any, height: any): void
  • 设置viewport

    memberof

    Stage

    Parameters

    • x: any
    • y: any
    • width: any
    • height: any

    Returns void

  • createOffscreenCanvas(): Canvas
  • Returns Canvas

Generated using TypeDoc