Search in sources :

Example 6 with Texto

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);
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ImageButton(com.badlogic.gdx.scenes.scene2d.ui.ImageButton) PantallaCargandoStoryMode(mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode) Stage(com.badlogic.gdx.scenes.scene2d.Stage) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) PantallaSplash(mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaSplash) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) Texto(mx.itesm.another_monkey_paradox.Utils.Texto) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Aggregations

TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)6 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)6 Stage (com.badlogic.gdx.scenes.scene2d.Stage)6 ImageButton (com.badlogic.gdx.scenes.scene2d.ui.ImageButton)6 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)6 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)6 Texto (mx.itesm.another_monkey_paradox.Utils.Texto)6 Texture (com.badlogic.gdx.graphics.Texture)4 Sprite (com.badlogic.gdx.graphics.g2d.Sprite)4 Skin (com.badlogic.gdx.scenes.scene2d.ui.Skin)3 Preferences (com.badlogic.gdx.Preferences)2 Label (com.badlogic.gdx.scenes.scene2d.ui.Label)2 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)2 ArrayList (java.util.ArrayList)2 PantallaSplash (mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaSplash)2 Actor (com.badlogic.gdx.scenes.scene2d.Actor)1 Slider (com.badlogic.gdx.scenes.scene2d.ui.Slider)1 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)1 PantallaCargandoStoryMode (mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode)1