-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBox.java
More file actions
34 lines (25 loc) · 887 Bytes
/
Copy pathBox.java
File metadata and controls
34 lines (25 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.github.squidat;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
/**
* Created by Angel Camacho on 26/12/17.
*/
public class Box extends Actor {
private TextureRegion graphic;
private static TextureAtlas textureAtlas;
private boolean empty;
public Box(float x, float y, float lado, boolean e) {
textureAtlas = new TextureAtlas(Gdx.files.internal("LapsObjects-2.atlas"));
this.empty = e;
graphic = textureAtlas.findRegion(String.valueOf(11));
this.setBounds(x, y, lado, lado);
}
@Override
public void draw(Batch batch, float parentAlpha) {
batch.draw(graphic,getX(),getY(), getWidth(), getHeight());
return;
}
}