Mirage Source
http://web.miragesource.net/forums/

CurX and CurY are wrong
http://web.miragesource.net/forums/viewtopic.php?f=193&t=4613
Page 1 of 1

Author:  GIAKEN [ Thu Oct 23, 2008 8:36 pm ]
Post subject:  CurX and CurY are wrong

The mouse position isn't right...it's making you hover over that exact X and Y to work, and not the whole tile area...just open the map editor and watch the outline as you move the mouse. Also notice the X and Y with /loc when you go over your sprite and see that they aren't the same X and Y. Here's the fix:

Code:
CurX = Int(X / PIC_X)
CurY = Int(Y / PIC_Y)

Author:  shlink [ Mon Oct 27, 2008 10:09 am ]
Post subject:  Re: CurX and CurY are wrong

It works fine for me. Shows the same correct result with and without the Int(). But I went ahead and left it in there for fanciness. 8)

Author:  GIAKEN [ Tue Oct 28, 2008 3:11 pm ]
Post subject:  Re: CurX and CurY are wrong

You need to make it round or else it doesn't work right. That's why you do Int or CInt or whatever...trust me. Just try it yourself and you'll see that the mouse x,y acts weird.

Author:  Dragoons Master [ Tue Oct 28, 2008 3:48 pm ]
Post subject:  Re: CurX and CurY are wrong

GIAKEN wrote:
You need to make it round or else it doesn't work right. That's why you do Int or CInt or whatever...trust me. Just try it yourself and you'll see that the mouse x,y acts weird.

Giaken, the \ command is integer division.
Int(x/y) ==== x\y
http://msdn.microsoft.com/en-us/library/b6ex274z(VS.80).aspx

Author:  GIAKEN [ Tue Oct 28, 2008 3:54 pm ]
Post subject:  Re: CurX and CurY are wrong

I understand that...alright I think I get it now. I never use \ or Mod so... :D

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/