API Docs for: 1.13.1
Show:

game.Loader Class

Extends game.Class
Defined in: engine/loader.js:11
Module: loader

Dynamic loader for assets and audio files.

Constructor

game.Loader

(
  • callback
)

Defined in engine/loader.js:11

Parameters:

  • callback Function | String

Methods

extend

(
  • prop
)
game.Class

Inherited from game.Class: engine/core.js:757

Extend class.

Parameters:

  • prop Object

Returns:

init

(
  • arguments
)

Inherited from game.Class: engine/core.js:811

This method is called, when you create new instance of the class.

Parameters:

  • arguments Array

initStage

()

Defined in engine/loader.js:75

Init loader stage, when not using dynamic mode.

inject

(
  • prop
)

Inherited from game.Class: engine/core.js:825

Inject class.

Parameters:

  • prop Object

onComplete

(
  • callback
)

Defined in engine/loader.js:97

Set callback function or scene name for loader.

Parameters:

  • callback Function | String

onPercentChange

()

Called when percent is changed.

start

()

Start loader.

staticInit

(
  • arguments
)

Inherited from game.Class: engine/core.js:795

This method is called before init.

Parameters:

  • arguments Array

Properties

assetQueue

Array

Defined in engine/loader.js:29

List of assets to load.

audioQueue

Array

Defined in engine/loader.js:34

List of audios to load.

loaded

Number

Defined in engine/loader.js:19

Number of files loaded.

percent

Number

Defined in engine/loader.js:24

Percent of files loaded.

started

Boolean

Defined in engine/loader.js:39

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