-
Notifications
You must be signed in to change notification settings - Fork 1
Lua Functions and Callbacks
all playstate functions that didn't reference anything to do with playstate are global, otherwise they are playstate specific
Lua.LUATTABLE is the basic lua table/array
Acts like FlxTween.tween
in haxe, ex:
doTween('boyfriend', {x = 0, y = 24, ['scale.x'] = 0.5}, 2, {ease = 'cubeOut', onComplete = function()
debugPrint 'tween DONE!'
end})
CURRENTLY BROKEN AT THE TIME OF WRITING THIS!
runs an anonymous timer with a callback, ex:
timer(0.5, function()
debugPrint 'hiiiiiiiiiiiiii'
end)
gets a control from the controls object, ex:
if controls 'UI_LEFT_P' then
debugPrint 'left just pressed!'
end
switches to a musicbeatstate from just a string, ex:
if goToNextState then
switchState 'TitleState'
end
calls a function in the current state by the name given, ex:
callMethod('method', {1, 2, 3})
sets a global property that can be used in any state
returns a global property
enters a song without difficulty number nonsense, ex:
enterSong('fresh', 'hard')
returns a gameplay changers value
returns a client preference
makes a sprite with a randomized background or the default background
sets the randomized backgrounds to the inputted array
sets a field inside the variables map, usually used by hscript
called when every lua script is finished loading
called every time another function is called
Can be stopped with Function_Stop
called right before the title state is created, this really isn't that useful anymore with initial state support
called when the main intro starts (with the text)
like onBeatHit, but for the intro text
this is called when the intro ends
Can be stopped with Function_Stop
called when the user exits the state
called right before the state is about to switch
called when the user accepts
Can be stopped with Function_Stop
called when the game is about to switch to a new state
returns an array of objects, theres an object for each song that contains things like the song name, color, character, ect. ex:
for i,song in pairs(getSongs()) do
debugPrint(song.songName)
end
ONLY USE IN THE getOptions
CALLBACK!
adds a gameplay changer from a table. The table has all the properties named out, to see what properties you can have you can see the typedef here, ex:
addGameplayChanger{
text = 'cool mode',
type = 'bool',
variable = 'coolmode', --variable to get with getGameplayChanger
defaultValue = false
}
Can be stopped with Function_Stop
called when a song is added to the song list
Can be stopped with Function_Stop
called when the user exits the state
called right before the state is about to switch
Can be stopped with Function_Stop
called before the song json is loaded, only stop this for things like the dnb 3.0 terminal
Can be stopped with Function_Stop
called after the song is successfully loaded, use this for character select screens so you can just switchState 'playstate'
called when the user resets the score to a song
called when the user changes the difficulty
called after the difficulty was changed
called when the user changes the song
called after the song was changed
called when the gameplay changers are added
use this to add another option menu
ONLY USE IN THE onOptionsAdded
CALLBACK!
adds an option from a table. The table has all the properties named out, to see what properties you can have you can see the typedef here, ex:
addOption{
name = 'side scroll',
description = 'the notes go SIDEWAYS!',
variable = 'sidescroll',
type = 'bool',
defaultValue = false
}
called when the options in that specific state are loaded, this is where you can add your own options