Create a Box.
Name | Type | Description |
---|---|---|
viewer |
Viewer |
The viewer this box will be associated with. |
options |
Object |
Attributes used to create the box. |
Members
-
anchorString Object
-
Get or set the anchor.
-
bottomNumber
-
Get bottom of the Box
-
bottomPaddedNumber
-
Get bottom of the Box minus padding
-
centerXNumber
-
Get the center x of the box.
-
centerYNumber
-
Get the center y of the box.
-
heightNumber
-
Get or set the height.
-
leftNumber
-
Get left of the Box. Same as X.
-
leftPaddedNumber
-
Get left of the Box plus padding.
-
on
-
Alias for Position on. Values: 'map', 'campus'.
-
paddedXNumber
-
Get the x position of the origin plus padding.
-
paddedYNumber
-
Get the y position of the origin plus padding.
-
paddingNumber
-
Get or set the padding. This will be added to x and y when accessed via paddedX and paddedY.
-
positionString
-
Get or set the postion. String values include: "top-left", "top-center", "top-right", "middle-left", "middle-center", "middle-right", "bottom-left", "bottom-center", or "bottom-right".
-
rightNumber
-
Get right of the Box.
-
rightPaddedNumber
-
Get right of the Box minus padding.
-
topNumber
-
Get top of the Box. Same as Y.
-
topPaddedNumber
-
Get top of the Box plus padding.
-
widthNumber
-
Get or set the width.
-
xNumber
-
Get the x position of the origin.
-
yNumber
-
Get the y position of the origin.
Methods
-
Clear the rect area described by this box using the provided context.
Name Type Description ctx
Context Context used to clear the rect.
-
Check if the Box conains the point
Name Type Description x
Number X coordinate of the point
y
Number Y coordinate of the point
Returns:
Type Description Boolean -
Return the class name as a string.
Returns:
Type Description String - 'Box'