FlixelSubState
View sourceclass
org.flixelgdx.FlixelSubState
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.
Constructors
FlixelSubState()
Creates a new substate with a clear background.
FlixelSubState(Color)
Creates a new substate with the given background color.
Parameters:
| Name | Description |
|---|---|
bgColor | The background color for this substate. |
Fields
openCallback
Called when this substate is opened or resumed.
closeCallback
Called when this substate is closed.
Methods
syncBackgroundToCameras()
Re-applies this substate's background to all cameras (needed if the constructor ran before FlixelGame.create).
close()
Closes this substate by telling the parent state to remove it.