reorganizado, creado menu

This commit is contained in:
2020-02-18 19:39:32 +01:00
parent 9cd353b2af
commit f72eede716
10 changed files with 210 additions and 12 deletions

View File

@@ -0,0 +1,39 @@
package menus;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class MenuInicio extends Menu{
public MenuInicio() {
super();
this.n_opciones=2;
this.local=Menu.INICIAL;
}
@Override
public int draw(SpriteBatch batch, float delta) {
Menu.selector.avanzar(10, delta);
switch(this.position) {
case 0:{
Menu.selector.draw(batch, Gdx.graphics.getWidth()/5, Gdx.graphics.getHeight()/2.2f);
Menu.selector.draw(batch, Gdx.graphics.getWidth()/5+200, Gdx.graphics.getHeight()/2.2f);
break;
}
case 1:{
Menu.selector.draw(batch, Gdx.graphics.getWidth()/5, Gdx.graphics.getHeight()/5f);
Menu.selector.draw(batch, Gdx.graphics.getWidth()/5+400, Gdx.graphics.getHeight()/5f);
}
}
font.draw(batch, "iniciar", Gdx.graphics.getWidth()/3.75f,Gdx.graphics.getHeight()/2);
font.draw(batch, "configuracion", Gdx.graphics.getWidth()/5,Gdx.graphics.getHeight()/4);
return this.cambiarSeleccionado();
}
int darSeleccionado() {
switch(this.position) {
case 0:return 2;
case 1:return Menu.OPCIONES;
default: return -1;
}
}
}