• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

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