Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

[819] InputMouseX/Y

3 replies · 1,149 views · Started 14 September 2008

If you use these variables with ZC in a resolution larger than 320x240, the values aren't scaled up properly, so you have to sit the mouse right up in the top-left hand corner of the screen to get it to work how you'd expect.

ffc script CrossHair{
void run(){
this->X = 120;
int ReturnSpeed = 10;
while(true){
while(Pause) Waitframe();
if(Link->InputMouseX > 0 && Link->InputMouseX < 240 && Link->InputMouseY > 0 && Link->InputMouseY < 152){
this->X = Link->InputMouseX;
this->Y = Link->InputMouseY;
Return = true;
}else{
if(Return){
this->Vx = (120-this->X)/ReturnSpeed;
this->Vy = -this->Y/ReturnSpeed;
Return = false;
}
if(Abs(this->X-120) < 4 && Abs(this->Y) < 4){
this->Vx = 0;
this->Vy = 0;
}
}
Waitframe();
}
}
}

That's the script I was using.

Although it's not the script that's the problem, because it works fine in 1x1 mode.