![]() |
CurX and CurY are wrong - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +----- Thread: CurX and CurY are wrong (/showthread.php?tid=2287) |
CurX and CurY are wrong - GIAKEN - 23-10-2008 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) Re: CurX and CurY are wrong - shlink - 27-10-2008 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) Re: CurX and CurY are wrong - GIAKEN - 28-10-2008 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. Re: CurX and CurY are wrong - Dragoons Master - 28-10-2008 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 Re: CurX and CurY are wrong - GIAKEN - 28-10-2008 I understand that...alright I think I get it now. I never use \ or Mod so... ![]() |