I need a little help with my grid.
Like normal I use:
x = (mouse_x div 32) * 32
y = (mouse_y div 32) * 32
to snap the object to the grid but the problem is that my grid moves.
Here is an example of my problem link.
simple grid snap problem
Started by joshuaallen64, May 21 2012 11:25 PM
4 replies to this topic
#1
Posted 21 May 2012 - 11:25 PM
#2
Posted 22 May 2012 - 12:35 AM
I didn't have an issue with it... however
Maybe make two objects. 'object black box' and 'object draw grid'... I hope that helps.
Maybe make two objects. 'object black box' and 'object draw grid'... I hope that helps.
Edited by ParrotPeach, 22 May 2012 - 12:36 AM.
#3
Posted 22 May 2012 - 12:42 AM
I didn't have an issue with it... however
Maybe make two objects. 'object black box' and 'object draw grid'... I hope that helps.
I'm sorry I should have told you that you need to use wasd to move the grid.
Edited by joshuaallen64, 22 May 2012 - 12:42 AM.
#4
Posted 22 May 2012 - 12:42 AM
This will do the trick:
xDiffMod = xDiff mod 32 yDiffMod = yDiff mod 32 x = ( (mouse_x - xDiffMod) div 32 ) * 32 + xDiffMod y = ( (mouse_y - yDiffMod) div 32 ) * 32 + yDiffMod
#5
Posted 22 May 2012 - 12:44 AM
This will do the trick:
xDiffMod = xDiff mod 32 yDiffMod = yDiff mod 32 x = ( (mouse_x - xDiffMod) div 32 ) * 32 + xDiffMod y = ( (mouse_y - yDiffMod) div 32 ) * 32 + yDiffMod
thanks, that's just what I needed.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











