Class Layer
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
de.gurkenlabs.litiengine.environment.tilemap.xml.Layer
- All Implemented Interfaces:
ICustomPropertyProvider, ILayer
- Direct Known Subclasses:
GroupLayer, ImageLayer, MapObjectLayer, TileLayer
Represents an abstract layer in a tile map. This class extends the
CustomPropertyProvider class and implements the ILayer
interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterUnmarshal(jakarta.xml.bind.Unmarshaller u, Object parent) intGets the height.doubleGets the horizontal parallax scrolling factor of the layer.intgetId()Gets the unique id of the layer.getMap()Gets the map that owns this layer.getName()Gets the name.Gets both the X and the Y offset of the layer.doubleGets the horizontal offset of the layer.doubleGets the vertical offset of the layer.floatGets the opacity.Gets the render type used when drawing this layer.Gets the size in tiles.Gets a tint color that affects the way contents of this layer are rendered.doubleGets the vertical parallax scrolling factor of the layer.intgetWidth()Gets the width.booleanChecks if is visible.voidsetHeight(int height) Sets the height of the layer, in tiles.protected voidvoidSets the name of the layer.voidsetOpacity(float opacity) Sets the opacity of the layer in the range[0, 1].voidsetRenderType(RenderType renderType) Sets the render type used when drawing this layer.voidsetTintColor(Color tintColor) Sets the tint color of this layer.voidsetVisible(boolean visible) Sets whether the layer is visible.voidsetWidth(int width) Sets the width of the layer, in tiles.Methods inherited from class CustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getCharValue, getCharValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getMapObjectId, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, hasCustomProperty, removeProperty, setProperties, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ICustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getCharValue, getCharValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getMapObjectId, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, hasCustomProperty, removeProperty, setProperties, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue
-
Constructor Details
-
Layer
-
Layer
-
-
Method Details
-
getHeight
-
getId
-
getName
-
getOpacity
public float getOpacity()Description copied from interface:ILayerGets the opacity.- Specified by:
getOpacityin interfaceILayer- Returns:
- the opacity
-
getOffset
-
getOffsetX
public double getOffsetX()Description copied from interface:ILayerGets the horizontal offset of the layer.- Specified by:
getOffsetXin interfaceILayer- Returns:
- the x offset
-
getOffsetY
public double getOffsetY()Description copied from interface:ILayerGets the vertical offset of the layer.- Specified by:
getOffsetYin interfaceILayer- Returns:
- the y offset
-
getHorizontalParallaxFactor
public double getHorizontalParallaxFactor()Description copied from interface:ILayerGets the horizontal parallax scrolling factor of the layer. Defaults to 1.0.- Specified by:
getHorizontalParallaxFactorin interfaceILayer- Returns:
- The horizontal parallax scrolling factor.
-
getVerticalParallaxFactor
public double getVerticalParallaxFactor()Description copied from interface:ILayerGets the vertical parallax scrolling factor of the layer. Defaults to 1.0.- Specified by:
getVerticalParallaxFactorin interfaceILayer- Returns:
- The vertical parallax scrolling factor.
-
getTintColor
Description copied from interface:ILayerGets a tint color that affects the way contents of this layer are rendered.- Specified by:
getTintColorin interfaceILayer- Returns:
- A color that is used to tint the visible contents of this layer.
-
setTintColor
Description copied from interface:ILayerSets the tint color of this layer.- Specified by:
setTintColorin interfaceILayer- Parameters:
tintColor- The tint color of this layer.
-
getRenderType
Description copied from interface:ILayerGets the render type used when drawing this layer.- Specified by:
getRenderTypein interfaceILayer- Returns:
- the render type
-
getSizeInTiles
Description copied from interface:ILayerGets the size in tiles.- Specified by:
getSizeInTilesin interfaceILayer- Returns:
- the size in tiles
-
getWidth
-
getMap
-
isVisible
-
setName
-
setWidth
-
setHeight
-
setOpacity
public void setOpacity(float opacity) Description copied from interface:ILayerSets the opacity of the layer in the range[0, 1].- Specified by:
setOpacityin interfaceILayer- Parameters:
opacity- the opacity to set
-
setRenderType
Description copied from interface:ILayerSets the render type used when drawing this layer.- Specified by:
setRenderTypein interfaceILayer- Parameters:
renderType- the render type
-
setVisible
public void setVisible(boolean visible) Description copied from interface:ILayerSets whether the layer is visible.- Specified by:
setVisiblein interfaceILayer- Parameters:
visible-trueto make the layer visible
-
setMap
-
afterUnmarshal
-