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:
substatewhich represents the state/substate it's about to open
onResize(event:ResizeEvent)
The event in question has the following parameters:
widthandheightwhich represents the new width and height of the game.oldWidthandoldHeightwhich 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()
Character Scripts
onCharacterXMLParsed(event:CharacterXMLEvent), onCharacterNodeParsed(event:CharacterNodeEvent)
onDance(event:DanceEvent)
onPlaySingAnim(event:DirectionAnimEvent)
onPlayAnim(event:PlayAnimEvent)
onGetCamPos(event:PointEvent)
destroy()
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()
Transition Scripts
create(event:TransitionCreationEvent), postCreate(event:TransitionCreationEvent)
The event is shared between both calls, but cancelling create's event stops postCreate from being called.
event in question has the following parameters:
newStatewhich represents the next state (can benull).transOutwhich represents whether it's doing a in or out transition.
update(elapsed:Float), postUpdate(elapsed:Float)
destroy()
onSkip(event:CancellableEvent)
The event can be cancelled to stop the transition from being skipped by holding SHIFT.
onFinish(event:CancellableEvent), onPostFinish()
The event can be cancelled to stop the transition from finishing (switching to the next state).
Doing so, onPostFinish won't be called.
more to be documented soon