Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.sandholm.max.airplane;
- import com.badlogic.gdx.Gdx;
- import com.badlogic.gdx.graphics.GL20;
- import com.badlogic.gdx.graphics.g2d.BitmapFont;
- import com.badlogic.gdx.scenes.scene2d.ui.Label;
- import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
- import com.badlogic.gdx.scenes.scene2d.ui.Skin;
- import com.badlogic.gdx.scenes.scene2d.ui.Table;
- import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
- import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle;
- public class MenuScreen extends AbstractScreen {
- private BitmapFont font;
- public MenuScreen(AirplaneGame game) {
- super(game);
- }
- public void show()
- {
- super.show();
- font = new BitmapFont(Gdx.files.internal("uiskin/default.fnt"), Gdx.files.internal("uiskin/default.png"), false);
- // retrieve the default table actor
- LabelStyle style = new LabelStyle();
- style.font = font;
- Table table = super.getTable();
- Label titleLabel = new Label("Airplane!", getSkin());
- table.add( titleLabel ).spaceBottom( 50 );
- table.row();
- // register the button "start game"
- TextButton startGameButton = new TextButton( "Start game", getSkin());
- //startGameButton.getStyle().font = font;
- table.add( startGameButton ).size( 300, 60 ).uniform().spaceBottom( 10 );
- table.row();
- // register the button "options"
- TextButton optionsButton = new TextButton( "Options", getSkin() );
- //optionsButton.getStyle().font = font;
- table.add( optionsButton ).uniform().fill();
- }
- @Override
- public void render(float delta) {
- Gdx.gl.glClearColor(AirplaneGame.skyBlue.r, AirplaneGame.skyBlue.g, AirplaneGame.skyBlue.b, AirplaneGame.skyBlue.a);
- Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );
- super.render(delta);
- }
- @Override
- public void resize(int width, int height) {
- super.resize(width, height);
- Table table = new Table();
- //table.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement