Search in sources :

Example 1 with PantallaCargandoStoryMode

use of mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode 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)

Example 2 with PantallaCargandoStoryMode

use of mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode in project AnotherMonekyParadox by SantiagoMille.

the class PantallaCinematica method crearMenu.

private void crearMenu() {
    stageMenu = new Stage(vista);
    imgBackground = new Texture(this.background);
    spriteBackground = new Sprite(imgBackground);
    // Boton Next
    TextureRegionDrawable trdNext = new TextureRegionDrawable(new TextureRegion(new Texture("HistoriaAstro/right-arrow_w.png")));
    ImageButton btnNext = new ImageButton(trdNext);
    btnNext.setPosition(ANCHO - 100, ALTO - 30 - btnNext.getHeight());
    btnNext.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            // Gdx.app.log("ClickListener","Si se clickeoooo");
            if (nivel == 2) {
                main.setScreen(new PantallaCargandoStoryMode(main, 2, score, vidas, granadas));
            } else if (nivel == 3) {
                main.setScreen(new PantallaCargandoStoryMode(main, 3, score, vidas, granadas));
            } else if (nivel == 4) {
                main.setScreen(new PantallaCargandoStoryMode(main, 4, score, vidas, granadas));
            } else if (nivel == 44) {
                main.setScreen(new PantallaSplash(main));
            }
        }
    });
    stageMenu.addActor(btnNext);
    Gdx.input.setInputProcessor(stageMenu);
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ImageButton(com.badlogic.gdx.scenes.scene2d.ui.ImageButton) Sprite(com.badlogic.gdx.graphics.g2d.Sprite) 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) Texture(com.badlogic.gdx.graphics.Texture) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 3 with PantallaCargandoStoryMode

use of mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode in project AnotherMonekyParadox by SantiagoMille.

the class PantallaHistoriaAstro method crearElementos.

public void crearElementos() {
    stage = new Stage(vista);
    imgBackground = new Texture("HistoriaAstro/C 1.png");
    background = new Sprite(imgBackground);
    background.setPosition(0, 0);
    // Boton Return
    TextureRegionDrawable trdNext = new TextureRegionDrawable(new TextureRegion(new Texture("HistoriaAstro/right-arrow.png")));
    next = new ImageButton(trdNext);
    TextureRegionDrawable trdNextW = new TextureRegionDrawable(new TextureRegion(new Texture("HistoriaAstro/right-arrow_w.png")));
    nextW = new ImageButton(trdNextW);
    TextureRegionDrawable trdSkip = new TextureRegionDrawable(new TextureRegion(new Texture("HistoriaAstro/skip.png")));
    skip = new ImageButton(trdSkip);
    xnext = ANCHO - 100;
    ynext = ALTO - 30 - next.getHeight();
    nextW.setPosition(xnext, ynext);
    next.setPosition(xnext, ynext + 500);
    skip.setPosition(xnext - 12, 100);
    skip.setSize(80, 80);
    nextW.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            count++;
            if (count == 1) {
                imgBackground = new Texture("HistoriaAstro/C 2.png");
                background = new Sprite(imgBackground);
                background.setPosition(0, 0);
                skip.setPosition(-100, -100);
            } else if (count == 2) {
                imgBackground = new Texture("HistoriaAstro/C 3.png");
                background = new Sprite(imgBackground);
                background.setPosition(0, 0);
                next.setPosition(xnext, ynext);
                nextW.setPosition(xnext, ynext + 500);
            }
        }
    });
    skip.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));
        }
    });
    next.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));
        }
    });
    stage.addActor(next);
    stage.addActor(nextW);
    stage.addActor(skip);
    Gdx.input.setInputProcessor(stage);
}
Also used : TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ImageButton(com.badlogic.gdx.scenes.scene2d.ui.ImageButton) Sprite(com.badlogic.gdx.graphics.g2d.Sprite) PantallaCargandoStoryMode(mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode) Stage(com.badlogic.gdx.scenes.scene2d.Stage) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) Texture(com.badlogic.gdx.graphics.Texture) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 4 with PantallaCargandoStoryMode

use of mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode in project AnotherMonekyParadox by SantiagoMille.

the class PantallaMenu method crearMenu.

private void crearMenu() {
    cargarTexturas();
    stageMenu = new Stage(vista);
    spriteBackground = new Sprite(backgroundStory);
    spriteBackground.setPosition(0, 0);
    spriteLogo = new Sprite(imgLogo);
    spriteLogo.setPosition(ANCHO / 2 - spriteLogo.getWidth() / 2, ALTO - spriteLogo.getHeight() - 40);
    // Boton Play
    TextureRegionDrawable trdPlay = new TextureRegionDrawable(new TextureRegion(botonPlay));
    TextureRegionDrawable trdPlayPressed = new TextureRegionDrawable(new TextureRegion(botonPlayPressed));
    ImageButton btnPlay = new ImageButton(trdPlay, trdPlayPressed);
    btnPlay.setPosition(ANCHO / 2 - btnPlay.getWidth() / 2, -100);
    btnPlay.addAction(Actions.moveTo(ANCHO / 2 - btnPlay.getWidth() / 2, ALTO / 4 - btnPlay.getHeight() / 2, 0.5f));
    // Boton Leaderboard
    TextureRegionDrawable trdLead = new TextureRegionDrawable(new TextureRegion(botonLeaderboard));
    TextureRegionDrawable trdLeadPush = new TextureRegionDrawable(new TextureRegion(botonLeaderboardPressed));
    ImageButton btnLead = new ImageButton(trdLead, trdLeadPush);
    btnLead.setPosition(-200, ALTO / 4 - btnLead.getHeight() / 2);
    btnLead.addAction(Actions.moveTo(ANCHO / 4 - btnLead.getWidth() / 2, ALTO / 4 - btnLead.getHeight() / 2, 0.5f));
    // Boton CONFIG
    TextureRegionDrawable trdConfig = new TextureRegionDrawable(new TextureRegion(botonAbout));
    TextureRegionDrawable trdConfigPush = new TextureRegionDrawable(new TextureRegion(botonAboutPressed));
    ImageButton btnConfig = new ImageButton(trdConfig, trdConfigPush);
    btnConfig.setPosition(ANCHO + 200, ALTO / 4 - btnConfig.getHeight() / 2);
    btnConfig.addAction(Actions.moveTo(ANCHO * 3 / 4 - btnConfig.getWidth() / 2, ALTO / 4 - btnConfig.getHeight() / 2, 0.5f));
    // Boton Tutorial
    TextureRegionDrawable trdTut = new TextureRegionDrawable(new TextureRegion(botonTutorial));
    TextureRegionDrawable trdTutPush = new TextureRegionDrawable(new TextureRegion(botonTutorialPressed));
    ImageButton btnTut = new ImageButton(trdTut, trdTutPush);
    btnTut.setSize(105, 105);
    btnTut.setPosition(ANCHO - btnTut.getWidth() - 30, ALTO * 8 / 10 + 30);
    // Boton modo horda
    TextureRegionDrawable trdHorda = new TextureRegionDrawable(new TextureRegion(new Texture("arrow-point-to-right.png")));
    btnHorda = new ImageButton(trdHorda);
    btnHorda.setSize(60, 60);
    btnHorda.setPosition(ANCHO - btnHorda.getWidth() - 50, ALTO / 2 - btnHorda.getHeight() / 2 - 10);
    // Boton regresar de modo horda
    TextureRegionDrawable trdRegresarHorda = new TextureRegionDrawable(new TextureRegion(new Texture("arrow-point-to-left.png")));
    btnRegresarHorda = new ImageButton(trdRegresarHorda);
    btnRegresarHorda.setSize(60, 60);
    btnRegresarHorda.setVisible(false);
    btnRegresarHorda.setPosition(50, ALTO / 2 - btnRegresarHorda.getHeight() / 2 - 10);
    // Click en boton Play
    btnPlay.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            // Gdx.app.log("ClickListener","Si se clickeoooo");
            dispose();
            if (isSurvivalMode) {
                main.setScreen(new PantallaCargandoStoryMode(main, 5, 0, 3, 5));
            } else {
                // main.setScreen(new PantallaCargandoStoryMode(main, 1, 0,3,5));
                main.setScreen(new PantallaHistoriaAstro(main));
            }
        }
    });
    // Click en boton Lead
    btnLead.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            // Gdx.app.log("ClickListener","Si se clickeoooo");
            dispose();
            if (isSurvivalMode) {
                main.setScreen(new PantallaScoresSurvival(main));
            } else {
                main.setScreen(new PantallaScoresStory(main));
            }
        }
    });
    // Click en boton Developer
    btnTut.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            // Gdx.app.log("ClickListener","Si se clickeoooo");
            dispose();
            main.setScreen(new PantallaDeveloper(main));
        }
    });
    // Click en boton Horda
    btnHorda.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            isSurvivalMode = true;
            spriteBackground = new Sprite(backgroundSurvival);
            spriteBackground.setPosition(0, 0);
            btnHorda.setVisible(false);
            btnRegresarHorda.setVisible(true);
        }
    });
    // Click para regresar al modo historia
    btnRegresarHorda.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            isSurvivalMode = false;
            spriteBackground = new Sprite(backgroundStory);
            spriteBackground.setPosition(0, 0);
            btnRegresarHorda.setVisible(false);
            btnHorda.setVisible(true);
        }
    });
    // Click en boton Tutorial
    btnConfig.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            // Gdx.app.log("ClickListener","Si se clickeoooo");
            dispose();
            if (isSurvivalMode) {
                String toWrite = "Survive as long as you can, fight Dr. Timetravelov's \nminions.\n\n" + "- Use the joystick\nto move forwards and backwards. \n" + "- Use the blue button to shoot bananas.\n" + "- Use the red button to throw banana grenades.";
                main.setScreen(new PantallaTutorial(main, toWrite, false));
            } else {
                String toWrite = "Astro is seeking revenge against Dr. Timetravelov...\n\n" + "- Use the joystick to move forwards and \n  backwards. \n" + "- Use the blue button to shoot bananas.\n" + "- Use the red button to throw banana grenades.";
                main.setScreen(new PantallaTutorial(main, toWrite, true));
            }
        }
    });
    stageMenu.addActor(btnPlay);
    stageMenu.addActor(btnLead);
    stageMenu.addActor(btnConfig);
    stageMenu.addActor(btnTut);
    stageMenu.addActor(btnHorda);
    stageMenu.addActor(btnRegresarHorda);
    inputMultiplexer.addProcessor(stageMenu);
}
Also used : Sprite(com.badlogic.gdx.graphics.g2d.Sprite) PantallaCargandoStoryMode(mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) Texture(com.badlogic.gdx.graphics.Texture) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ImageButton(com.badlogic.gdx.scenes.scene2d.ui.ImageButton) Stage(com.badlogic.gdx.scenes.scene2d.Stage) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 5 with PantallaCargandoStoryMode

use of mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode in project AnotherMonekyParadox by SantiagoMille.

the class PantallaSurvival method crearMenu.

private void crearMenu() {
    stageMenu = new Stage(vista);
    imgBackground = new Texture("Background.png");
    spriteBackground = new Sprite(imgBackground);
    spriteBackground.setPosition(0, 0);
    imgLogo = new Texture("LOGO-2.png");
    spriteLogo = new Sprite(imgLogo);
    spriteLogo.setPosition(ANCHO / 2 - spriteLogo.getWidth() / 2, ALTO - spriteLogo.getHeight() - 50);
    // Boton Play
    TextureRegionDrawable trdPlay = new TextureRegionDrawable(new TextureRegion(new Texture("button_start.png")));
    TextureRegionDrawable trdPlayPressed = new TextureRegionDrawable(new TextureRegion(new Texture("button_start_pressed.png")));
    ImageButton btnPlay = new ImageButton(trdPlay, trdPlayPressed);
    btnPlay.setPosition(ANCHO / 2 - btnPlay.getWidth() / 2, ALTO / 4 - btnPlay.getHeight() / 2);
    // Boton Leaderboard
    TextureRegionDrawable trdLead = new TextureRegionDrawable(new TextureRegion(new Texture("but-lead.png")));
    TextureRegionDrawable trdLeadPush = new TextureRegionDrawable(new TextureRegion(new Texture("but-lead-push.png")));
    ImageButton btnLead = new ImageButton(trdLead, trdLeadPush);
    btnLead.setPosition(ANCHO / 4 - btnLead.getWidth() / 2, ALTO / 4 - btnLead.getHeight() / 2);
    // Boton Config
    TextureRegionDrawable trdConfig = new TextureRegionDrawable(new TextureRegion(new Texture("configButton.png")));
    TextureRegionDrawable trdConfigPush = new TextureRegionDrawable(new TextureRegion(new Texture("configButton.png")));
    ImageButton btnConfig = new ImageButton(trdConfig, trdConfigPush);
    btnConfig.setPosition(ANCHO * 9 / 10, ALTO * 8 / 10);
    btnConfig.setSize(95, 95);
    // Boton Tutorial
    TextureRegionDrawable trdTut = new TextureRegionDrawable(new TextureRegion(new Texture("but-tut.png")));
    TextureRegionDrawable trdTutPush = new TextureRegionDrawable(new TextureRegion(new Texture("but-tut-push.png")));
    ImageButton btnTut = new ImageButton(trdTut, trdTutPush);
    btnTut.setPosition(ANCHO * 9 / 10 - btnTut.getWidth() / 2, ALTO * 9 / 10 - btnTut.getHeight() / 2);
    // Click en boton Play
    btnPlay.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            // Gdx.app.log("ClickListener","Si se clickeoooo");
            dispose();
            main.setScreen(new PantallaCargandoStoryMode(main, 5, 0, 3, 5));
        }
    });
    // Click en boton Lead
    btnLead.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            // Gdx.app.log("ClickListener","Si se clickeoooo");
            dispose();
            main.setScreen(new PantallaScoresSurvival(main));
        }
    });
    // Click en boton Tutorial
    btnTut.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            // Gdx.app.log("ClickListener","Si se clickeoooo");
            dispose();
            String toWrite = "Astro is seeking revenge against Dr. Timetravelov...\n\n" + "- Use the joystick to move forwards and \n  backwards. \n" + "- Use the blue button to shoot bananas.\n" + "- Use the red button to throw banana grenades.";
            main.setScreen(new PantallaTutorial(main, toWrite, true));
        }
    });
    // Click en boton Config
    btnConfig.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            // Gdx.app.log("ClickListener","Si se clickeoooo");
            dispose();
            main.setScreen(new PantallaDeveloper(main));
        }
    });
    stageMenu.addActor(btnPlay);
    stageMenu.addActor(btnLead);
    stageMenu.addActor(btnConfig);
    stageMenu.addActor(btnTut);
    Gdx.input.setInputProcessor(stageMenu);
}
Also used : Sprite(com.badlogic.gdx.graphics.g2d.Sprite) PantallaCargandoStoryMode(mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode) TextureRegionDrawable(com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable) Texture(com.badlogic.gdx.graphics.Texture) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) ImageButton(com.badlogic.gdx.scenes.scene2d.ui.ImageButton) Stage(com.badlogic.gdx.scenes.scene2d.Stage) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Aggregations

TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)5 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)5 Stage (com.badlogic.gdx.scenes.scene2d.Stage)5 ImageButton (com.badlogic.gdx.scenes.scene2d.ui.ImageButton)5 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)5 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)5 PantallaCargandoStoryMode (mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaCargandoStoryMode)5 Texture (com.badlogic.gdx.graphics.Texture)4 Sprite (com.badlogic.gdx.graphics.g2d.Sprite)4 PantallaSplash (mx.itesm.another_monkey_paradox.PantallasDeCarga.PantallaSplash)2 Texto (mx.itesm.another_monkey_paradox.Utils.Texto)1