#calculate bbox hover, taking a vertex shader into consideration

1 messages · Page 1 of 1 (latest)

fair atlas
#

this video shows me hovering over an object, with the cursor changing.

hovered = (
    mouse_x > x+sprite_get_bbox_left(sprite_index) &&
    mouse_x < x+sprite_get_bbox_right(sprite_index) &&
    mouse_y > y+sprite_get_bbox_top(sprite_index) &&
    mouse_y < y+sprite_get_bbox_bottom(sprite_index)
)

window_set_cursor(hovered ? cr_handpoint : cr_default);

as you can see the function works fine... except for the fact there's a vertex shader applied to the screen that curves the top/bottom for a fake perspective illusion. is there possibly a way to take the distortion into consideration and check if the mouse is within the bbox, accounting for the curve?

hollow comet
#

couple ways to do this, and both involve the concept of coordinate transformations

#

is this something you're broadly familiar with?