Package squidpony.squidgrid.gui.gdx
Class AnimatedEntity
java.lang.Object
squidpony.squidgrid.gui.gdx.AnimatedEntity
public class AnimatedEntity extends Object
A simple class that wraps an Actor with its grid position, animating state, and if it is a double-width Actor.
Created by Tommy Ettinger on 7/22/2015.
-
Field Summary
Fields Modifier and Type Field Description com.badlogic.gdx.scenes.scene2d.ActoractorbooleananimatingbooleandoubleWidthintgridXintgridY -
Constructor Summary
Constructors Constructor Description AnimatedEntity(com.badlogic.gdx.scenes.scene2d.Actor actor, int x, int y)AnimatedEntity(com.badlogic.gdx.scenes.scene2d.Actor actor, int x, int y, boolean doubleWidth) -
Method Summary
Modifier and Type Method Description voidsetDirection(Direction dir)Rotates this so that "up" points in the specified direction.voidsetText(String text)
-
Field Details
-
Constructor Details
-
AnimatedEntity
-
AnimatedEntity
public AnimatedEntity(com.badlogic.gdx.scenes.scene2d.Actor actor, int x, int y, boolean doubleWidth)
-
-
Method Details
-
setText
-
setDirection
Rotates this so that "up" points in the specified direction. Only some Actors can actually be rotated; Images can, for example, but Labels cannot. This method is most likely to be used withTextCellFactory.makeDirectionMarker(Color),TextCellFactory.makeDirectionMarker(Collection, float, boolean), or one of the directionMarker methods in SquidPanel or SquidLayers, since those produce an Image (orColorChangeImage) that can be sensibly rotated to indicate a direction over a cell.- Parameters:
dir- the direction that "up" for this should point toward
-