Table of contents
class Box {}
Constructor
Constructs a new instance of the Box
class
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
|
|
Properties
aspectRatio
readonly
get aspectRatio(): number
center
corners
readonly
get corners(): Vec[]
cornersAndCenter
readonly
get cornersAndCenter(): Vec[]
h
h: number
height
get height(): number
set height(n: 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
sides
readonly
size
readonly
get size(): Vec
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
Contains()
static
Parameters
Returns
boolean
ContainsPoint()
static
Parameters
Returns
boolean
Equals()
static
Parameters
Returns
boolean
Expand()
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
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
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
includes()
includes(B: Box): boolean
Parameters
Name | Description |
---|---|
|
Returns
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