Core. Laya

Laya Is the reference entry set of the global object. The Laya class refers to some of the commonly used global objects, such as Laya.stage: stage, Laya.timer: time manager, Laya.loader: load manager, and note case when using.


new Laya()


(static) alertGlobalError :Boolean

(static) loader :LoaderManager

Reference to the load manager.
Default Value:
  • null

(static) stage :Stage

A reference to a stage object.
Default Value:
  • null

(static) timer :Timer

Reference to the time manager.
Default Value:
  • null

(static) version :String

Current engine version.
Default Value:
  • "1.7.7beta"


init(width, height, …plugins) → {Object}

Initialization engine. The engine needs to be initialized, otherwise it might be wrong.
Name Type Attributes Description
width Number The initial game window width, also known as the design width.
height Number Initial height of the game window, also known as the design height.
plugins Rest <repeatable>
Plugins list, such as WebGL (rendered in WebGL mode).
Returns the native canvas reference, which makes it easy to modify the canvas property