Skip to main content

LoadingState

Kindclass
Packagestates
Full namestates.LoadingState
Sourcesource/states/LoadingState.hx
ExtendsMusicBeatState

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.

ParameterTypeDefault
targetNextState—
stopMusic (optional)Boolfalse
directory (optional)String'shared'

View source

create​

override function create():Void

Only compiled when #if NO_PRELOAD_ALL.

View source

loadAndSwitchState​

static function loadAndSwitchState(target:NextState, stopMusic = false)
ParameterTypeDefault
targetNextState—
stopMusic (optional)Dynamicfalse

View source

Internals​

Private / internal members
FieldTypeStatic
targetStateNextStateno
stopMusicOnLoadBoolno
directoryStringno
Method
static function getNextState(target:NextState, stopMusic = false):NextState
static function isSoundLoaded(path:String):Bool
static function isLibraryLoaded(library:String):Bool