Module technology.sola.engine
Class TriangleRendererComponent
java.lang.Object
technology.sola.engine.graphics.components.TriangleRendererComponent
- All Implemented Interfaces:
technology.sola.ecs.Component
@NullMarked
public class TriangleRendererComponent
extends Object
implements technology.sola.ecs.Component
TriangleRendererComponent is a
Component
containing data for rendering 2d triangles.-
Constructor Summary
ConstructorsConstructorDescriptionTriangleRendererComponent
(Color color) Creates a "unit triangle" renderer with uniform side lengths of 1.TriangleRendererComponent
(Color color, boolean isFilled, Triangle triangle) Creates a TriangleRendererComponent of desired color that is either filled or not filled.TriangleRendererComponent
(Color color, Triangle triangle) Creates a TriangleRendererComponent of desired color that is 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
-
TriangleRendererComponent
Creates a "unit triangle" renderer with uniform side lengths of 1.- Parameters:
color
- theColor
of the triangle
-
TriangleRendererComponent
Creates a TriangleRendererComponent of desired color that is filled.- Parameters:
color
- theColor
of the triangletriangle
- the shape of the triangle to be rendered
-
TriangleRendererComponent
Creates a TriangleRendererComponent of desired color that is either filled or not filled.- Parameters:
color
- theColor
of the triangleisFilled
- whether the triangle should be filled or nottriangle
- the shape of the triangle to be rendered
-
-
Method Details
-
getColor
- Returns:
- the
Color
of the triangle
-
isFilled
public boolean isFilled()- Returns:
- true if the triangle should be filled when rendered
-
setColor
Sets theColor
for rendering.- Parameters:
color
- the new color
-
setFilled
public void setFilled(boolean filled) Sets whether the triangle should be filled or not.- Parameters:
filled
- the new filled status
-
getTriangle
- Returns:
- the shape of the triangle to be rendered
-