Package com.badlogic.gdx.maps
Class MapLayer
- java.lang.Object
-
- com.badlogic.gdx.maps.MapLayer
-
- Direct Known Subclasses:
MapGroupLayer,TiledMapImageLayer,TiledMapTileLayer
public class MapLayer extends java.lang.ObjectMap layer containing a set of objects and properties
-
-
Constructor Summary
Constructors Constructor Description MapLayer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcalculateRenderOffsets()java.lang.StringgetName()MapObjectsgetObjects()floatgetOffsetX()floatgetOffsetY()floatgetOpacity()floatgetParallaxX()floatgetParallaxY()MapLayergetParent()MapPropertiesgetProperties()floatgetRenderOffsetX()floatgetRenderOffsetY()voidinvalidateRenderOffset()set the renderOffsetDirty state to true, when this layer or any parents' offset has changedbooleanisVisible()voidsetName(java.lang.String name)voidsetOffsetX(float offsetX)voidsetOffsetY(float offsetY)voidsetOpacity(float opacity)voidsetParallaxX(float parallaxX)voidsetParallaxY(float parallaxY)voidsetParent(MapLayer parent)voidsetVisible(boolean visible)
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- layer's name
-
setName
public void setName(java.lang.String name)
- Parameters:
name- new name for the layer
-
getOpacity
public float getOpacity()
- Returns:
- layer's opacity
-
setOpacity
public void setOpacity(float opacity)
- Parameters:
opacity- new opacity for the layer
-
getOffsetX
public float getOffsetX()
- Returns:
- layer's x offset
-
setOffsetX
public void setOffsetX(float offsetX)
- Parameters:
offsetX- new x offset for the layer
-
getOffsetY
public float getOffsetY()
- Returns:
- layer's y offset
-
setOffsetY
public void setOffsetY(float offsetY)
- Parameters:
offsetY- new y offset for the layer
-
getParallaxX
public float getParallaxX()
- Returns:
- layer's parallax scrolling factor for x-axis
-
setParallaxX
public void setParallaxX(float parallaxX)
-
getParallaxY
public float getParallaxY()
- Returns:
- layer's parallax scrolling factor for y-axis
-
setParallaxY
public void setParallaxY(float parallaxY)
-
getRenderOffsetX
public float getRenderOffsetX()
- Returns:
- the layer's x render offset, this takes into consideration all parent layers' offsets
-
getRenderOffsetY
public float getRenderOffsetY()
- Returns:
- the layer's y render offset, this takes into consideration all parent layers' offsets
-
invalidateRenderOffset
public void invalidateRenderOffset()
set the renderOffsetDirty state to true, when this layer or any parents' offset has changed
-
getParent
public MapLayer getParent()
- Returns:
- the layer's parent
MapLayer, or null if the layer does not have a parent
-
setParent
public void setParent(MapLayer parent)
- Parameters:
parent- the layer's new parent , internal use only
-
getObjects
public MapObjects getObjects()
- Returns:
- collection of objects contained in the layer
-
isVisible
public boolean isVisible()
- Returns:
- whether the layer is visible or not
-
setVisible
public void setVisible(boolean visible)
- Parameters:
visible- toggles layer's visibility
-
getProperties
public MapProperties getProperties()
- Returns:
- layer's set of properties
-
calculateRenderOffsets
protected void calculateRenderOffsets()
-
-