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; //from ww w .j a v a 2s. c om import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputListener; import com.badlogic.gdx.scenes.scene2d.Stage; import com.me.battlescreen.MyButton; public class ResetMenu extends AbstractMenu{ MyButton realReset; MyButton toFirstMenu; public ResetMenu(OpeningScreen s, Stage st) { super(s, st); // TODO Auto-generated constructor stub createButtons(); addListeners(); } @Override protected void createButtons(){ Texture t=new Texture(Gdx.files.internal("data/menus/confirm.png")); realReset=new MyButton(t); createButton(realReset,3,t,1); t=new Texture(Gdx.files.internal("data/menus/return.png")); toFirstMenu=new MyButton(t); createButton(toFirstMenu,1,t,1); } @Override protected void addListeners(){ addRealResetListener(); addToFirstMenuListener(); } private void addRealResetListener() { // TODO Auto-generated method stub realReset.addListener(new InputListener(){ public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { realReset.setPressed(true); return true; } public void touchUp (InputEvent event, float x, float y, int pointer, int button) { realReset.setPressed(false); screen.game.resetPlayer(); screen.setMenu(new FirstMenu(screen,stage)); } }); } private void addToFirstMenuListener() { // TODO Auto-generated method stub toFirstMenu.addListener(new InputListener(){ public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { toFirstMenu.setPressed(true); return true; } public void touchUp (InputEvent event, float x, float y, int pointer, int button) { toFirstMenu.setPressed(false); screen.setMenu(new FirstMenu(screen,stage)); } }); } }