Protected
_imageProtected
_playProtected
_playProtected
_playLoads the css from Loader.css
Protected
_styleGets or sets the background color of the loader as a hex string
Data associated with a loadable
Direct access to the game object event dispatcher.
Gets or sets the color of the loading bar, default is Color.White
Positions the top left corner of the loading bar If not set, the loader automatically positions the loading bar
Positions the top left corner of the logo image If not set, the loader automatically positions the logo
Positions the top left corner of the play button. If not set, the loader automatically positions the play button
Get/set play button text
Protected
_imageProtected
_playReturns the progress of the loader as a number between [0, 1] inclusive.
Alias for removeEventListener
. If only the eventName is specified
it will remove all handlers registered for that specific event. If the eventName
and the handler instance are specified only that handler will be removed.
Name of the event to listen for
Optional
handler: ((event: any) => void)Event handler for the thrown event
Alias for addEventListener
. You can listen for a variety of
events off of the engine; see the events section below for a complete list.
Name of the event to listen for
Event handler for the thrown event
Once listens to an event one time, then unsubscribes from that event
The name of the event to subscribe to once
The handler of the event that will be auto unsubscribed
Pre-loading assets
The loader provides a mechanism to preload multiple resources at one time. The loader must be passed to the engine in order to trigger the loading progress bar.
The Loader itself implements Loadable so you can load loaders.
Example: Pre-loading resources for a game
Customize the Loader
The loader can be customized to show different, text, logo, background color, and button.