Advertisement
Guest User

MenuScreen.java

a guest
Apr 30th, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.02 KB | None | 0 0
  1. package org.sandholm.max.airplane;
  2.  
  3. import com.badlogic.gdx.Gdx;
  4. import com.badlogic.gdx.graphics.GL20;
  5. import com.badlogic.gdx.graphics.g2d.BitmapFont;
  6. import com.badlogic.gdx.scenes.scene2d.ui.Label;
  7. import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
  8. import com.badlogic.gdx.scenes.scene2d.ui.Skin;
  9. import com.badlogic.gdx.scenes.scene2d.ui.Table;
  10. import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
  11. import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle;
  12.  
  13. public class MenuScreen extends AbstractScreen {
  14.    
  15.     private BitmapFont font;
  16.    
  17.     public MenuScreen(AirplaneGame game) {
  18.         super(game);
  19.     }
  20.    
  21.     public void show()
  22.     {
  23.         super.show();
  24.        
  25.         font = new BitmapFont(Gdx.files.internal("uiskin/default.fnt"), Gdx.files.internal("uiskin/default.png"), false);
  26.         // retrieve the default table actor
  27.         LabelStyle style = new LabelStyle();
  28.         style.font = font;
  29.        
  30.         Table table = super.getTable();
  31.         Label titleLabel = new Label("Airplane!", getSkin());
  32.         table.add( titleLabel ).spaceBottom( 50 );
  33.         table.row();
  34.  
  35.         // register the button "start game"
  36.         TextButton startGameButton = new TextButton( "Start game", getSkin());
  37.         //startGameButton.getStyle().font = font;
  38.  
  39.         table.add( startGameButton ).size( 300, 60 ).uniform().spaceBottom( 10 );
  40.         table.row();
  41.  
  42.         // register the button "options"
  43.         TextButton optionsButton = new TextButton( "Options", getSkin() );
  44.         //optionsButton.getStyle().font = font;
  45.        
  46.         table.add( optionsButton ).uniform().fill();
  47.     }
  48.    
  49.     @Override
  50.     public void render(float delta) {
  51.         Gdx.gl.glClearColor(AirplaneGame.skyBlue.r, AirplaneGame.skyBlue.g, AirplaneGame.skyBlue.b, AirplaneGame.skyBlue.a);
  52.         Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );
  53.         super.render(delta);
  54.     }
  55.    
  56.     @Override
  57.     public void resize(int width, int height) {
  58.         super.resize(width, height);
  59.        
  60.         Table table = new Table();
  61.         //table.
  62.     }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement