inicio personajes y partida
This commit is contained in:
@@ -11,13 +11,14 @@ public class Gifs {
|
||||
private float contadorEstado;
|
||||
|
||||
public Gifs(String ruta, int n_estados, int inicio_image, int desplazamiento,
|
||||
int anchura, int x, int y) {
|
||||
int anchura, int x, int y, boolean flip) {
|
||||
textura = new Texture(ruta);
|
||||
this.n_estados = n_estados;
|
||||
frames = new TextureRegion[n_estados];
|
||||
for(int i = 0; i<n_estados; i++) {
|
||||
frames[i] = new TextureRegion(textura, inicio_image+i*desplazamiento
|
||||
frames[i] = new TextureRegion(textura, inicio_image+(i*desplazamiento)
|
||||
, anchura, x, y);
|
||||
frames[i].flip(flip, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,5 +41,7 @@ public class Gifs {
|
||||
public void draw(SpriteBatch batch, float x, float y) {
|
||||
batch.draw(this.frames[(int)contadorEstado], x, y);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
this.textura.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user