Skip to main content

FlixelAction

View source

class

org.flixelgdx.input.action.FlixelAction

public abstract class FlixelAction

Base type for a named logical control inside a FlixelActionSet.

Concrete types are FlixelActionDigital (boolean, many FlixelDigitalBindings OR'd together) and FlixelActionAnalog (2D vector from keys and gamepad axes, optional Steam vector merge). Subclasses are updated by the owning set's FlixelActionSet.update(float) and finalized by FlixelActionSet.endFrame().

The FlixelAction.getName() string is used for Steam Input alignment and logging; keep names stable if players rebind or use cloud profiles.

Hold-repeat

holdDelay and holdInterval control autorepeat timing used by FlixelActionDigital.held() and FlixelActionAnalog.flickedRepeating(). Set them before the game loop starts if the defaults do not suit your game:

navigate.setHoldDelay(0.4f); // Wait 400 ms before the first repeat...
navigate.setHoldInterval(0.08f); // ...then fire every 80 ms while held.

Constructors

FlixelAction(String)

protected FlixelAction(String name)

Fields

callback

public Runnable callback

Optional edge callback; assign once to avoid per-frame allocations.


active

public boolean active

When false, this action stays inactive and reads false or zero.


Methods

getName()

public String getName()

Logical name for Steam manifest alignment and debugging.

Returns: Non-null name string.


getOwner()

public FlixelActionSet getOwner()

getHoldDelay()

public float getHoldDelay()

setHoldDelay(float)

public void setHoldDelay(float holdDelay)

getHoldInterval()

public float getHoldInterval()

setHoldInterval(float)

public void setHoldInterval(float holdInterval)