Skip to main content

FlixelActionSets

View source

class

org.flixelgdx.input.action.FlixelActionSets

public final class FlixelActionSets

Global registry of FlixelActionSet instances. FlixelGame invokes FlixelActionSets.update(float) and FlixelActionSets.endFrameAll() so every registered set stays on the same contract as FlixelInputManager (keys, mouse, gamepads).

When updateAll runs

Order inside FlixelGame.update(float): Flixel.keys.update(), Flixel.mouse.update(), Flixel.gamepads.update(), then FlixelActionSets.update(float). Gameplay code in FlixelState runs after that, so jump.justPressed() reflects this frame's input.

When endFrameAll runs

After FlixelGame.draw and the input managers' endFrame() calls, FlixelActionSets.endFrameAll() copies digital and analog edge state for the next frame.

Registration

FlixelActionSet registers in its constructor unless you use FlixelActionSet.FlixelActionSet(...) with false (tests). Call FlixelActionSet.destroy() to unregister. Avoid registering or destroying sets from inside another set's FlixelActionSet.update(float) unless you know the iteration order is safe.

Methods

update(float)

public static void update(float elapsed)

Invoked from FlixelGame.update(float) after gamepad polling.

Parameters:

NameDescription
elapsedSeconds since last frame (same as game update).

endFrameAll()

public static void endFrameAll()

Invoked from FlixelGame.render() after keys, mouse, and gamepads endFrame().


registeredCountForTests()

public static int registeredCountForTests()

For tests: number of registered sets.


clearRegistryForTests()

public static void clearRegistryForTests()

For tests: clear registry without calling destroy on sets.