List of all script calls
All states/substates
preCreate()
, create()
, postCreate()
preUpdate(elapsed:Float)
, update(elapsed:Float)
, postUpdate(elapsed:Float)
stepHit(curStep:Int)
, beatHit(curBeat:Int)
, measureHit(curMeasure:Int)
onFocus()
, onFocusLost()
draw(event:DrawEvent)
, postDraw(event:DrawEvent)
The event
has no parameters but can be cancelled
onStateSwitch(event:StateEvent)
, onOpenSubState(event:StateEvent)
The event
in question has the following parameter:
substate
which represents the state/substate it's about to open
onResize(event:ResizeEvent)
The event
in question has the following parameters:
width
andheight
which represents the new width and height of the game.oldWidth
andoldHeight
which represents the old width and height of the game.
destroy()
PlayState.hx
onStageXMLParsed(event:StageXMLEvent)
, onStageNodeParsed(event:StageNodeEvent)
onPreGenerateStrums(event:AmountEvent)
, onPostGenerateStrums(event:AmountEvent)
onStrumCreation(event:StrumCreationEvent)
, onPostStrumCreation(event:StrumCreationEvent)
onNoteCreation(event:NoteCreationEvent)
, onPostNoteCreation(event:NoteCreationEvent)
onStartCountdown(event:CancellableEvent)
, onPostStartCountdown()
onCountdown(event:CountdownEvent)
, onPostCountdown(event:CountdownEvent)
onSongStart()
, onStartSong()
, onSongEnd()
onInputUpdate(event:InputSystemEvent)
, onPostInputUpdate()
onRatingUpdate(event:RatingUpdateEvent)
onPlayerHit(event:NoteHitEvent)
, onDadHit(event:NoteHitEvent)
, onNoteHit(event:NoteHitEvent)
onPlayerMiss(event:NoteMissEvent)
onCameraMove(event:CamMoveEvent)
onEvent(event:EventGameEvent)
onSubstateOpen(event:StateEvent)
, onSubstateClose(event:StateEvent)
onGamePause(event:CancellableEvent)
onGameOver(event:GameOverEvent)
, onPostGameOver(event:GameOverEvent)
onVocalsResync()
Dialogue Scripts (mostly substate like behavior)
structureLoaded(event:DialogueStructureEvent)
The event
replaces the create()
call on normal dialogues scripts.
next(playFirst:Bool = false)
, postNext(playFirst:Bool)
The next
call also calls custom callbacks based on the dialogue xml's line using the same argument.
close(event:CancellableEvent)
The event
also gets shared between dialogue's box and characters.
Dialogue Character Scripts
create(event:DialogueBoxStructureEvent)
, structureLoaded(event:DialogueBoxStructureEvent)
, loadingError(message:String)
, postCreate()
The event
is shared between the first two calls but cancelling the create
one won't even make the xml load and so structureLoaded
not being called, saving some time.
beatHit(curBeat:Int)
update(elapsed:Float)
playAnim(event:PlayAnimEvent)
show(event:DialogueCharShowEvent)
, postShow(event:DialogueCharShowEvent)
, showTweenCompleted(twn:FlxTween)
The event
is shared between the first two (but makes no sense in cancelling it on the post
part).
hide(event:DialogueCharHideEvent)
, postHide(event:DialogueCharHideEvent)
, hideTweenCompleted(twn:FlxTween)
The event
is shared between the first two (but makes no sense in cancelling it on the post
part).
destroy()
Dialogue Box Scripts
create(event:DialogueBoxStructureEvent)
, structureLoaded(event:DialogueBoxStructureEvent)
, postCreate()
The event
is shared between the first two calls but cancelling the create
one won't even make the xml load and so structureLoaded
not being called, saving some time.
beatHit(curBeat:Int)
update(elapsed:Float)
onPlayAnim(event:PlayAnimEvent)
playBubbleAnim(event:DialogueBoxPlayBubbleEvent)
, postPlayBubbleAnim(event:DialogueBoxPlayBubbleEvent)
The event
is shared between the two (but makes no sense in cancelling it on the post
part).
popupChar(event:DialogueBoxCharPopupEvent)
, postPopupChar(event:DialogueBoxCharPopupEvent)
The event
is shared between the two (but makes no sense in cancelling it on the post
part).
resetText(event:DialogueBoxSetTextEvent)
, postResetText()
startText(event:DialogueBoxSetTextEvent)
, postStartText()
destroy()
Global Scripts
focusLost()
, focusGained()
preDraw()
, postDraw()
preGameStart()
, postGameStart()
, preGameReset()
, postGameReset()
preStateSwitch()
, postStateSwitch()
preStateCreate()
Before FlxG.game
calls _state.create()
preUpdate()
, update()
, postUpdate()
more to be documented soon