Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. class CoinTexture extends Actor {
  2. @Override
  3. public void draw(Batch batch, float parentAlpha) {
  4. batch.draw(game.Coin, getX(),getY(), getWidth(), getHeight());
  5. super.draw(batch, parentAlpha);
  6. }
  7. Rectangle bounds;
  8. public CoinTexture() {
  9. bounds=new Rectangle((int)getX(), (int)getY(), (int)getWidth(), (int)getHeight());
  10. }
  11.  
  12. public Rectangle getBounds() {
  13.  
  14. return bounds;
  15. }
  16.  
  17. private void setXY(float pX,float pY) {
  18. setPosition(pX, pY);
  19. bounds.setX((int) pX);
  20. bounds.setY((int) pY);
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement