Please help me with this example.
Posted:
Sat Jul 03, 2010 3:42 pm
by NevenResnik
Hey. This is an example of how I want my "Snap To Grid" to work. The Circle must snap to the Square when the mouse hovers above it. I don't know how to make that work Can you please help me?
Would be much appreciated.
Re: Please help me with this example.
Posted:
Sat Jul 03, 2010 3:50 pm
by Hblade
On the circle actor, put this code in create actor
- Code: Select all
FollowMouse("Event Actor", BOTH_AXIS);
Now, in draw_actor, put this code in:
- Code: Select all
x=round(x/32)*32;
y=round(y/32)*32;
There ya go
Re: Please help me with this example.
Posted:
Sat Jul 03, 2010 4:22 pm
by Camper1995
How its working that: blah blah blah ... x/32)* 32;
I dont understand it. When I change the numbers, its not snapping so good. :-5
Re: Please help me with this example.
Posted:
Sat Jul 03, 2010 4:44 pm
by Hblade
They have to be equal. For example: /16)*16
Re: Please help me with this example.
Posted:
Mon Jul 05, 2010 7:03 pm
by Game A Gogo
Here's what you asked me to do
I uploaded only the GED since I used nothing more than what was already in the original data file