1 package com.badlogic.gdx.maps.objects;
3 import com.badlogic.gdx.graphics.g2d.TextureRegion;
4 import com.badlogic.gdx.maps.MapObject;
7 * @brief Represents a map object containing a texture (region)
9 public class TextureMapObject extends MapObject {
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;
21 * @return x axis coordinate
28 * @param x new x axis coordinate
30 public void setX(float x) {
35 * @return y axis coordinate
42 * @param y new y axis coordinate
44 public void setY(float y) {
49 * @return x axis origin
51 public float getOriginX() {
56 * @param x new x axis origin
58 public void setOriginX(float x) {
63 * @return y axis origin
65 public float getOriginY() {
70 * @param y new axis origin
72 public void setOriginY(float y) {
77 * @return x axis scale
79 public float getScaleX() {
84 * @param x new x axis scale
86 public void setScaleX(float x) {
91 * @return y axis scale
93 public float getScaleY() {
98 * @param y new y axis scale
100 public void setScaleY(float y) {
105 * @return texture's rotation in radians
107 public float getRotation() {
112 * @param rotation new texture's rotation in radians
114 public void setRotation(float rotation) {
115 this.rotation = rotation;
121 public TextureRegion getTextureRegion() {
122 return textureRegion;
126 * @param region new texture region
128 public void setTextureRegion(TextureRegion region) {
129 textureRegion = region;
133 * Creates empty texture map object
135 public TextureMapObject() {
140 * Creates texture map object with the given region
142 * @param textureRegion
144 public TextureMapObject(TextureRegion textureRegion) {
146 this.textureRegion = textureRegion;