001package squidpony.squidgrid.gui.gdx; 002 003import com.badlogic.gdx.scenes.scene2d.Actor; 004import com.badlogic.gdx.scenes.scene2d.ui.Label; 005 006/** 007 * A simple class that wraps an Actor with its grid position, animating state, and if it is a double-width Actor. 008 * Created by Tommy Ettinger on 7/22/2015. 009 */ 010public class AnimatedEntity { 011 public Actor actor; 012 public int gridX, gridY; 013 public boolean animating = false; 014 public boolean doubleWidth = false; 015 public AnimatedEntity(Actor actor, int x, int y) 016 { 017 this.actor = actor; 018 gridX = x; 019 gridY = y; 020 } 021 public AnimatedEntity(Actor actor, int x, int y, boolean doubleWidth) 022 { 023 this.actor = actor; 024 gridX = x; 025 gridY = y; 026 this.doubleWidth = doubleWidth; 027 } 028 public void setText(String text) 029 { 030 if(actor.getClass() == Label.class) 031 { 032 ((Label)actor).setText(text); 033 } 034 } 035}