class FreeplayState
package funkin.ui.freeplay
extends MusicBeatSubState › FlxSubState › FlxState › FlxTypedContainer › FlxTypedGroup › FlxBasic
Available on all platforms
The state for the freeplay menu, allowing the player to select any song to play.
Static variables
staticCUTOUT_WIDTH:Float = FullScreenScaleMode.gameCutoutSize.x / 1.5
For scaling some sprites on wide displays.
staticfinalread onlyDEFAULT_DOTS_GROUP_POS:Array<Int> = [260, 170]
For positioning the difficulty dots.
staticfinalread onlyFADE_IN_DELAY:Float = 0.25
For the audio preview, the time to wait before attempting to load a song preview.
staticfinalread onlyFADE_IN_DURATION:Float = 0.5
For the audio preview, the duration of the fade-in effect.
staticfinalread onlyFADE_IN_END_VOLUME:Float = 1.0
For the audio preview, the volume at which the fade-in ends.
staticfinalread onlyFADE_IN_START_VOLUME:Float = 0.25
For the audio preview, the volume at which the fade-in starts.
staticfinalread onlyFADE_OUT_DURATION:Float = 0.25
For the audio preview, the duration of the fade-out effect.
staticfinalread onlyFADE_OUT_END_VOLUME:Float = 0.0
For the audio preview, the volume at which the fade-out starts.
staticrememberedCharacterId:String = Constants.DEFAULT_CHARACTER
The character we were on when this menu was last accessed.
staticrememberedDifficulty:String = Constants.DEFAULT_DIFFICULTY
The difficulty we were on when this menu was last accessed.
staticrememberedSongId:Null<String> = "tutorial"
The song we were on when this menu was last accessed.
NOTE: null if the last song was Random.
staticrememberedVariation:String = Constants.DEFAULT_VARIATION
The remembered variation we were on when this menu was last accessed.
Static methods
staticbuild(?params:Null<FreeplayStateParams>, ?stickers:StickerSubState):MusicBeatState
Build an instance of FreeplayState that is above the MainMenuState.
Returns:
The MainMenuState with the FreeplayState as a substate.
Constructor
Variables
backingImage:FunkinSprite
The backing card that has the toned dots, right now we just use that one dad graphic dave cooked up
Methods
createFreeplayDJ(x:Float, y:Float, characterId:String):Void
Create a FreeplayDJ for the current character.
Parameters:
x | The X position. |
|---|---|
y | The Y position. |
characterId | The character ID to use. |
dispatchEvent(event:ScriptEvent):Void
Dispatches script events to all relevant scripted classes.
Parameters:
null | event |
|---|
generateSongList(filterStuff:Null<SongFilter>, force:Bool = false, onlyIfChanged:Bool = true, noJumpIn:Bool = false):Void
Given the current filter, rebuild the current song list and display it. Automatically takes into account currentDifficulty, character, and variation
Parameters:
filterStuff | A filter to apply to the song list (regex, startswith, all, favorite) |
|---|---|
force | Whether the capsules should "jump" back in or not using their animation |
onlyIfChanged | Only apply the filter if the song list has changed |
noJumpIn | Will not call the jump-in function, used when changing difficulties to update the song list correctly without this happening twice |
sortSongs(songsToFilter:Array<Null<FreeplaySongData>>, songFilter:SongFilter):Array<Null<FreeplaySongData>>
Filters an array of songs based on a filter
Parameters:
songsToFilter | What data to use when filtering |
|---|---|
songFilter | The filter to apply |
Returns:
Array