OSDN Git Service

5f74e90d827b4daae0c3898f6290d1d420d8b471
[mikumikustudio/libgdx-mikumikustudio.git] / gdx / src / com / badlogic / gdx / maps / objects / TextureMapObject.java
1 package com.badlogic.gdx.maps.objects;
2
3 import com.badlogic.gdx.graphics.g2d.TextureRegion;
4 import com.badlogic.gdx.maps.MapObject;
5
6 /**
7  * @brief Represents a map object containing a texture (region)
8  */
9 public class TextureMapObject extends MapObject {
10         
11         private float x = 0.0f;
12         private float y = 0.0f;
13         private float originX = 0.0f;
14         private float originY = 0.0f;
15         private float scaleX = 1.0f;
16         private float scaleY = 1.0f;
17         private float rotation = 0.0f;
18         private TextureRegion textureRegion = null;
19
20         /**
21          * @return x axis coordinate
22          */
23         public float getX() {
24                 return x;
25         }
26
27         /**
28          * @param x new x axis coordinate
29          */
30         public void setX(float x) {
31                 this.x = x;
32         }
33
34         /**
35          * @return y axis coordinate
36          */
37         public float getY() {
38                 return y;
39         }
40
41         /**
42          * @param y new y axis coordinate
43          */
44         public void setY(float y) {
45                 this.y = y;
46         }
47         
48         /**
49          * @return x axis origin
50          */
51         public float getOriginX() {
52                 return originX;
53         }
54
55         /**
56          * @param x new x axis origin
57          */
58         public void setOriginX(float x) {
59                 this.originX = x;
60         }
61
62         /**
63          * @return y axis origin
64          */
65         public float getOriginY() {
66                 return originY;
67         }
68
69         /**
70          * @param y new axis origin
71          */
72         public void setOriginY(float y) {
73                 this.originY = y;
74         }
75         
76         /**
77          * @return x axis scale
78          */
79         public float getScaleX() {
80                 return scaleX;
81         }
82
83         /**
84          * @param x new x axis scale 
85          */
86         public void setScaleX(float x) {
87                 this.scaleX = x;
88         }
89
90         /**
91          * @return y axis scale
92          */
93         public float getScaleY() {
94                 return scaleY;
95         }
96
97         /**
98          * @param y new y axis scale
99          */
100         public void setScaleY(float y) {
101                 this.scaleY = y;
102         }
103         
104         /**
105          * @return texture's rotation in radians
106          */
107         public float getRotation() {
108                 return rotation;
109         }
110         
111         /**
112          * @param rotation new texture's rotation in radians
113          */
114         public void setRotation(float rotation) {
115                 this.rotation = rotation;
116         }
117
118         /**
119          * @return region
120          */
121         public TextureRegion getTextureRegion() {
122                 return textureRegion;
123         }
124         
125         /**
126          * @param region new texture region
127          */
128         public void setTextureRegion(TextureRegion region) {
129                 textureRegion = region;
130         }
131         
132         /**
133          * Creates empty texture map object
134          */
135         public TextureMapObject() {
136                 this(null);
137         }
138         
139         /**
140          * Creates texture map object with the given region
141          * 
142          * @param textureRegion
143          */
144         public TextureMapObject(TextureRegion textureRegion) {
145                 super();
146                 this.textureRegion = textureRegion;
147         }
148 }