Back to project page diploma-assignment.
The source code is released under:
MIT License
If you think the Android project diploma-assignment listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.me.openingscreen; /*w w w. j a v a2s . co m*/ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.scenes.scene2d.Stage; import com.me.main.MyGame; public class OpeningScreen implements Screen { private FloatingBackground background; private SpriteBatch batch; private Stage stage; public MyGame game; @SuppressWarnings("unused") private AbstractMenu menu; private int height; private int width; private boolean first; public OpeningScreen(MyGame myGame) { game = myGame; background = new FloatingBackground(this, new Texture( Gdx.files.internal("data/opening_menu_background.png"))); stage = new Stage(); batch = new SpriteBatch(); first=true; } @Override public void resize(int width, int height) { if(first){ stage.setViewport(width, height, false); stage.clear(); this.width=width; this.height=height; background.setY(0); background.setHeight(height); background.restart(); stage.addActor(background); first=false; menu=new FirstMenu(this,stage); } } @Override public void render(float delta) { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); batch.begin(); stage.draw(); batch.end(); } @Override public void show() { // TODO Auto-generated method stub Gdx.input.setInputProcessor(stage); } @Override public void hide() { // TODO Auto-generated method stub Gdx.input.setInputProcessor(null); } @Override public void pause() { // TODO Auto-generated method stub } @Override public void resume() { // TODO Auto-generated method stub } @Override public void dispose() { batch.dispose(); } public void intoPlayerScreen() { // TODO Auto-generated method stub game.destroyBattleScreen(); game.savePlayer(); this.setMenu(new PlayerMenu(this,stage)); } public void setMenu(AbstractMenu menu) { // TODO Auto-generated method stub this.menu=menu; } public int getHeight() { return height; } public int getWidth() { return width; } public FloatingBackground getBackground() { // TODO Auto-generated method stub return background; } }