Computer Science Canada MouseWhere |
Author: | mtk786 [ Wed Mar 03, 2004 6:46 pm ] |
Post subject: | MouseWhere |
Hi, im a beginner programmer and im just wondering how i would make progam which would allow the user to go click on a circle and then it displays text...for example i have a circle and when i click on it it is suppose to give me text on a new screen so neone plz msg me tnks alot u guyz are the best ![]() |
Author: | jonos [ Wed Mar 03, 2004 6:50 pm ] |
Post subject: | |
well, you probably know about mousewhere, and if you don't look at reference because then you could learn on your own and probably learn some other things too. this is more of problem solving, i don't know, you could test if you're in the circle by "making" and imaginary box around and checking the coordinates. you can do that by yourself, its easy. another way: make the circle a unique colour and then use whatdotcolour and dodge will love you forever. just do: loop mousewhere(mousex, mousey, button) if whatdotcolour(mousex, mousey)={yourcolour} the print text on screen end if end loop you should try it yourself though, its really easy. |
Author: | Thuged_Out_G [ Wed Mar 03, 2004 9:31 pm ] | ||
Post subject: | |||
disregard jonos example, that will have nothing to do with clicking, just where you put your cursor.
there, that will put to the screen whenever you click in the circle, and it will never put text over the circle...because once you do that, it will erase part of the circle...do it enough and you have no circle left to click on lol |
Author: | jonos [ Wed Mar 03, 2004 9:33 pm ] |
Post subject: | |
you're not supposed to give him the code, your supposed to try and help him figure it out for himself. its not that hard to do, and he should learn to try it for himself. anyways nice code. |
Author: | recneps [ Fri Mar 05, 2004 3:56 pm ] | ||
Post subject: | |||
or, if you're not doing anything else in the program except waiting for a click, you can use buttonwait (good for stopping the program and wait for click before going on with what the click told the program) Its used in same way, but you specify the type of click like up, down, updown, and the button type , left, right, middle. and for it to be a CIRCLE button, then you should use a circular way of checking, rather than a box. You could use
|
Author: | jonos [ Fri Mar 05, 2004 4:03 pm ] |
Post subject: | |
i don't think he wants to have to press the button when he wants something to appear. |
Author: | recneps [ Fri Mar 05, 2004 4:14 pm ] |
Post subject: | |
Wait, on my thing for circle, i believe it should be if Math.Distance(mousex,mousey,circlex,circley) <radius then But i believe it would work both ways. ![]() |