Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mygdx.game;
- public class MyGdxGame extends Game {
- Stage stage;
- BitmapFont yesa;
- SpriteBatch batch;
- Image img, img3;
- String font;
- @Override
- public void create() {
- setScreen(new Menu());
- }
- @Override
- public void render() {
- Gdx.gl.glClearColor(1, 0, 0, 1);
- Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
- //dont know what to do here
- }
- public class Menu extends PaideTodasAsJanelas {
- private Game game;
- SpriteBatch batch;
- Texture img, img2, img4;
- private Player player, player2;
- private Texture start, continued;
- TextureRegion my, my2, my3;
- TextureRegionDrawable myt, myt2, myt3;
- Stage stage, stage2;
- String font, starte, opcoes;
- BitmapFont yesa, funciona;
- Image ima;
- Texture img3;
- Sprite spider;
- TextureAtlas textatlas, ta;
- FileHandle f;
- TextButton b, op;
- Text fonte;
- Table t;
- @Override
- public void abrirStage(){
- stage = new Stage();
- //OrthographicCamera camera = new OrthographicCamera();
- //camera.setToOrtho(false, 800, 480);
- batch = new SpriteBatch();
- textatlas = new TextureAtlas("Agorafunfa.txt");
- TextureAtlas.AtlasRegion a = textatlas.findRegion("spider");
- spider = new Sprite(a);
- player2 = new Player("spider.png", Info.WIDTH / 2, Info.HEIGHT / 2);
- player = new Player("playerr.png", Info.WIDTH / 2, Info.HEIGHT / 2);
- img = new Texture("Captura.PNG");
- myt = new TextureRegionDrawable(my);
- yesa = new BitmapFont(Gdx.files.internal("yesa.fnt"));
- font = "Escape Planet";
- img3 = new Texture("saturno.png");
- myt2 = new TextureRegionDrawable(my2);
- funciona = new BitmapFont(Gdx.files.internal("yesa.fnt"));
- starte = "Começar";
- myt3 = new TextureRegionDrawable(my3);
- opcoes = "Opções";
- TextureAtlas ta = new TextureAtlas("Comecar.txt");
- Skin skin = new Skin();
- skin.addRegions(ta);
- final TextButton.TextButtonStyle tbs = new TextButton.TextButtonStyle();
- tbs.font = yesa;
- tbs.checked = skin.getDrawable("comecaversao2");
- tbs.up = skin.getDrawable("comeca");
- op = new TextButton("Opções", tbs);
- b = new TextButton("Começar",tbs);
- op.setTransform(true);
- b.setTransform(true);
- op.addListener(new ClickListener() {
- @Override
- public void clicked(InputEvent event, float x, float y) {
- }
- });
- b.addListener(new ClickListener() {
- @Override
- public void clicked(InputEvent event, float x, float y) {
- }
- });
- t = new Table();
- t.add(b).setActorBounds(200,200,250,300);
- t.add(op).setActorBounds(100,200,250,300);
- t.setFillParent(true);
- stage.addActor(t);
- Gdx.input.setInputProcessor(stage);
- }
- @Override
- public void dispose() {
- }
- @Override
- public void hide() {
- }
- @Override
- public void show() {
- }
- @Override
- public void render(float delta) {
- Gdx.gl.glClearColor(1, 0, 0, 1);
- Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
- batch.begin();
- batch.draw(img,0,0);
- batch.draw(img3, 200,170, 250, 170);
- yesa.draw(batch,font,440,300);
- batch.end();
- stage.draw();
- }
- public abstract class PaideTodasAsJanelas extends Stage implements Screen {
- protected PaideTodasAsJanelas(){
- super( new StretchViewport(320.0f, 240.0f, new OrthographicCamera()) );
- }
- public abstract void abrirStage();
- @Override
- public void show() {
- }
- @Override
- public void render(float delta) {
- }
Add Comment
Please, Sign In to add comment