Skip to content
This repository was archived by the owner on Dec 30, 2023. It is now read-only.

Custom Substate Script

skellypupper edited this page May 20, 2023 · 5 revisions
Empty Script

An example substate script can be found here.

function create() {}
function update(elapsed:Float) {}
function sectionHit(section:Int) {}
function beatHit(beat:Int) {}
function stepHit(step:Int) {}

How to use

Make custom substate script at substates/<mysub>/init.hxs, you can put your substates assets in the <mysub> folder too.

You can call your substate in a song script by using game.openCustomSubState.

ex: game.openCustomSubState("<mysub>")

Variables

  • sub: The current substate class.
  • Paths: Custom paths instance that only reads for files inside the <mysub> directory.
  • _Paths: The global paths instance.

Callbacks

Required

  • create(): The function where you initialize your substate, if an error occurs, your substate will close itself.

Optional

  • sectionHit(section:Int): Called every section.
  • beatHit(beat:Int): Called every beat.
  • stepHit(step:Int): Called every step.
  • update(elapsed:Float): Updates every frame.
Clone this wiki locally