APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.maps

public Class MapLayer

extends Object
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.maps.tiled.TiledMapImageLayer, com.badlogic.gdx.maps.tiled.TiledMapTileLayer, com.badlogic.gdx.maps.MapGroupLayer
Imports
com.badlogic.gdx.graphics.Color, com.badlogic.gdx.utils.GdxRuntimeException

Map layer containing a set of objects and properties

Field Summary

Modifier and TypeField and Description
private String
private MapObjects
private float
private float
private float
private float
private float
private MapLayer
private MapProperties
private boolean
private float
private float
private Color
private Color
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
public Color

Returns:

layer's tint color combined with the parent's tint color
getCombinedTintColor
()

Returns a temporary color that is the combination of this layer's tint color and its parent's tint color.

public String
getName()

Returns: layer's name

public MapObjects
getObjects()

Returns: collection of objects contained in the layer

public float
getOffsetX()

Returns: layer's x offset

public float
getOffsetY()

Returns: layer's y offset

public float
getOpacity()

Returns: layer's opacity

public float
getParallaxX()

Returns: layer's parallax scrolling factor for x-axis

public float
getParallaxY()

Returns: layer's parallax scrolling factor for y-axis

public MapLayer
getParent()

Returns: the layer's parent MapLayer, or null if the layer does not have a parent

public MapProperties
getProperties()

Returns: layer's set of properties

public float
getRenderOffsetX()

Returns: the layer's x render offset, this takes into consideration all parent layers' offsets

public float
getRenderOffsetY()

Returns: the layer's y render offset, this takes into consideration all parent layers' offsets

public Color
getTintColor()

Returns: layer's tint color

public void
invalidateRenderOffset()

set the renderOffsetDirty state to true, when this layer or any parents' offset has changed

public boolean
isVisible()

Returns: whether the layer is visible or not

public void
setName(String
new name for the layer
name
)

public void
setOffsetX(float
new x offset for the layer
offsetX
)

public void
setOffsetY(float
new y offset for the layer
offsetY
)

public void
setOpacity(float
new opacity for the layer
opacity
)

public void
setParallaxX(float parallaxX)

public void
setParallaxY(float parallaxY)

public void
setParent(MapLayer
the layer's new parent {@MapLayer }, internal use only
parent
)

public void
setTintColor(Color
new tint color for the layer
tintColor
)

public void
setVisible(boolean
toggles layer's visibility
visible
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
private String name
objectsback to summary
private MapObjects objects
offsetXback to summary
private float offsetX
offsetYback to summary
private float offsetY
opacityback to summary
private float opacity
parallaxXback to summary
private float parallaxX
parallaxYback to summary
private float parallaxY
parentback to summary
private MapLayer parent
propertiesback to summary
private MapProperties properties
renderOffsetDirtyback to summary
private boolean renderOffsetDirty
renderOffsetXback to summary
private float renderOffsetX
renderOffsetYback to summary
private float renderOffsetY
tempColorback to summary
private Color tempColor
tintColorback to summary
private Color tintColor
visibleback to summary
private boolean visible

Constructor Detail

MapLayerback to summary
public MapLayer()

Method Detail

calculateRenderOffsetsback to summary
protected void calculateRenderOffsets()
getCombinedTintColorback to summary
public Color getCombinedTintColor()

Returns a temporary color that is the combination of this layer's tint color and its parent's tint color. The returned color is reused internally, so it should not be held onto or modified.

Returns:Color

layer's tint color combined with the parent's tint color

getNameback to summary
public String getName()
Returns:String

layer's name

getObjectsback to summary
public MapObjects getObjects()
Returns:MapObjects

collection of objects contained in the layer

getOffsetXback to summary
public float getOffsetX()
Returns:float

layer's x offset

getOffsetYback to summary
public float getOffsetY()
Returns:float

layer's y offset

getOpacityback to summary
public float getOpacity()
Returns:float

layer's opacity

getParallaxXback to summary
public float getParallaxX()
Returns:float

layer's parallax scrolling factor for x-axis

getParallaxYback to summary
public float getParallaxY()
Returns:float

layer's parallax scrolling factor for y-axis

getParentback to summary
public MapLayer getParent()
Returns:MapLayer

the layer's parent MapLayer, or null if the layer does not have a parent

getPropertiesback to summary
public MapProperties getProperties()
Returns:MapProperties

layer's set of properties

getRenderOffsetXback to summary
public float getRenderOffsetX()
Returns:float

the layer's x render offset, this takes into consideration all parent layers' offsets

getRenderOffsetYback to summary
public float getRenderOffsetY()
Returns:float

the layer's y render offset, this takes into consideration all parent layers' offsets

getTintColorback to summary
public Color getTintColor()
Returns:Color

layer's tint color

invalidateRenderOffsetback to summary
public void invalidateRenderOffset()

set the renderOffsetDirty state to true, when this layer or any parents' offset has changed

isVisibleback to summary
public boolean isVisible()
Returns:boolean

whether the layer is visible or not

setNameback to summary
public void setName(String name)
Parameters
name:String

new name for the layer

setOffsetXback to summary
public void setOffsetX(float offsetX)
Parameters
offsetX:float

new x offset for the layer

setOffsetYback to summary
public void setOffsetY(float offsetY)
Parameters
offsetY:float

new y offset for the layer

setOpacityback to summary
public void setOpacity(float opacity)
Parameters
opacity:float

new opacity for the layer

setParallaxXback to summary
public void setParallaxX(float parallaxX)
setParallaxYback to summary
public void setParallaxY(float parallaxY)
setParentback to summary
public void setParent(MapLayer parent)
Parameters
parent:MapLayer

the layer's new parent {@MapLayer }, internal use only

setTintColorback to summary
public void setTintColor(Color tintColor)
Parameters
tintColor:Color

new tint color for the layer

setVisibleback to summary
public void setVisible(boolean visible)
Parameters
visible:boolean

toggles layer's visibility