Interface Rectangle

All Known Implementing Classes:
Rectangle.Dynamic, Rectangle.Immutable, Rectangle.Mutable

public interface Rectangle
Created by brandon3055 on 14/08/2023
  • Method Details

    • pos

      Position pos()
    • x

      default double x()
    • y

      default double y()
    • width

      double width()
    • height

      double height()
    • xMax

      default double xMax()
    • yMax

      default double yMax()
    • offsetPos

      default Rectangle offsetPos(double xAmount, double yAmount)
      Returns a new rectangle with this operation applied
    • setPos

      default Rectangle setPos(double newX, double newY)
      Returns a new rectangle with this operation applied
    • setSize

      default Rectangle setSize(double width, double height)
      Returns a new rectangle with this operation applied
    • offsetSize

      default Rectangle offsetSize(double xAmount, double yAmount)
      Returns a new rectangle with this operation applied
    • toRect2i

      default net.minecraft.client.renderer.Rect2i toRect2i()
    • intersects

      default boolean intersects(double x, double y, double w, double h)
    • intersects

      default boolean intersects(Rectangle other)
    • intersect

      default Rectangle intersect(Rectangle other)
      Returns a new rectangle that represents the intersection area between the two inputs
    • combine

      default Rectangle combine(Rectangle... combineWith)
      Returns a new rectangle, the bounds of which enclose all the input rectangles.
      Parameters:
      combineWith - Rectangles to combine with the start rectangle
    • contains

      default boolean contains(double x, double y)
    • size

      default double size(Axis axis)
      Returns:
      the size of this rectangle on the given axis.
    • min

      default double min(Axis axis)
      Returns:
      the min value the specified axis (meaning x() or y())
    • max

      default double max(Axis axis)
      Returns:
      the max value the specified axis (meaning x() + width() or y() + height())
    • distance

      default double distance(Axis axis, Position position)
      Return the distance the given position is from this rectangle on the specified axis. Will return 0 if position is inside this rectangle on the given axis.
    • create

      static Rectangle create(Position position, double width, double height)
    • create

      static Rectangle create(double x, double y, double width, double height)
    • create

      static Rectangle create(GuiParent<?> parent)
      Returns a new rectangle bound to the specified parent's geometry.
    • create

      static Rectangle create(Position position, Supplier<Double> getWidth, Supplier<Double> getHeight)
    • mutable

      default Rectangle.Mutable mutable()