Alphish / gm-community-toolbox

A collection of utility functions for GameMaker.
MIT License
36 stars 6 forks source link

draw_bounding_box #94

Open Kezarus-tech opened 4 days ago

Kezarus-tech commented 4 days ago

A no brainer function to draw the bounding box in a pinch.

// Function to draw the bounding box of a given object
function draw_bounding_box(objId) {
    with(objId){
        draw_set_alpha(1);
        draw_set_color(c_red); // Red color for the bounding box
        draw_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom, true);
    }
}
Alphish commented 4 days ago

Personally, I didn't need a function like that, but other people might find it handy! Might want to get some extra discussion on this one.

Some things to consider:

Other than that, would like to get input from other people on this one. ^^

Kezarus-tech commented 2 days ago

Had my fair share of collision issues on GM and this was a handier debug tool.

Loved the suggestions to use draw_set_color_alpha() and outline as an argument.

And this is 100% a debug tool when GM shenanigans hit the fan. ^_^'