Codename LogoCodename Logo

funkin.menus.FreeplayState

APIWiki

Constructor

View in GitHub

new(?scriptsAllowed:Bool, ?scriptName:String)

Variables

@:value(0)autoplayElapsed:Float = 0

Time elapsed since last autoplay. If this time exceeds timeUntilAutoplay, the currently selected song will play.

bg:FlxSprite

Background.

@:value(true)canSelect:Bool = true

Whenever the player can navigate and select

@:value(["[TAB] Solo", "[TAB] Opponent Mode", "[TAB] Co-Op Mode", "[TAB] Co-Op Mode (Switched)"])coopLabels:Array<String> = ["[TAB] Solo", "[TAB] Opponent Mode", "[TAB] Co-Op Mode", "[TAB] Co-Op Mode (Switched)"]

Array containing all labels for Co-Op / Opponent modes.

coopText:FlxText

Text containing the current coop/opponent mode ([TAB] Co-Op mode)

@:value(0)curCoopMode:Int = 0

Currently selected coop/opponent mode

@:value(1)curDifficulty:Int = 1

Currently selected difficulty

@:value(false)curPlaying:Bool = false

Whenever the currently selected song is playing.

@:value(null)curPlayingInst:String = null

Path to the currently playing song instrumental.

@:value(0)curSelected:Int = 0

Currently selected song

diffText:FlxText

Text containing the current difficulty (< HARD >)

@:value(false)disableAsyncLoading:Bool = false

Whenever the autoplayed song gets async loaded.

@:value(false)disableAutoPlay:Bool = false

Whenever the song autoplays when hovered over.

grpSongs:FlxTypedGroup<Alphabet>

Group containing all of the alphabets

@:value([])iconArray:Array<HealthIcon> = []

Array containing all of the icons.

@:value(0)intendedScore:Int = 0

Destination for the currently lerped score.

interpColor:FlxInterpolateColor

FlxInterpolateColor object for smooth transition between Freeplay colors.

@:value(0)lerpScore:Int = 0

Currently lerped score. Is updated to go towards intendedScore.

scoreBG:FlxSprite

Black background around the score, the difficulty text and the co-op text.

scoreText:FlxText

Text containing the score info (PERSONAL BEST: 0)

@:value(true)songInstPlaying:Bool = true

Whenever the currently selected song instrumental is playing.

songList:FreeplaySonglist

Assigned FreeplaySonglist item.

@:value([])songs:Array<ChartMetaData> = []

Array containing all of the songs metadatas

@:value(1)timeUntilAutoplay:Float = 1

How much time a song stays selected until it autoplays.

Methods

View in GitHub

@:value({ force : false, change : 0 })changeCoopMode(change:Int = 0, force:Bool = false):Void

Change the current coop mode context.

Parameters:

change

How much to change

force

Force the change, even if change is equal to 0.

View in GitHub

@:value({ force : false, change : 0 })changeDiff(change:Int = 0, force:Bool = false):Void

Changes the current difficulty

Parameters:

change

How much to change.

force

Force the change if change is equal to 0

View in GitHub

@:value({ force : false, change : 0 })changeSelection(change:Int = 0, force:Bool = false):Void

Change the current selection.

Parameters:

change

How much to change

force

Force the change, even if change is equal to 0.

View in GitHub

select():Void

Selects the current song.

Inherited Variables

Defined by MusicBeatState

@:value(false)cancelConductorUpdate:Bool = false

Whenever the Conductor auto update should be enabled or not.

read onlycontrols:Controls

Game Controls. (All players / Solo)

read onlycontrolsP1:Controls

Game Controls (Player 1 only)

read onlycontrolsP2:Controls

Game Controls (Player 2 only)

read onlycurBeat:Int

Current beat

read onlycurBeatFloat:Float

Current beat, as a Float (ex: 1.24, instead of 1)

read onlycurMeasure:Int

Current beat

read onlycurMeasureFloat:Float

Current beat, as a Float (ex: 1.24, instead of 1)

read onlycurStep:Int

Current step

read onlycurStepFloat:Float

Current step, as a Float (ex: 4.94, instead of 4)

@:value(new GraphicCacheSprite())graphicCache:GraphicCacheSprite = new GraphicCacheSprite()

Dummy sprite used to cache graphics to GPU.

@:value(null)scriptName:String = null

@:value(true)scriptsAllowed:Bool = true

read onlysongPos:Float

Current song position (in milliseconds).

stateScripts:ScriptPack

Current injected script attached to the state. To add one, create a file at path "data/states/stateName" (ex: data/states/FreeplayState)

Inherited Methods

Defined by MusicBeatState

View in GitHub

call(name:String, ?args:Array<Dynamic>, ?defaultVal:Dynamic):Dynamic

View in GitHub

event<T>(name:String, event:T):T

View in GitHub

@:value({ fpsSensitive : false })lerp(v1:Float, v2:Float, ratio:Float, fpsSensitive:Bool = false):Float

Shortcut to FlxMath.lerp or CoolUtil.lerp, depending on fpsSensitive

Parameters:

v1

Value 1

v2

Value 2

ratio

Ratio

fpsSensitive

Whenever the ratio should not be adjusted to run at the same speed independent of framerate.

View in GitHub

openSubState(subState:FlxSubState):Void

SCRIPTING STUFF