Class Rectangle

All Implemented Interfaces:
Mask

public class Rectangle extends Shape<Rectangle>

A Rectangle specifies an area in a the world enclosed by the Rectangle's upper-left point (x,y), its width, and its height.

The coordinates, width and height are in world units.
  • Method Details

    • setWidth

      public Rectangle setWidth(int width)
      Sets the width of this Rectangle in world units.

      Default is 100.

      Parameters:
      width - the width for this Rectangle.
      Returns:
      this Rectangle
    • setWidth

      public Rectangle setWidth(int width, Curve curve)
      Sets the width of this Rectangle in world units.

      Default is 100.

      Parameters:
      width - the width for this Rectangle.
      curve - the transition to animate between values of this property.
      Returns:
      this Rectangle
    • getWidth

      public int getWidth()
      Returns the width of this Rectangle in world units.

      Default is 100.

      Returns:
      the width of this Rectangle.
    • setHeight

      public Rectangle setHeight(int height)
      Sets the height of this Rectangle in world units.

      Default is 100.

      Parameters:
      height - the height for this Rectangle.
      Returns:
      this Rectangle
    • setHeight

      public Rectangle setHeight(int height, Curve curve)
      Sets the height of this Rectangle in world units.

      Default is 100.

      Parameters:
      height - the height for this Rectangle.
      curve - the transition to animate between values of this property.
      Returns:
      this Rectangle
    • getHeight

      public int getHeight()
      Returns the height of this Rectangle in world units.

      Default is 100.

      Returns:
      the height of this Rectangle.