Class

Rect

:

group Math

pos

: Vec2

width

: number

height

: number
static

fromPoints

(p1: Vec2, p2: Vec2) => Rect

center

() => Vec2

points

() => [Vec2, Vec2, Vec2, Vec2]

transform

(m: Mat23, s?: Shape) => Polygon

bbox

() => Rect

area

() => number

clone

() => Rect

distToPoint

(p: Vec2) => number

sdistToPoint

(p: Vec2) => number

collides

(shape: ShapeType | Vec2) => boolean

contains

(point: Vec2) => boolean

raycast

(origin: Vec2, direction: Vec2) => RaycastResult

random

() => Vec2

serialize

() => any

support

(direction: Vec2) => Vec2
get

gjkCenter

(): Vec2
kaplay logo

Components