Community

AGI Programming => Mega Tokyo AGI Archive => Topic started by: Allen on May 13, 2003, 10:52:58 AM

Title: AGI Mouse
Post by: Allen on May 13, 2003, 10:52:58 AM
How do I check if the user has clicked on a certain point of the screen? eg, if they click on a lamp, it falls on someone.
Title: Re:AGI Mouse
Post by: robingravel on May 13, 2003, 11:03:49 AM
if (v27 != 0) {
 if (v28 > 119 &&
     v29 > 124 &&
     v28 < 132 &&
     v29 < 160) {
   write your codes here............
 }
}

Robin Gravel
Title: Re:AGI Mouse
Post by: Allen on May 13, 2003, 11:07:46 AM
Cool, Thanks Robin! :)
Title: Re:AGI Mouse
Post by: Allen on May 13, 2003, 11:23:19 AM
Uhh... could someone explain how these codes work? ;)
Title: Re:AGI Mouse
Post by: Brian Provinciano on May 13, 2003, 11:36:42 AM
Look at the files included with the AGI Mouse demos for examples on how to use it. It fully explains everything. Those number are coords. The "v28" and such should be "mouse_x" and "mouse_y" etc. See my files/demo in the zip file.
Title: Re:AGI Mouse
Post by: Allen on May 13, 2003, 11:45:29 AM
Is it possible to have an effect when you click on a moving object?
Title: Re:AGI Mouse
Post by: Zero on May 13, 2003, 02:22:31 PM
Yep i think so!!!
i almost did something like that with the mouse support
Title: Re:AGI Mouse
Post by: Allen on May 13, 2003, 02:42:24 PM
Would the code be...

Code: [Select]
if(mouse_left == 1){
if (mouse_x == ?? && mouse_y == ?? && posn(o1) == ??){
print("Hey guies! Yoo stoped me woking!");
}
}