Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Mouse click... procedure run
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
pr0xiler




PostPosted: Thu May 26, 2005 8:08 am   Post subject: Mouse click... procedure run

I need help...

I want to run a procedure when you click a certain area with the mouse within a box or oval.

Thanks.
Sponsor
Sponsor
Sponsor
sponsor
jamonathin




PostPosted: Thu May 26, 2005 9:44 am   Post subject: (No subject)

Just use whatdotcolor, and make sure you're checking for the same color that's in the circle. You can do coordiantes as well, but whatdotcolor is faster, and efficient, IF there aren't many colors.
code:

var x, y, z :int

procedure thing
   put "i have gas"
end thing

drawfilloval (100,100,60,60,12)

loop
  mousewhere(x,y,z)
  if z = 1 and whatdotcolor(x,y)=12 then
    thing
    exit
  end if
end loop
pr0xiler




PostPosted: Fri May 27, 2005 8:12 am   Post subject: (No subject)

Thanks... but how would I do it within coordinates, because I have over 20 red circles in my program and they all need to run different procedures.
Tony




PostPosted: Fri May 27, 2005 9:06 am   Post subject: (No subject)

if the distance between mouse click and center of the circle is equal to or is less than the radius of the said circle, it was clicked. Run a forloop to check all the circles.
pr0xiler




PostPosted: Tue May 31, 2005 8:53 am   Post subject: (No subject)

can i please have an example in code... im clueless Shocked Wink
StarGateSG-1




PostPosted: Tue May 31, 2005 9:28 am   Post subject: (No subject)

Why don't you just change the color of the circles, that would be the best way then you can use whatdotcolor.
pr0xiler




PostPosted: Thu Jun 02, 2005 10:40 am   Post subject: (No subject)

StarGateSG-1 wrote:
Why don't you just change the color of the circles, that would be the best way then you can use whatdotcolor.


I have like 50 different dots, and it would look like crap all different colors.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: