SHARE
TWEET

Untitled

a guest Sep 3rd, 2014 216 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class StoneScreen implements Screen {
  2.                
  3.         OrthographicCamera camera;
  4.         final TombStone game;
  5.        
  6.         //Textures and art.
  7.         public Texture background, sdStone;
  8.         public Sprite backgrounds;
  9.        
  10.         //TextField´s stuff
  11.         private Stage stage;
  12.         private Skin skin;
  13.        
  14.        
  15.        
  16.         public StoneScreen(TombStone gam)        {
  17.         this.game = gam;
  18.        
  19.        
  20.        
  21.                 camera = new OrthographicCamera();
  22.                 camera.setToOrtho(false, 136, 204);
  23.                
  24.                 game.assets.load();
  25.                 loadStandard();
  26.                
  27.                
  28.                
  29.                        
  30.                
  31.         }
  32.        
  33.         public void loadStandard(){
  34.                 background = game.assets.background;
  35.                 sdStone = game.assets.sdStone;
  36.                 //backgrounds = Assets.backgrounds;
  37.         }
  38.  
  39.        
  40.        
  41.         @Override
  42.         public void render(float delta) {
  43.                 Gdx.gl.glClearColor(0, 0, 0.2f,1);
  44.                 Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  45.                
  46.                 //Recieves the screen width and height
  47.                 float gameHeight = Gdx.graphics.getHeight();
  48.         float gameWidth = Gdx.graphics.getWidth();
  49.        
  50.        
  51.                 camera.update();
  52.                 game.batch.setProjectionMatrix(camera.combined);
  53.                
  54.                
  55.                 game.batch.begin();
  56.                 Gdx.app.log("X", "FPS:" + Gdx.graphics.getFramesPerSecond());
  57.                
  58.                
  59.                
  60.                 game.batch.draw(background,0,0, 136, 204);
  61.                
  62.                 game.batch.draw(sdStone, 40, 20, 70, 110);
  63.                
  64.                 //SpriteBatch batcher = (SpriteBatch)stage.getBatch();
  65.                
  66.                
  67.                 game.batch.end();
  68.                
  69.                 stage.act();
  70.                 stage.draw();
  71.         }
  72.        
  73.        
  74.  
  75.         @Override
  76.         public void resize(int width, int height) {
  77.                 // TODO Auto-generated method stub
  78.                
  79.         }
  80.  
  81.         @Override
  82.         public void show() {
  83.                 // TODO Auto-generated method stub
  84.                 stage = new Stage();
  85.                 Gdx.input.setInputProcessor(stage);
  86.                 skin = new Skin(Gdx.files.internal("uiskin.json"));
  87.                 TextArea textArea = new TextArea("Text Area\nEssentially, a text field\nwith\nmultiple\nlines.\n" + "loooooo", skin);
  88.                 textArea.setX(155);
  89.                 textArea.setY(350);
  90.                 textArea.setWidth(270);
  91.                 textArea.setHeight(270);
  92.                
  93.                 TextField textField = new TextField("Text Field", skin);
  94.                 textField.setX(150);
  95.                 textField.setY(350);
  96.                 textField.setWidth(270);
  97.                 textField.setHeight(50);
  98.                 stage.addActor(textArea);
  99.                 stage.addActor(textField);
  100.                
  101.                
  102.         }
  103.  
  104.         @Override
  105.         public void hide() {
  106.                 // TODO Auto-generated method stub
  107.                
  108.         }
  109.  
  110.         @Override
  111.         public void pause() {
  112.                 // TODO Auto-generated method stub
  113.                
  114.         }
  115.  
  116.         @Override
  117.         public void resume() {
  118.                 // TODO Auto-generated method stub
  119.                
  120.         }
  121.  
  122.         @Override
  123.         public void dispose() {
  124.                 // TODO Auto-generated method stub
  125.                
  126.         }
  127.  
  128.        
  129.        
  130.        
  131. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top