Page 1 of 1

How would I make an actor follow the mouse 32x32 grid style

PostPosted: Fri Aug 21, 2009 7:29 am
by Hblade
I was wondering how I can make the actor follow the mouse in a 32 x 32 grid style, so that I can make my tile editor. Anyone have any ideas?

Re: How would I make an actor follow the mouse 32x32 grid style

PostPosted: Fri Aug 21, 2009 8:09 am
by skydereign
This should be what you want, as you can add mouse button down to drag, and let go. I have used this for tiles, ship pieces, and unit placement, and it works. For somethings, if they are bigger than the 32x32, than you will need to offset it, but if it is just for tiles, you shouldn't have this problem.
Tile -> DrawActor -> Script Editor
Code: Select all
x=round(x/32)*32;
y=round(y/32)*32;

Re: How would I make an actor follow the mouse 32x32 grid style

PostPosted: Sat Aug 22, 2009 1:05 pm
by Hblade
Hey I tried using round(xmouse/32)*32 and it kinda words exept for 1 thing O.o it dosnt have the mouses position but it still moves 32 x 32 style :O