Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CurX and CurY are wrong
#1
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)
Reply
#2
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)
Reply
#3
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.
Reply
#4
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/...S.80).aspx
Reply
#5
I understand that...alright I think I get it now. I never use \ or Mod so... Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)