Constructor


Hitbox(parent: Object, x: number, y: number, width: number?, height: number?, mode: any)

Arguments:

parent: Object

The base class of all objects in Kristal.
When added to the stage, an object will be updated and rendered.

x: number
y: number
width: number?
height: number?
mode: any




Methods


Hitbox:collidesWith(other: any)

Arguments:

other: any

Returns:

1: boolean|unknown


Hitbox:draw(r: any, g: any, b: any, a: any)

Arguments:

r: any
g: any
b: any
a: any


Hitbox:drawFill(r: any, g: any, b: any, a: any)

Arguments:

r: any
g: any
b: any
a: any


Hitbox:getShapeFor(other: Collider)

Gets this collider's shape as a rectangle or polygon (depending on transformation) for the given other collider.

Arguments:

other: Collider

The other collider to get the shape for.

Returns:

aabb: boolean

true if the shape is a rectangle, false if it is a polygon.

shape: [number, number, number, number]|number[][]

The shape of the collider as a list of points or vertices.




Undocumented