A global script is a special kind of script that runs on everywhere on your mod: menus, game, etc...

To create one, go to data and create a script named "global", then press F5 in game to hot reload.

All flixel signals are automatically binded, as shown below.

Methods

focusGained():Void

Called whenever the game gains focus.

focusLost():Void

Called whenever the game loses focus.

gameResized(width:Int, height:Int):Void

Called whenever the game loses focus.

Parameters:

width

Width of the game

height

Height of the game

postDraw():Void

Called after the screen has been drawn.

postGameReset():Void

Called after the game has been reset.

postGameStart():Void

Called after the game has been started.

postStateSwitch():Void

Called after the state has been switched.

postUpdate(elapsed:Float):Void

Called after the game has been updated.

Aliases: postUpdate

Parameters:

elapsed

Time elapsed since last frame

preDraw():Void

Called before the game draws on screen.

preGameReset():Void

Called before the game resets.

preGameStart():Void

Called before the game starts.

preStateCreate(state:FlxState):Void

Called before the state creates.

preStateSwitch():Void

Called before the state switches.

update(elapsed:Float):Void

Called before the game updates.

Aliases: preUpdate