private GameScreen() { this.superflu = SuperFlu.getInstance(); stage = new Stage(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false); groupZones = new Group(); groupVilles = new GroupVilles(); groupTransferts = new Group(); Texture backgroundTexture = superflu.manager.get("images/fond_carte.png", Texture.class); TextureRegion backgroundTextureRegion = new TextureRegion(backgroundTexture, VIRTUAL_WIDTH, VIRTUAL_HEIGHT); Image imgBackground = new Image(backgroundTextureRegion); imgBackground.touchable = false; stage.addActor(imgBackground); Texture carteTexture = superflu.manager.get("images/carte.png", Texture.class); TextureRegion carteTextureRegion = new TextureRegion(carteTexture, VIRTUAL_WIDTH, VIRTUAL_HEIGHT); Image carte = new Image(carteTextureRegion); carte.touchable = false; stage.addActor(carte); stage.addActor(groupZones); stage.addActor(groupVilles); stage.addActor(groupTransferts); stage.addActor(TransfertCreator.getInstance()); Music softMusic = superflu.manager.get("music/soft.mp3", Music.class); softMusic.play(); createEntities(); Gdx.input.setInputProcessor(stage); stage.addActor(new GlobalStatsActor(gameLogic)); }
@Override public boolean keyDown(int key) { if (key == Keys.BACK) { SuperFlu.getInstance().setScreen(MainMenuScreen.getInstance()); return true; } return false; }
private AboutScreen() { stage = new Stage(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false); superflu = SuperFlu.getInstance(); credits = superflu.manager.get("images/credits.png", Texture.class); Texture backgroundTexture = superflu.manager.get("images/fond_carte.png", Texture.class); TextureRegion backgroundTextureRegion = new TextureRegion(backgroundTexture, VIRTUAL_WIDTH, VIRTUAL_HEIGHT); Image imgBackground = new Image(backgroundTextureRegion); imgBackground.touchable = false; stage.addActor(imgBackground); stage.addActor(new Image(credits)); stage.addActor(new Dna()); }
@Override public boolean touchDown(int arg0, int arg1, int arg2, int arg3) { SuperFlu.getInstance().setScreen(MainMenuScreen.getInstance()); return true; }