This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 22nd, 2013  |  syntax: Java  |  size: 1.14 KB  |  views: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package com.newrog.myGame;
  2.  
  3. import com.badlogic.gdx.ApplicationListener;
  4. import com.badlogic.gdx.Gdx;
  5. import com.badlogic.gdx.graphics.GL10;
  6. import com.badlogic.gdx.graphics.OrthographicCamera;
  7. import com.badlogic.gdx.graphics.g2d.SpriteBatch;
  8.  
  9. public class MyGdxGame implements ApplicationListener {
  10.         private OrthographicCamera camera;
  11.         private SpriteBatch batch;
  12.  
  13.         Logo logo;
  14.         @Override
  15.         public void create() {         
  16.                 float w = Gdx.graphics.getWidth();
  17.                 float h = Gdx.graphics.getHeight();
  18.                  
  19.                 camera = new OrthographicCamera(w, h);
  20.                 camera.setToOrtho(false);
  21.                
  22.                 batch = new SpriteBatch();
  23.                 logo = new Logo(100, 50);
  24.         }
  25.        
  26.         @Override
  27.         public void dispose() {
  28.                 batch.dispose();
  29.         }
  30.  
  31.  
  32.         public void update(){
  33.                 logo.update();
  34.         }
  35.        
  36.         @Override
  37.         public void render() {         
  38.                 update();
  39.                
  40.                 Gdx.gl.glClearColor(1, 1, 1, 1);
  41.                 Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
  42.                
  43.                 batch.setProjectionMatrix(camera.combined);
  44.                 batch.begin();
  45.                 logo.render(batch);
  46.                 batch.end();
  47.         }
  48.  
  49.         @Override
  50.         public void resize(int width, int height) {
  51.         }
  52.  
  53.         @Override
  54.         public void pause() {
  55.         }
  56.  
  57.         @Override
  58.         public void resume() {
  59.         }
  60. }
clone this paste RAW Paste Data