This repository was archived by the owner on Jan 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Script API 1: All Preset Variables
lunarcleint edited this page Nov 9, 2022
·
10 revisions
-
function new()
Called when script is created. -
function destroy()
Called when script is destroyed. -
function update(elapsed:Float)
A function that is called every frame. -
function trace(_)
This function will trace any objects you put in it,trace("hi", "t") //prints hi,t
-
function import(path:String, ?as:Null<String>)
Will import as the haxe function would work, this only imports classes. It is important to treat the haxe classes you import carefully since they maybe be turned into another type depending on the platform. -
function addScript(scriptName:String):Dynamic
This will add any script inscripts/
, this functions also returnsgetScript(scriptName)
-
function getScript(scriptName:String):Dynamic
This will give the script's local functions and variables as a Dynamic object. -
ScriptReturn
a shortcut to the enum ScriptReturn
-
Std
A shortcut to the Std Class. -
Type
A shortcut to the Type Class. -
Reflect
A shortcut to the Reflect Class. -
Math
A shortcut to the Math Class. -
StringTools
A shortcut to the StringTools Class. -
FileSystem
A shortcut to the FileSystem Class. [THIS IS ONLY ACCESSIBLE ON THE SYS PACKAGE] -
File
A shortcut to the File Class. [THIS IS ONLY ACCESSIBLE ON THE SYS PACKAGE] -
Sys
A shortcut to the Sys Class. [THIS IS ONLY ACCESSIBLE ON THE SYS PACKAGE]
-
Lib
A shortcut to the Lib Class. -
Capabilities
A shortcut to the Capabilities Class. -
ShaderFitler
A shortcut to the ShaderFitler Class. -
FlxG
A shortcut to the FlxG Class. -
FlxBasic
A shortcut to the FlxBasic Class. -
FlxObject
A shortcut to the FlxObject Class. -
FlxSprite
A shortcut to the FlxSprite Class. -
FlxGraphic
A shortcut to the FlxGraphic Class. -
FlxTween
A shortcut to the FlxTween Class. -
FlxEase
A shortcut to the FlxEase Class. -
FlxTimer
A shortcut to the Class. -
FlxText
A shortcut to the FlxText Class. -
FlxTextFormat
A shortcut to the FlxTextFormat Class. -
FlxTextFormatMarkerPair
A shortcut to the FlxTextFormatMarkerPair Class. -
FlxTextBorderStyle
A shortcut to the FlxTextBorderStyle Class. -
FlxShader
A shortcut to the Class. -
FlxRuntimeShader
A shortcut to the FlxRuntimeShader Class. -
FlxSound
A shortcut to the FlxSound Class.
-
var state:FlxState
A shortcut to FlxG.state. -
var camera:FlxCamera
A shortcut to the FlxG.camera.
-
function add(obj:FlxBasic)
A shortcut to FlxG.state.add(obj). -
function insert(postion:Int, obj:FlxBasic)
A shortcut to FlxG.state.insert(postion, obj). -
function remove(obj:FlxBasic)
A shortcut to FlxG.state.remove(obj). -
function colorFromRGB(Red:Int, Green:Int, Blue:Int, Alpha:Int = 255)
A shortcut to FlxColor.fromRGB(Red, Green, Blue, Alpha). -
function colorFromString(str:String)
A shortcut to FlxColor.fromString(str).
-
ClientPrefs
A shortcut to the ClientPrefs Class. -
WeekData
A shortcut to the WeekData Class. -
Highscore
A shortcut to the Highscore Class. -
StageData
A shortcut to the StageData Class. -
Paths
A shortcut to the Paths Class. -
Song
A shortcut to the Song Class. -
Section
A shortcut to the Section Class. -
Conductor
A shortcut to the Conductor Class. -
Note
A shortcut to the Note Class. -
StrumNote
A shortcut to the StrumNote Class. -
NoteSplash
A shortcut to the NoteSplash Class. -
Character
A shortcut to the Character Class. -
Boyfriend
A shortcut to the Boyfriend Class.
-
PlayState
A shortcut to the PlayState Class. Please note that this is not the current instance of Playstate, for that usePlayState.instance
.
-
var curStep:Int
A shortcut to PlayStates's curStep. -
var curBeat:Int
A shortcut to PlayStates's curBeat. -
var bpm:Float
A shortcut to PlayStates's bpm. -
var camGame:FlxCamera
A shortcut to PlayStates's camGame. -
var camHUD:FlxCamera
A shortcut to PlayStates's camHUD. -
var camOther:FlxCamera
A shortcut to PlayStates's camOther. -
var camFollow:FlxPoint
A shortcut to PlayStates's camFollow. -
var camFollowPos:FlxObject
A shortcut to PlayStates's camFollowPos. -
var boyfriend:Boyfriend
A shortcut to PlayStates's boyfriend. -
var dad:Character
A shortcut to PlayStates's dad. -
var gf:Character
A shortcut to PlayStates's gf. -
var boyfriendGroup:FlxSpriteGroup
A shortcut to PlayStates's boyfriendGroup. -
var dadGroup:FlxSpriteGroup
A shortcut to PlayStates's dadGroup. -
var gfGroup:FlxSpriteGroup
A shortcut to PlayStates's gfGroup. -
var notes:FlxTypedGroup<Note>
A shortcut to PlayStates's notes. -
var strumLineNotes:FlxTypedGroup<StrumNote>
A shortcut to PlayStates's strumLineNotes. -
var playerStrums:FlxTypedGroup<StrumNote>
A shortcut to PlayStates's playerStrums. -
var opponentStrums:FlxTypedGroup<StrumNote>
A shortcut to PlayStates's opponentStrums. -
var unspawnNotes:Array<Note>
A shortcut to PlayStates's unspawnNotes.
-
function startCountdown()
Called when PlayState's startCountdown is called, you can usereturn ScriptReturn.PAUSE
to stop the function. -
function create()
Called when the end of PlayState's create (createPost). -
function countdownTick(tick:Int)
Called when a count down tick happens. -
function updateScore(missed:Bool)
Called when PlayState's updateScore is called. -
function songStart()
Called when PlayState's startSong is called. -
function eventEarlyTrigger()
Called when PlayState's eventEarlyTrigger is called, return the amount of time (miliseconds) you want a event to be early by. -
function resume()
Called when PlayState resumes the game. -
function pause()
Called when PlayState pauses the game, you can usereturn ScriptReturn.PAUSE
to stop the function. -
function spawnNote(note:Note)
Called when PlayState creates a note. -
function updatePost(elapsed:Float)
Called at the end of PlayState's update. -
function gameOver()
Called when PlayState sends player to game over, you can usereturn ScriptReturn.PAUSE
to stop the function. -
function event(name:String, val1:Dynamic, val2:Dynamic)
Called when PlayState's triggerEventNote is called. -
function endSong()
Called when PlayState's endSong is called, you can usereturn ScriptReturn.PAUSE
to stop the function. -
function ghostTap(key:Int)
Called when PlayState's detects a ghostTap. -
function noteMiss(note:Note)
Called when PlayState's noteMiss is called. -
function noteMissPress(dir:Int)
Called when PlayState's noteMissPress is called. -
function opponentNoteHit(note:Note)
Called when PlayState's opponentNoteHit is called. -
function goodNoteHit(note:Note)
Called when PlayState's goodNoteHit is called. -
function stepHit(step:Int)
Called when PlayState's stepHit is called. -
function beatHit(beat:Int)
Called when PlayState's beatHit is called. -
function recalculateRating()
Called when PlayState's is called, you can usereturn ScriptReturn.PAUSE
to stop the function. -
OVERRIDE
function add(obj:FlxBasic, ?front:Bool = false)
Adds a object behind the characters, use front to add on top.