Class Rectangle

java.lang.Object
com.raylib.Rectangle

public class Rectangle extends Object
Rectangle, 4 components
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct with auto memory allocator and fields initialized to zero.
    Rectangle(float x, float y, float width, float height)
    Construct with auto memory allocator and fields initialized as specified
    Rectangle(MemorySegment memorySegment)
    Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    Construct with your owm memory allocator and fields not initialized
    Rectangle(SegmentAllocator arena, float x, float y, float width, float height)
    Construct with your own memory allocator and fields initialized as specified
  • Method Summary

    Modifier and Type
    Method
    Description
    static Rectangle
    allocateArray(long elementCount)
    Allocate an array of Rectangle
    static Rectangle
    allocateArray(long elementCount, SegmentAllocator allocator)
    Allocate an array of Rectangle
    boolean
    Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
    getArrayElement(int index)
     
    float
    Rectangle height
    float
    Rectangle width
    float
    Rectangle top-left corner position x
    float
    Rectangle top-left corner position y
    int
     
    float
    Rectangle height
    height(float value)
    Rectangle height
    void
    setHeight(float value)
    Rectangle height
    void
    setWidth(float value)
    Rectangle width
    void
    setX(float value)
    Rectangle top-left corner position x
    void
    setY(float value)
    Rectangle top-left corner position y
    float
    Rectangle width
    width(float value)
    Rectangle width
    float
    x()
    Rectangle top-left corner position x
    x(float value)
    Rectangle top-left corner position x
    float
    y()
    Rectangle top-left corner position y
    y(float value)
    Rectangle top-left corner position y

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • memorySegment

      public final MemorySegment memorySegment
      The native FFI MemorySegment that holds the data this object wraps.
  • Constructor Details

    • Rectangle

      public Rectangle()
      Construct with auto memory allocator and fields initialized to zero.
    • Rectangle

      public Rectangle(SegmentAllocator arena)
      Construct with your owm memory allocator and fields not initialized
    • Rectangle

      public Rectangle(MemorySegment memorySegment)
      Construct by wrapping around an already allocated MemorySegment, perhaps from another object
    • Rectangle

      public Rectangle(float x, float y, float width, float height)
      Construct with auto memory allocator and fields initialized as specified
      Parameters:
      x - Rectangle top-left corner position x
      y - Rectangle top-left corner position y
      width - Rectangle width
      height - Rectangle height
    • Rectangle

      public Rectangle(SegmentAllocator arena, float x, float y, float width, float height)
      Construct with your own memory allocator and fields initialized as specified
      Parameters:
      x - Rectangle top-left corner position x
      y - Rectangle top-left corner position y
      width - Rectangle width
      height - Rectangle height
  • Method Details

    • equals

      public boolean equals(Object o)
      Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getArrayElement

      public Rectangle getArrayElement(int index)
    • allocateArray

      public static Rectangle allocateArray(long elementCount, SegmentAllocator allocator)
      Allocate an array of Rectangle
    • allocateArray

      public static Rectangle allocateArray(long elementCount)
      Allocate an array of Rectangle
    • getX

      public float getX()
      Rectangle top-left corner position x
    • setX

      public void setX(float value)
      Rectangle top-left corner position x
    • x

      public float x()
      Rectangle top-left corner position x
    • x

      public Rectangle x(float value)
      Rectangle top-left corner position x
    • getY

      public float getY()
      Rectangle top-left corner position y
    • setY

      public void setY(float value)
      Rectangle top-left corner position y
    • y

      public float y()
      Rectangle top-left corner position y
    • y

      public Rectangle y(float value)
      Rectangle top-left corner position y
    • getWidth

      public float getWidth()
      Rectangle width
    • setWidth

      public void setWidth(float value)
      Rectangle width
    • width

      public float width()
      Rectangle width
    • width

      public Rectangle width(float value)
      Rectangle width
    • getHeight

      public float getHeight()
      Rectangle height
    • setHeight

      public void setHeight(float value)
      Rectangle height
    • height

      public float height()
      Rectangle height
    • height

      public Rectangle height(float value)
      Rectangle height