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

Non-platform specific questions.

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

Postby Hblade » Fri Aug 21, 2009 7:29 am

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?
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

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

Postby skydereign » Fri Aug 21, 2009 8:09 am

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;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

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

Postby Hblade » Sat Aug 22, 2009 1:05 pm

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
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron