Companion

object Companion

Functions

Link copied to clipboard
fun circular(x: Float, y: Float, radius: Float): Hitbox2D

Creates a circular hitbox given its center and radius.

Link copied to clipboard

Creates an empty hitbox that contains no points.

Link copied to clipboard
fun full(): Hitbox2D

Creates a full hitbox that contains all points.

Link copied to clipboard
fun rectangle(x: Float, y: Float, width: Float, height: Float): Hitbox2D

Creates a rectangular hitbox given its position and size.

fun rectangle(x: Int, y: Int, width: Int, height: Int): Hitbox2D

Creates a rectangular hitbox given its position and size using integer parameters.

Link copied to clipboard
fun rotatedRectangle(x: Float, y: Float, width: Float, height: Float, degrees: Float, centerX: Float = x + (width / 2f), centerY: Float = y + (height / 2f)): Hitbox2D

Creates a rotated rectangular hitbox given its position, size, and rotation angle.

Link copied to clipboard
fun triangular(x1: Float, y1: Float, x2: Float, y2: Float, x3: Float, y3: Float): Hitbox2D

Creates a triangular hitbox given its three vertices.