Hi,
I have a sim_movable_agent which I add to a window using
rc_add_containers. This means it's possible to move the agent with the
mouse. The problem is I have a grid layout and I want the agent to
'snap' to the grid when it is moved by the mouse. I know how to do this,
that is to check the sim_x and sim_y coordinates of the
sim_movable_agent and round the each of them to the nearest integer.
The problem is I'm not sure where to do it? I've looked through the
libraries for the procedure which moves the sim_movable_agent (with the
mouse) but can't find it? I assume when you move the sim_movable_agent
with the mouse some procedure is called which sets its new sim_x and
sim_y according to the current mouse location? Can someone tell me where
this is done?
Thanks
Mike
|