Class UIContentTileContent
java.lang.Object
tech.underoaks.coldcase.state.tileContent.TileContent
tech.underoaks.coldcase.state.tileContent.UIContentTileContent
- All Implemented Interfaces:
Cloneable
A
TileContent that displays text on the Map.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe different ways the text can be shifted and tilted. -
Field Summary
Fields inherited from class tech.underoaks.coldcase.state.tileContent.TileContent
tileContent, visibilityState -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newUIContentTileContentwith an empty display text and the default transform shift.Constructs a newUIContentTileContentwith the specified display text and transform shift. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaction(InteractionChain chain, Interaction interaction) Performs the action associated with this TileContent when interacted with.voidrender(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y) Renders the tileContent at the specified coordinates using the givenSpriteBatch.booleanupdate(InteractionChain chain, com.badlogic.gdx.math.Vector2 tilePosition, Interaction interaction, TileContent handler) Updates the state of this TileContent based on interactions.Methods inherited from class tech.underoaks.coldcase.state.tileContent.TileContent
clone, dispose, equals, getChildIndex, getNextContent, getTexture, getTileContentByIndex, getVisibilityState, handleAction, handleUpdate, isObjectPassable, isPlayerPassable, popContent, pushContent, setNextContent, setObjectPassable, setPlayerPassable, setTexture, setVisibilityState, topContent
-
Constructor Details
-
UIContentTileContent
public UIContentTileContent()Constructs a newUIContentTileContentwith an empty display text and the default transform shift.The default transform shift used is
UIContentTileContent.UIContentTileContentShift.SHIFT_BLOCKSIDE_LEFT. -
UIContentTileContent
Constructs a newUIContentTileContentwith the specified display text and transform shift.- Parameters:
text- the text to display on the mapshift- the transform shift configuration to apply when rendering the text
-
-
Method Details
-
render
public void render(com.badlogic.gdx.graphics.g2d.Batch batch, float x, float y) Description copied from class:TileContentRenders the tileContent at the specified coordinates using the givenSpriteBatch. If the tile has no texture, this method renders nothing.If the tileContent has a
TileContent, the render method of the content is called.- Overrides:
renderin classTileContent- Parameters:
batch- theSpriteBatchused to render the tileContentx- the x-coordinate for rendering the tiley- the y-coordinate for rendering the tile
-
action
public boolean action(InteractionChain chain, Interaction interaction) throws GameStateUpdateException Description copied from class:TileContentPerforms the action associated with this TileContent when interacted with.- Specified by:
actionin classTileContent- Parameters:
chain- InteractionChain managing the snapshot.interaction- The interaction to trigger.- Returns:
- True if the action has been taken care of; False otherwise
- Throws:
GameStateUpdateException- If a GameStateUpdate has failed
-
update
public boolean update(InteractionChain chain, com.badlogic.gdx.math.Vector2 tilePosition, Interaction interaction, TileContent handler) throws GameStateUpdateException, UpdateTileContentException Description copied from class:TileContentUpdates the state of this TileContent based on interactions.- Specified by:
updatein classTileContent- Parameters:
chain- InteractionChain managing the snapshot.tilePosition- The position of the currently selected tile.interaction- The interaction that is currently being handled.handler- The TileContent that has been handling the interaction so far.- Returns:
- True if an update has been performed; False otherwise
- Throws:
GameStateUpdateException- If a GameStateUpdate has failedUpdateTileContentException- If the TileContent couldn't be updated (due to a failing validation)
-