face
Member
I have this code:
It's supposed to make an object appear when I hover the mouse inside an area. I don't know if it's the syntax but it's not working.
In the GML Documentation the point in retangle example has, in the rectangle coordinates, x - a, y - b, x + c, etc. where a, b and c are numbers:
I've tried the above but it still doesn't work. I know I'm missing something but can't figure out what it is. Any help is appreciated. ^^
GML:
var a = point_in_rectangle(mouse_x, mouse_y, 215, 660, 360, 700);
var layerID = layer_get_id("instances");
if (a == true) {
instance_create_layer(600, 700, layerID, obj_starttext);
}
In the GML Documentation the point in retangle example has, in the rectangle coordinates, x - a, y - b, x + c, etc. where a, b and c are numbers:
point_in_rectangle(mouse_x, mouse_y, x+215, y+660, x+360, y+700);
I've tried the above but it still doesn't work. I know I'm missing something but can't figure out what it is. Any help is appreciated. ^^