use of mx.itesm.another_monkey_paradox.Utils.Texto in project AnotherMonekyParadox by SantiagoMille.
the class EscenaAstroMuerto method crearBoton.
private void crearBoton() {
assetManager.load("regresar.png", Texture.class);
assetManager.load("HistoriaAstro/right-arrow_w.png", Texture.class);
assetManager.finishLoading();
imgBoton = assetManager.get("regresar.png");
imgBotonHome = assetManager.get("HistoriaAstro/right-arrow_w.png");
stageNivel = new Stage(vista);
texto = new Texto(1, 1, 1);
TextureRegionDrawable btnHome = new TextureRegionDrawable(new TextureRegion(imgBoton));
home = new ImageButton(btnHome);
if (!isThirdLevel) {
home.setPosition(ANCHO / 2 - imgBoton.getWidth() / 2, -100);
home.addAction(Actions.moveTo(ANCHO / 2 - imgBoton.getWidth() / 2, ALTO / 5 - imgBoton.getHeight() / 2, 0.6f));
} else {
home.setPosition(-500, -100);
}
home.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
super.clicked(event, x, y);
main.setScreen(new PantallaSplash(main));
}
});
TextureRegionDrawable btnRregresar = new TextureRegionDrawable((new TextureRegion(imgBotonHome)));
regresar = new ImageButton(btnRregresar);
if (isThirdLevel) {
regresar.setPosition(ANCHO - 103, ALTO - 25 - regresar.getHeight());
} else {
regresar.setPosition(-500, ALTO - 30 - regresar.getHeight());
}
regresar.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
super.clicked(event, x, y);
main.setScreen(new PantallaCargandoStoryMode(main, 1, 0, 3, 5));
}
});
stageNivel.addActor(home);
stageNivel.addActor(regresar);
Gdx.input.setInputProcessor(stageNivel);
}
Aggregations