Module technology.sola.engine
Class LayerComponent
java.lang.Object
technology.sola.engine.graphics.components.LayerComponent
- All Implemented Interfaces:
technology.sola.ecs.Component
LayerComponent is a
Component that contains data for a 2d rendering layers for an Entity.-
Constructor Summary
ConstructorsConstructorDescriptionLayerComponent(String layer) Creates a LayerComponent for the desired layer with default ordering.LayerComponent(String layer, int order) Creates a LayerComponent for the desired layer with default ordering. -
Method Summary
Modifier and TypeMethodDescriptiongetLayer()intgetOrder()booleanvoidUpdates the layer.voidsetOrder(int order) Updates the order in the layer.setOrderByVerticalPosition(boolean isOrderByVerticalPosition) Sets whether thisEntityshould render based on its vertical position within the layer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface technology.sola.ecs.Component
afterDeserialize
-
Constructor Details
-
LayerComponent
Creates a LayerComponent for the desired layer with default ordering.- Parameters:
layer- the identifier string for the layer
-
LayerComponent
Creates a LayerComponent for the desired layer with default ordering.- Parameters:
layer- the identifier string for the layerorder- the order for which this will be rendered in the layer (lower numbers are rendered earlier)
-
-
Method Details
-
getLayer
- Returns:
- the layer string identifier
-
getOrder
public int getOrder()- Returns:
- the order in the layer
-
setLayer
Updates the layer.- Parameters:
layer- the new layer string identifier
-
setOrder
public void setOrder(int order) Updates the order in the layer.- Parameters:
order- the new order
-
setOrderByVerticalPosition
Sets whether thisEntityshould render based on its vertical position within the layer. This ignores the order that was set.- Parameters:
isOrderByVerticalPosition- whether to render within the layer based on the vertical position- Returns:
- this
-
isOrderByVerticalPosition
public boolean isOrderByVerticalPosition()- Returns:
- whether to render within the layer based on the vertical position
-