Ever heard of instance_position? To check if the mouse is located over a instance:
if instance_position(mouse_x,mouse_y,all)=instance ...
Another code snippet:
//ds_grid_string(grid,spaces)
var grid,spaces,str,val;
grid=argument0
spaces=max(argument1,6)
str=""
for(yy=-1;yy<ds_grid_height(grid);yy+=1)
{
for(xx=-1;xx<ds_grid_width(grid);xx+=1)
{
if xx=-1&&yy=-1
val=spaces_right("|GRID",spaces-1)+"|"
else if xx=-1
val=spaces_right("|"+string(yy),spaces-1)+"|"
else if yy=-1
val=spaces_right("|"+string(xx),spaces-1)+"|"
else
{
val=ds_grid_get(grid,xx,yy)
if is_real(val)
val=string(val)
}
str+=spaces_right(val,spaces)
}
str+=nl
}
Edited by Yambam, 24 April 2013 - 01:33 PM.









