Box2d
Public Class
Table of Contents
Signature
class Box2d {}
Constructor
Public Constructor
Constructs a new instance of the Box2d
class
Parameters
Name | Description |
---|---|
(optional) |
|
(optional) |
|
(optional) |
|
(optional) |
|
Properties
aspectRatio
Public Readonly Property
Signature
get aspectRatio(): number
center
Public Property
Signature
get center(): Vec2d
set center(v: Vec2d)
References
Collides
Public Static Property
Signature
static Collides: (A: Box2d, B: Box2d) => boolean
References
Common
Public Static Property
Signature
static Common: (boxes: Box2d[]) => Box2d
References
Contains
Public Static Property
Signature
static Contains: (A: Box2d, B: Box2d) => boolean
References
ContainsPoint
Public Static Property
Signature
static ContainsPoint: (A: Box2d, B: number | VecLike, y?: number) => boolean
References
corners
Public Readonly Property
Signature
get corners(): Vec2d[]
References
h
Public Property
Signature
h: number
height
Public Property
Signature
get height(): number
set height(n: number)
Includes
Public Static Property
Signature
static Includes: (A: Box2d, B: Box2d) => boolean
References
maxX
Public Readonly Property
Signature
get maxX(): number
maxY
Public Readonly Property
Signature
get maxY(): number
midX
Public Readonly Property
Signature
get midX(): number
midY
Public Readonly Property
Signature
get midY(): number
minX
Public Property
Signature
get minX(): number
set minX(n: number)
minY
Public Property
Signature
get minY(): number
set minY(n: number)
point
Public Property
Signature
get point(): Vec2d
set point(val: Vec2d)
References
sides
Public Readonly Property
Signature
get sides(): Array<[Vec2d, Vec2d]>
References
Sides
Public Static Property
Signature
static Sides: (A: Box2d, inset?: number) => Vec2d[][]
References
size
Public Readonly Property
Signature
get size(): Vec2d
References
snapPoints
Public Readonly Property
Signature
get snapPoints(): Vec2d[]
References
w
Public Property
Signature
w: number
width
Public Property
Signature
get width(): number
set width(n: number)
x
Public Property
Signature
x: number
y
Public Property
Signature
y: number
Methods
clone()
Public Method
Parameters
None
Returns
Box2d
References
collides()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
boolean
References
contains()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
boolean
References
containsPoint()
Public Method
Parameters
Name | Description |
---|---|
|
|
(optional) |
|
Returns
boolean
References
equals()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
boolean
References
Equals()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
boolean
References
expand()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
References
Expand()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Box2d
References
expandBy()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
ExpandBy()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
Returns
Box2d
References
From()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Box2d
References
FromPoints()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
Returns
Box2d
References
getHandlePoint()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
Vec2d
References
SelectionCorner, SelectionEdge, Vec2d
includes()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
boolean
References
resize()
Public Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
Returns
void
References
SelectionCorner, SelectionEdge
Resize()
Public Static Method
Parameters
Name | Description |
---|---|
|
|
|
|
|
|
|
|
(optional) |
|
Returns
{
box: Box2d
scaleX: number
scaleY: number
}
References
Box2d, SelectionCorner, SelectionEdge
scale()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
set()
Public Method
Parameters
Name | Description |
---|---|
(optional) |
|
(optional) |
|
(optional) |
|
(optional) |
|
Returns
this
setTo()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
References
snapToGrid()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
void
toFixed()
Public Method
Parameters
None
Returns
this
toJson()
Public Method
Parameters
None
Returns
Box2dModel
References
translate()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this
References
union()
Public Method
Parameters
Name | Description |
---|---|
|
|
Returns
this