I can not redeem the position of a sprite. I want to redeem the position of just a sprite how do I?
public class Cubos extends Actor {
Sprite azul, verde, vermelho, amarelo, cinza;
public Cubos(){
azul = new Sprite(new Texture(Gdx.files.internal("texture.png")), 160, 0, 96,96);
verde = new Sprite(new Texture(Gdx.files.internal("texture.png")), 0, 192, 64,64);
vermelho = new Sprite(new Texture(Gdx.files.internal("texture.png")), 160, 96, 96,96);
amarelo = new Sprite(new Texture(Gdx.files.internal("texture.png")), 64, 0, 96,96);
cinza = new Sprite(new Texture(Gdx.files.internal("texture.png")), 256, 0, 96,96);
}
public void act(float delta){
super.act(delta);
//Quero saber a posição X do azul ou amarelo eu faço "azul.getX() e retorna 0"
} }
If I write for ex. azul.getX()
returns "0.0" but if I write this.getX()
returns a position X I do not know which color.