Cluster Creator Kit Script Reference
    Preparing search index...

    Class Rect

    A class representing a rectangle.

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates an instance with all properties initialized to 0.

      Returns Rect

    • Creates an instance with the specified values.

      Parameters

      • x: number

        The minimum X coordinate of the rectangle

      • y: number

        The minimum Y coordinate of the rectangle

      • width: number

        The width of the rectangle

      • height: number

        The height of the rectangle

      Returns Rect

    Properties

    height: number

    The difference between the maximum and minimum Y coordinates of the rectangle. When this value is set, the value of yMax is also updated to maintain yMin.

    width: number

    The difference between the maximum and minimum X coordinates of the rectangle. When this value is set, the value of xMax is also updated to maintain xMin.

    x: number

    The minimum X coordinate of the rectangle. This has the same value as xMin. When this value is set, the value of xMax is also updated to maintain width.

    xMax: number

    The maximum X coordinate of the rectangle. When this value is set, the value of width is also updated to maintain xMin.

    xMin: number

    The minimum X coordinate of the rectangle. This has the same value as x. When this value is set, the value of width is also updated to maintain xMax.

    y: number

    The minimum Y coordinate of the rectangle. This has the same value as yMin. When this value is set, the value of yMax is also updated to maintain height.

    yMax: number

    The maximum Y coordinate of the rectangle. When this value is set, the value of height is also updated to maintain yMin.

    yMin: number

    The minimum Y coordinate of the rectangle. This has the same value as y. When this value is set, the value of height is also updated to maintain yMax.

    Methods

    • Clones the instance.

      Returns Rect

    • Compares the rectangle to v, and returns true if they are equal.

      Parameters

      Returns boolean

    • Sets the rectangle's x, y, width, height values.

      Parameters

      • x: number

        The minimum X coordinate of the rectangle

      • y: number

        The minimum Y coordinate of the rectangle

      • width: number

        The width of the rectangle

      • height: number

        The height of the rectangle

      Returns this