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 Details

    • RectangleRendererComponent

      public RectangleRendererComponent(Color color)
      Creates a RectangleRendererComponent of desired color that is filled.
      Parameters:
      color - the Color of the rectangle
    • RectangleRendererComponent

      public RectangleRendererComponent(Color color, boolean isFilled)
      Creates a RectangleRendererComponent of desired color that is either filled or not filled.
      Parameters:
      color - the Color of the rectangle
      isFilled - whether the rectangle should be filled or not
  • Method Details

    • getColor

      public Color getColor()
      Returns:
      the Color of the rectangle
    • isFilled

      public boolean isFilled()
      Returns:
      true if the rectangle should be filled when rendered
    • setColor

      public void setColor(Color color)
      Sets the Color 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