Legacy GM object mouse click area

K

khMohamad79

Guest
hi
i'm making a 2D RPG game like this


i want that when the house clicked do some code
and this is the house collision


the click event just check the Mask area but i want check whole image of house which contains the roof
also I don't want to change the mask because it is for that the character could go behind the house

THANKS
 
K

khMohamad79

Guest
You can use point_in_rectangle
Thank you it works
I replaced this:
mouse left pressed
with this:
Glob mouse left pressed + IF(point_in_rectangle(mouse_x, mouse_y, x-sprite_xoffset, y-sprite_yoffset, x-sprite_xoffset+sprite_width, y-sprite_yoffset+sprite_height)){}
 
Top