Hitbox
Description
The hitbox
command creates an invisible collision detection area. It can be used to check if specific coordinates (like the mouse position) intersect with the defined area. Hitboxes are positioned relative to the current draw cursor position.
Syntax
Parameters
width
: Width of the hitbox in pixelsheight
: Height of the hitbox in pixelscheckx
: X-coordinate to check for collisionchecky
: Y-coordinate to check for collision
Or:
"show"
: Shows all hitboxes (for debugging)"hide"
: Hides all hitboxes
Usage Examples
Important Notes
The
collided
variable is automatically set after each hitbox checkHitboxes are invisible by default
Multiple hitboxes can be active at once
The collision area is a rectangle
Coordinates are checked against the entire hitbox area
Hitbox position is relative to the current draw cursor
The "show" and "hide" commands affect all hitboxes globally
Last updated
Was this helpful?