Table of contents
class Box {}Constructor
Constructs a new instance of the Box class
Parameters
| Name | Description |
|---|---|
| |
| |
| |
| |
Properties
aspectRatio
readonly
get aspectRatio(): numberbottom
readonly
get bottom(): numbercenter
corners
readonly
get corners(): Vec[]cornersAndCenter
readonly
get cornersAndCenter(): Vec[]h
h: numberheight
get height(): number
set height(n: number)left
readonly
get left(): numbermaxX
readonly
get maxX(): numbermaxY
readonly
get maxY(): numbermidX
readonly
get midX(): numbermidY
readonly
get midY(): numberminX
get minX(): number
set minX(n: number)minY
get minY(): number
set minY(n: number)point
right
readonly
get right(): numbersides
readonly
size
readonly
get size(): Vectop
readonly
get top(): numberw
w: numberwidth
get width(): number
set width(n: number)x
x: numbery
y: numberMethods
Collides( )
static
Parameters
Returns
booleanCommon( )
static
Parameters
| Name | Description |
|---|---|
| |
Returns
Contains( )
static
Parameters
Returns
booleanContainsApproximately( )
static
Parameters
Returns
booleanContainsPoint( )
static
Parameters
Returns
booleanEquals( )
static
Parameters
Returns
booleanExpand( )
static
Parameters
Returns
ExpandBy( )
static
Parameters
| Name | Description |
|---|---|
| |
| |
Returns
From( )
static
Parameters
| Name | Description |
|---|---|
|
Returns
FromCenter( )
static
Parameters
Returns
FromPoints( )
static
Parameters
| Name | Description |
|---|---|
| |
Returns
Includes( )
static
Parameters
Returns
booleanResize( )
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
clone( )
clone(): Boxcollides( )
collides(B: Box): booleanParameters
| Name | Description |
|---|---|
|
Returns
booleancontains( )
contains(B: Box): booleanParameters
| Name | Description |
|---|---|
|
Returns
booleancontainsPoint( )
containsPoint(V: VecLike, margin?: number): booleanParameters
| Name | Description |
|---|---|
| |
| |
Returns
booleanequals( )
Parameters
Returns
booleanexpand( )
expand(A: Box): thisParameters
| Name | Description |
|---|---|
|
Returns
thisexpandBy( )
expandBy(n: number): thisParameters
| Name | Description |
|---|---|
| |
Returns
thisgetHandlePoint( )
getHandlePoint(handle: SelectionCorner | SelectionEdge): VecParameters
| Name | Description |
|---|---|
|
Returns
includes( )
includes(B: Box): booleanParameters
| Name | Description |
|---|---|
|
Returns
booleanresize( )
resize(
handle: SelectionCorner | SelectionEdge | string,
dx: number,
dy: number
): voidParameters
| Name | Description |
|---|---|
| |
| |
| |
Returns
voidscale( )
scale(n: number): thisParameters
| Name | Description |
|---|---|
| |
Returns
thisset( )
set(x?: number, y?: number, w?: number, h?: number): thisParameters
| Name | Description |
|---|---|
| |
| |
| |
| |
Returns
thissetTo( )
setTo(B: Box): thisParameters
| Name | Description |
|---|---|
|
Returns
thissnapToGrid( )
snapToGrid(size: number): voidParameters
| Name | Description |
|---|---|
| |
Returns
voidtoFixed( )
toFixed(): thistoJson( )
toJson(): BoxModeltranslate( )
translate(delta: VecLike): thisParameters
| Name | Description |
|---|---|
|
Returns
thisunion( )
union(box: BoxModel): thisParameters
| Name | Description |
|---|---|
|
Returns
thiszeroFix( )
zeroFix(): thisPrev
BoundsSnapsNext
Circle2d