LoadingState
| Kind | class |
| Package | states |
| Full name | states.LoadingState |
| Source | source/states/LoadingState.hx |
| Extends | MusicBeatState |
Public methods
new (constructor)
function new(target:NextState, stopMusic:Bool = false, directory:String = 'shared')
Only compiled when #if NO_PRELOAD_ALL.
On-demand loading state used only by -DNO_PRELOAD_ALL builds (#55).
Without PRELOAD_ALL the asset libraries are not loaded up front, so
getNextState defers to this state; it paints one loading frame and
then hands off, letting OpenFL fetch the song/library assets on first
use instead of at startup.
| Parameter | Type | Default |
|---|---|---|
target | NextState | — |
stopMusic (optional) | Bool | false |
directory (optional) | String | 'shared' |
create
override function create():Void
Only compiled when #if NO_PRELOAD_ALL.
loadAndSwitchState
static function loadAndSwitchState(target:NextState, stopMusic = false)
| Parameter | Type | Default |
|---|---|---|
target | NextState | — |
stopMusic (optional) | Dynamic | false |
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
targetState | NextState | no |
stopMusicOnLoad | Bool | no |
directory | String | no |
| Method |
|---|
static function getNextState(target:NextState, stopMusic = false):NextState |
static function isSoundLoaded(path:String):Bool |
static function isLibraryLoaded(library:String):Bool |