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.java 2 s.co m*/ import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.scenes.scene2d.Stage; import com.me.battlescreen.MyButton; public abstract class AbstractMenu { protected OpeningScreen screen; protected Stage stage; public AbstractMenu(OpeningScreen s,Stage st){ screen=s; stage=st; stage.clear(); stage.addActor(screen.getBackground()); } protected void createButtons(){ } protected void addListeners(){ } protected void createButton(MyButton button,int position, Texture t,int coef) { float heightButton=coef*screen.getHeight()*0.1f; float widthButton=(heightButton*t.getWidth()/t.getHeight()); button.setSize(widthButton, heightButton); button.setPosition(screen.getWidth()/2-widthButton/2, position*screen.getHeight()/10); stage.addActor(button); } }