Table of contents
- aspectRatio
- bottom
- center
- corners
- cornersAndCenter
- h
- height
- left
- maxX
- maxY
- midX
- midY
- minX
- minY
- point
- right
- sides
- size
- top
- w
- width
- x
- y
- Properties
- Methods
- Collides
- Common
- Contains
- ContainsApproximately
- ContainsPoint
- Equals
- Expand
- ExpandBy
- From
- FromCenter
- FromPoints
- Includes
- Resize
- Sides
- ZeroFix
- clone
- collides
- contains
- containsPoint
- equals
- expand
- expandBy
- getHandlePoint
- includes
- isValid
- resize
- scale
- set
- setTo
- snapToGrid
- toFixed
- toJson
- translate
- union
- zeroFix
class Box {}Constructor
Constructs a new instance of the Box class
Parameters
| Name | Description |
|---|---|
| |
| |
| |
| |
Properties
aspectRatio
readonly
get aspectRatio(): number;bottom
readonly
get bottom(): number;center
corners
readonly
get corners(): Vec[];cornersAndCenter
readonly
get cornersAndCenter(): Vec[];h
h: number;height
get height(): number;
set height(n: number);left
readonly
get left(): number;maxX
readonly
get maxX(): number;maxY
readonly
get maxY(): number;midX
readonly
get midX(): number;midY
readonly
get midY(): number;minX
get minX(): number;
set minX(n: number);minY
get minY(): number;
set minY(n: number);point
right
readonly
get right(): number;sides
readonly
size
readonly
get size(): Vec;top
readonly
get top(): number;w
w: number;width
get width(): number;
set width(n: number);x
x: number;y
y: number;Methods
Collides( )
static
Parameters
Returns
boolean;Common( )
static
Parameters
| Name | Description |
|---|---|
| |
Returns
Box;Contains( )
static
Parameters
Returns
boolean;ContainsApproximately( )
static
Parameters
Returns
boolean;ContainsPoint( )
static
Parameters
Returns
boolean;Equals( )
static
Parameters
Returns
boolean;Expand( )
static
Parameters
Returns
Box;ExpandBy( )
static
Parameters
| Name | Description |
|---|---|
| |
| |
Returns
Box;From( )
static
Parameters
| Name | Description |
|---|---|
|
Returns
Box;FromCenter( )
static
Parameters
Returns
Box;FromPoints( )
static
Parameters
| Name | Description |
|---|---|
| |
Returns
Box;Includes( )
static
Parameters
Returns
boolean;Resize( )
static
static Resize(
box: Box,
handle: SelectionCorner | SelectionEdge | string,
dx: number,
dy: number,
isAspectRatioLocked?: boolean,
): {
box: Box;
scaleX: number;
scaleY: number;
};Parameters
| Name | Description |
|---|---|
| |
| |
| |
| |
| |
Returns
{
box: Box;
scaleX: number;
scaleY: number;
};Sides( )
static
Parameters
| Name | Description |
|---|---|
| |
| |
Returns
Vec[][];ZeroFix( )
static
Parameters
Returns
Box;clone( )
clone(): Box;collides( )
collides(B: Box): boolean;Parameters
| Name | Description |
|---|---|
| |
Returns
boolean;contains( )
contains(B: Box): boolean;Parameters
| Name | Description |
|---|---|
| |
Returns
boolean;containsPoint( )
containsPoint(V: VecLike, margin?: number): boolean;Parameters
| Name | Description |
|---|---|
| |
| |
Returns
boolean;equals( )
Parameters
Returns
boolean;expand( )
expand(A: Box): this;Parameters
| Name | Description |
|---|---|
| |
Returns
this;expandBy( )
expandBy(n: number): this;Parameters
| Name | Description |
|---|---|
| |
Returns
this;getHandlePoint( )
getHandlePoint(handle: SelectionCorner | SelectionEdge): Vec;Parameters
| Name | Description |
|---|---|
|
Returns
Vec;includes( )
includes(B: Box): boolean;Parameters
| Name | Description |
|---|---|
| |
Returns
boolean;isValid( )
isValid(): boolean;resize( )
resize(
handle: SelectionCorner | SelectionEdge | string,
dx: number,
dy: number,
): void;Parameters
| Name | Description |
|---|---|
| |
| |
| |
Returns
void;scale( )
scale(n: number): this;Parameters
| Name | Description |
|---|---|
| |
Returns
this;set( )
set(x?: number, y?: number, w?: number, h?: number): this;Parameters
| Name | Description |
|---|---|
| |
| |
| |
| |
Returns
this;setTo( )
setTo(B: Box): this;Parameters
| Name | Description |
|---|---|
| |
Returns
this;snapToGrid( )
snapToGrid(size: number): void;Parameters
| Name | Description |
|---|---|
| |
Returns
void;toFixed( )
toFixed(): this;toJson( )
toJson(): BoxModel;translate( )
translate(delta: VecLike): this;Parameters
| Name | Description |
|---|---|
|
Returns
this;union( )
union(box: BoxModel): this;Parameters
| Name | Description |
|---|---|
|
Returns
this;zeroFix( )
zeroFix(): this;Prev
BoundsSnapsNext
Circle2d