Class FlixelSubState

All Implemented Interfaces:
com.badlogic.gdx.Screen, com.badlogic.gdx.utils.Disposable, com.badlogic.gdx.utils.Pool.Poolable, FlixelDestroyable, FlixelDrawable, FlixelUpdatable, FlixelBasicGroupable<FlixelBasic>, FlixelGroupable<FlixelBasic>

public abstract class FlixelSubState extends FlixelState
A FlixelSubState can be opened inside a FlixelState. By default, it stops the parent state from updating, making it convenient for pause screens or menus.

The parent state's FlixelState.persistentUpdate and FlixelState.persistentDraw flags control whether it continues to update and draw while this substate is active.

Substates can be nested: a substate can open another substate on top of itself.

  • Field Details

    • openCallback

      public Runnable openCallback
      Called when this substate is opened or resumed.
    • closeCallback

      public Runnable closeCallback
      Called when this substate is closed.
  • Constructor Details

    • FlixelSubState

      public FlixelSubState()
      Creates a new substate with a clear background.
    • FlixelSubState

      public FlixelSubState(com.badlogic.gdx.graphics.Color bgColor)
      Creates a new substate with the given background color.
      Parameters:
      bgColor - The background color for this substate.
  • Method Details

    • close

      public void close()
      Closes this substate by telling the parent state to remove it.
    • toString

      public String toString()
      Overrides:
      toString in class FlixelState