Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. //Creat a new class called Textures
  2.  
  3. public class Textures {
  4. Texture backGround;
  5.  
  6. public Textures(){
  7. //assuming your not using AssetManager
  8. backGround = new Texture(Gdx.files.internal("data/bg.jpg"));
  9. }
  10. }
  11.  
  12. //in your main project class
  13.  
  14. Textures t;
  15.  
  16. // in your constructer
  17.  
  18. t = new Textures();
  19.  
  20.  
  21. // when you want to draw the texture
  22.  
  23. batch.begin();
  24. batch.draw(t.backGround,x,y,w,h);
  25. batch.end();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement