API Docs for: 1.13.1
Show:

game.Loader Class

Extends game.Class
Module: loader

Dynamic loader for assets and audio files.

Constructor

game.Loader

(
  • callback
)

Parameters:

  • callback Function | String

Methods

initStage

()

Init loader stage, when not using dynamic mode.

onComplete

(
  • callback
)

Set callback function or scene name for loader.

Parameters:

  • callback Function | String

onPercentChange

()

Called when percent is changed.

start

()

Start loader.

Properties

assetQueue

Array

List of assets to load.

audioQueue

Array

List of audios to load.

loaded

Number

Number of files loaded.

percent

Number

Percent of files loaded.

started

Boolean

Is loader started.

Default: false

Attributes

barBg

Number

Loading bar background color.

Default: 0x231f20

barColor

Number

Loading bar color.

Default: 0xe6e7e8

barHeight

Number

Height of the loading bar.

Default: 20

barWidth

Number

Width of the loading bar.

Default: 200

bgColor

Number

Loader background color.

Default: 0x000000

crossorigin

Boolean

Threat requests as crossorigin.

Default: true

time

Number

Minimum time to show loader (ms).

Default: 200