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 that is filled.TriangleRendererComponent(Color color, boolean isFilled) 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, waitMethods inherited from interface technology.sola.ecs.Component
afterDeserialize
-
Constructor Details
-
TriangleRendererComponent
Creates a "unit triangle" renderer with uniform side lengths of 1 that is filled.- Parameters:
color- theColorof the triangle
-
TriangleRendererComponent
Creates a "unit triangle" renderer with uniform side lengths of 1.- Parameters:
color- theColorof the triangleisFilled- whether the triangle should be filled or not
-
TriangleRendererComponent
Creates a TriangleRendererComponent of desired color that is filled.- Parameters:
color- theColorof 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- theColorof the triangleisFilled- whether the triangle should be filled or nottriangle- the shape of the triangle to be rendered
-
-
Method Details
-
getColor
- Returns:
- the
Colorof the triangle
-
isFilled
public boolean isFilled()- Returns:
- true if the triangle should be filled when rendered
-
setColor
Sets theColorfor 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
-