PDA

View Full Version : InputMouse



Joe123
09-02-2008, 01:09 PM
Can someone give me a hand using these?
I'm having a few problems, they don't seem very responsive.

if(Abs(Link->InputMouseX-128) <= 128 && Abs(Link->InputMouseY-88) <= 88){
Crosshair->X = Link->InputMouseX;
Crosshair->Y = Link->InputMouseY;
}
Is pretty much all I have, inside a while(true) loop with a waitframe();.
It doesn't seem to follow very well at all though =S

Elmensajero
09-02-2008, 08:10 PM
That script above doesn't seem to cause too much trouble for me (unless the mouse goes out of the boundaries, then the ffc jumps over to the new mouse position when it comes back and it looks kinda odd). Here is one script that works in both b819 and b860, which is a slightly modified version of one of HeroOfFire's scripts. Putting the ffc at -16,-16 worked best for me.


ffc script cursor
{
void run()
{
while (true)
{
if (Link->InputMouseY < 0)
{
this->Y = 0;
}
else if (Link->InputMouseY > 160)
{
this->Y = 160;
}
else
{
this->Y = Link->InputMouseY;
}
if (Link->InputMouseX < 0)
{
this->X = 0;
}
else if (Link->InputMouseX > 240)
{
this->X = 240;
}
else
{
this->X = Link->InputMouseX;
}
Waitframe();
}
}
}

Joe123
09-03-2008, 08:56 AM
Ah, I think it must be to do with my computer then.
It seems that the system detects the mouse as lower and further to the right than where it actually is - so if I put the mouse up in the top left of the box then it works.

I have a code to send the cursor back to the middle at the top of the screen when the mouse leaves the screen, but thanks anyway.