*/
public interface TiledMapTile {
+ public enum BlendMode {
+ NONE,
+ ALPHA
+ }
+
+ /**
+ * @return the {@link BlendMode} to use for rendering the tile
+ */
+ public BlendMode getBlendMode();
+
+ /**
+ * Sets the {@link BlendMode} to use for rendering the tile
+ *
+ * @param blendMode the blend mode to use for rendering the tile
+ */
+ public void setBlendMode(BlendMode blendMode);
+
/**
* @return texture region used to render the tile
*/
*/
public class StaticTiledMapTile implements TiledMapTile {
+ private BlendMode blendMode = BlendMode.ALPHA;
+
private MapProperties properties;
private TextureRegion textureRegion;
+ @Override
+ public BlendMode getBlendMode () {
+ return blendMode;
+ }
+
+ @Override
+ public void setBlendMode (BlendMode blendMode) {
+ this.blendMode = blendMode;
+ }
+
/**
* @return tile's properties set
*/
@Override
public MapProperties getProperties() {
+ if (properties == null) {
+ properties = new MapProperties();
+ }
return properties;
}
* @param copy
*/
public StaticTiledMapTile(StaticTiledMapTile copy) {
- this.properties.putAll(copy.properties);
+ getProperties().putAll(copy.properties);
this.textureRegion = copy.textureRegion;
}