Class RectangleMesh

All Implemented Interfaces:
Behavior, Renderable, Closeable, AutoCloseable
Direct Known Subclasses:
TexturedRectangleMesh

public class RectangleMesh extends AbstractRenderable
RectangleMesh class extends AbstractRenderable and represents a rectangle mesh object. It is used to render a rectangle with specified color and size.
  • Constructor Details

    • RectangleMesh

      public RectangleMesh()
      Constructs a new RectangleMesh.
  • Method Details

    • render

      public void render(Renderer renderer)
      Description copied from class: ComponentBehavior
      Renders the behavior.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class AbstractRenderable
      Parameters:
      renderer - The renderer.
    • color

      public Color color()
      Gets the color of the rectangle mesh.
      Returns:
      The color of the rectangle mesh.
    • setColor

      public RectangleMesh setColor(Color color)
      Sets the color of the rectangle mesh.
      Parameters:
      color - The new color for the rectangle mesh.
      Returns:
      This RectangleMesh instance for method chaining.
    • size

      public Vector2D size()
      Gets the size of the rectangle mesh.
      Returns:
      The size of the rectangle mesh.
    • setSize

      public RectangleMesh setSize(Vector2D size)
      Sets the size of the rectangle mesh.
      Parameters:
      size - The new size for the rectangle mesh.
      Returns:
      This RectangleMesh instance for method chaining.