how do i get my program to recognize input from a mosue?
Author |
Message |
Neja
|
Posted: Wed May 28, 2003 8:04 pm Post subject: how do i get my program to recognize input from a mosue? |
|
|
Meaining, how do i make a sub program appear when the user clicks on the text ie) Click HERE to start
????
Stupid question, I know. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
krishon
|
Posted: Wed May 28, 2003 8:11 pm Post subject: (No subject) |
|
|
well i dunno if u can clikc on the word, the mods can verify that, but u can draw a box. then u use a command (that i forgot) that can track the location of the mouse. Once the mouse clicks inside the box, and u have an if statement that checks if the moouse click is inside the box, then it'll probably work |
|
|
|
|
|
Tony
|
Posted: Wed May 28, 2003 8:14 pm Post subject: (No subject) |
|
|
Mouse.Where(x,y,b)
it assigns mouse position to variables x and y. B tells you if it was clicked or not.
you check if mouse locations is inside the rectangle boundy and if button is also clicked (b=1) then it was pressed and you shoudl continue. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
krishon
|
Posted: Wed May 28, 2003 8:15 pm Post subject: (No subject) |
|
|
that's the one, thx tony |
|
|
|
|
|
Homer_simpson
|
Posted: Wed May 28, 2003 8:18 pm Post subject: (No subject) |
|
|
i think this is what u want
code: | var mx, my, mb : int
var col : int
locate (10, 10)
color (9)
put "click here to start"
loop
mousewhere (mx, my, mb)
if mb not= 0 then
if whatdotcolor (mx, my) not= white then
var winID := Window.Open ("position:top;center,graphics:200;200")
cls
put "you just started it"
exit
end if
end if
if whatdotcolor (mx, my) not= white then
color (12)
else
color (9)
end if
locate (10, 10)
put "click here to start"
delay (5)
end loop
|
this one uses text collision detection so u have to be exactly on the letters for it to work... |
|
|
|
|
|
Neja
|
Posted: Wed May 28, 2003 9:08 pm Post subject: (No subject) |
|
|
Hmm, yeah, thanks. i think that's the one.
|
|
|
|
|
|
|
|