Psych Engine Logo
T-Bar Engine - Documentation

List of Global Script callbacks

  • onCreate()

    - Called when the script is first created.

  • onCreatePost()

    - Called at the end of "create".

  • onUpdate(elapsed:Float)

    - Called when the game updates.

  • onUpdatePost(elapsed:Float)

    - Called at the end of "update".

  • onDestroy()

    - Called when the global script is destroyed.

  • onDraw()

    - Called when the game redraws.

  • onDrawPost()

    - Called at the end of "draw".

  • onFocusLost()

    - Called when the window loses focus.

  • onFocusGained()

    - Called when the window gains focus.

  • onGameResized(width:Int, height:Int)

    - Called when the window is resized, with the parameters returning the new resolution.

  • onGameStart()

    - Called when the game first starts.

  • onGameReset()

    - Called when the game resets.

  • onGameResetPost()

    - Called at the end of "game reset".

  • onStateSwitch()

    - Called when you enter a new state/menu.

  • onStateSwitchPost()

    - Called at the end of "state switch".

  • onStateCreate(state:FlxState)

    - Called when the state is created. Returns the state that was created.

  • onChangePresence(presence:DiscordRichPresence)

    - Called when the Discord RPC presence is changed.

    Note: onChangePresence was removed in version 0.2.0.