silk
Experienced
Posts: 32
|
Post by silk on Dec 7, 2020 10:14:35 GMT
Hi there, I think that you're not using the readmouse instruction correctly. Your first readmouse instruction says: "mouse over something, if it's the second bitmap return correct, otherwise return wrong, then go to the next instruction". In other words, no matter which bitmap is mouse over the script will continue. You have to specify which bitmap is concerned by the readmouse instruction by adding the range parameter at the end of the instruction. Basically it says: consider only bitmap x or y for my instruction and not the others. For instance...
readmouse 2 30000 range 2 3 ...means that I expect the second bitmap to be mouse over, and the script will only go to the next instruction if I mouse over the second or the third bitmap -- and nothing will happen if I mouse over the first or the fourth bitmap. In your script I added the range parameter to your readmouse instructions ("range 2 2" for the first one, because you want exactly this bitmap to be mouse over).
task Pi1 show circle 0 -100 5.67 255 255 255 show rectangle 100 -100 6 6 0 0 255 show rectangle -75 0 50 50 0 0 0 show rectangle 75 0 50 50 0 0 0 show text "oui" -75 0 255 255 255 show text "non" 75 0 255 255 255 readmouse 2 500000 range 2 2 clear 2 show circle 0 100 56.69 128 128 128 show rectangle 100 -100 6.1 6.1 0 255 0 readmouse l 3 500000 range 3 4
Moreover note that I added a "l" to your second readmouse instruction since you want a "click" and not a simple "mouse over" on the answer.
|
|