User Tools

Site Tools


Rect

DAZScript wrapper for QRect.

More...

Inherits :

Properties

Constructors

DAZ Script
Rect ()
Rect ( Rect rect )
Rect ( Number xVal, Number yVal, Number wVal, Number hVal )

Methods

DAZ Script
Booleancontains ( Rect rect )
Rectintersection ( Rect rect )
Booleanintersects ( Rect rect )
BooleanisEmpty ()
BooleanisNull ()
voidmoveBottom ( Number pos )
voidmoveBy ( Number dx, Number dy )
voidmoveLeft ( Number pos )
voidmoveRight ( Number pos )
voidmoveTop ( Number pos )
voidnormalize ()
voidnormalize ()
Rectunion ( Rect rect )

Detailed Description

This is the DAZScript counterpart to the QRect type used in the DAZ Studio SDK. A Rect object is a two dimensional representation of a rectangle.

Attention:

  • Inheritance will change to Object in a pending update.

Properties


Number : bottom

Holds the rectangle's bottom.


Point : center

Holds the rectangle's center.


Number : height

Holds the rectangle's height.


Number : left

Holds the rectangle's left.


Number : right

Holds the rectangle's right.


Number : top

Holds the rectangle's top.


Number : width

Holds the rectangle's width.


Number : x

Holds the rectangle's x position.


Number : y

Holds the rectangle's y position.

Constructors


Rect()

Default Constructor.


Rect( Rect rect )

Parameter(s):

  • rect - The rectangle to copy.

Rect( Number xVal, Number yVal, Number wVal, Number hVal )

Parameter(s):

  • xVal - The x coordinate of the rectangle.
  • yVal - The y coordinate of the rectangle.
  • wVal - The width of the rectangle.
  • hVal - The height of the rectangle.

Methods


Boolean : contains( Rect rect )

Parameter(s):

  • rect - The rectangle to test against this rectangle.

Return Value:

  • true if this rectangle contains the given rectangle, otherwise false.

Rect : intersection( Rect rect )

Parameter(s):

  • rect - The rectangle to intersect with this rectangle.

Return Value:

  • The intersection of this rectangle with the given rectangle, or an empty rectangle if the two do not intersect.

Boolean : intersects( Rect rect )

Parameter(s):

  • rect - The rectangle to test against this rectangle.

Return Value:

  • true if this rectangle intersects with the given rectangle, otherwise false.

Boolean : isEmpty()

Return Value:

  • true if the rectangle is empty, i.e the width and height of the rectangle are negative, otherwise false.

Boolean : isNull()

Return Value:

  • true if the width and height of the rectangle are 0, otherwise false.

void : moveBottom( Number pos )

Moves the rectangle so its bottom property is equal to pos.

Parameter(s):

  • pos - The new bottom boundary of the triangle.

void : moveBy( Number dx, Number dy )

Translates the rectangle by dx and dy, the width and height remain unchanged.

Parameter(s):

  • dx - The distance in x to move the rectangle.
  • dy - The distance in y to move the rectangle.

void : moveLeft( Number pos )

Moves the rectangle so its left property is equal to pos.

Parameter(s):

  • pos - The new left boundary of the triangle.

void : moveRight( Number pos )

Moves the rectangle so its right property is equal to pos.

Parameter(s):

  • pos - The new right boundary of the triangle.

void : moveTop( Number pos )

Moves the rectangle so its top property is equal to pos.

Parameter(s):

  • pos - The new top boundary of the triangle.

void : normalize()

Normalizes the rectangle - changes the prefix of width/height if they are negative. The rectangle will no longer be empty after it is normalized.


void : normalize()

Normalizes the rectangle - changes the prefix of width/height if they are negative. The rectangle will no longer be empty after it is normalized.


Rect : union( Rect rect )

Parameter(s):

  • rect - The rectangle to add to this rectangle.

Return Value:

  • The union of this rectangle with the given rectangle, i.e. a rectangle that contains both rectangles.