reorganizado, creado menu
This commit is contained in:
39
core/src/menus/MenuInicio.java
Normal file
39
core/src/menus/MenuInicio.java
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user