Module technology.sola.engine
Class RectangleRendererComponent
java.lang.Object
technology.sola.engine.graphics.components.RectangleRendererComponent
- All Implemented Interfaces:
technology.sola.ecs.Component
@NullMarked
public class RectangleRendererComponent
extends Object
implements technology.sola.ecs.Component
RectangleRendererComponent is a
Component
containing data for rendering 2d rectangles.-
Constructor Summary
ConstructorsConstructorDescriptionRectangleRendererComponent
(Color color) Creates a RectangleRendererComponent of desired color that is filled.RectangleRendererComponent
(Color color, boolean isFilled) Creates a RectangleRendererComponent of desired color that is either filled or not filled. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface technology.sola.ecs.Component
afterDeserialize
-
Constructor Details
-
RectangleRendererComponent
Creates a RectangleRendererComponent of desired color that is filled.- Parameters:
color
- theColor
of the rectangle
-
RectangleRendererComponent
Creates a RectangleRendererComponent of desired color that is either filled or not filled.- Parameters:
color
- theColor
of the rectangleisFilled
- whether the rectangle should be filled or not
-
-
Method Details
-
getColor
- Returns:
- the
Color
of the rectangle
-
isFilled
public boolean isFilled()- Returns:
- true if the rectangle should be filled when rendered
-
setColor
Sets theColor
for rendering.- Parameters:
color
- the new color
-
setFilled
public void setFilled(boolean filled) Sets whether the rectangle should be filled or not.- Parameters:
filled
- the new filled status
-