Computer Science Canada Mouse.Where help |
Author: | Tricia [ Fri Nov 26, 2004 4:06 pm ] |
Post subject: | Mouse.Where help |
i'm learning on how to make buttons change colours when the mouse goes over them and i have no idea how to do it except to use the predfined command Mouse.Where |
Author: | Cervantes [ Fri Nov 26, 2004 4:20 pm ] | ||
Post subject: | |||
Mouse.Where sure is complicated eh? Not more complicated than the if statement! Those if statements, simple as they may seem, are more useful than more complicated functions like Mouse.Where. Without the if statements, you wouldn't be able to use Mouse.Where all that well. So, back to the if statements we go! You have a button, at drawn at (x1, y1, x2, y2). You also know the position of the mouse, at (x,y). So, use if statements.
Hurray for the if statements! |
Author: | Tricia [ Fri Nov 26, 2004 4:25 pm ] | ||
Post subject: | |||
oh ic so i tried writing the code using that thanks and here's the code i wrote so this is wrong isn't it? coz it's not working
|
Author: | DanShadow [ Fri Nov 26, 2004 11:22 pm ] | ||
Post subject: | |||
This is a simple layout for that. Although I warn you, seeing as your mouse is still over the box as it changes, it will continuously change colors until cursor moved outside box. But this answers your question...
|
Author: | Cervantes [ Sat Nov 27, 2004 10:31 am ] | ||
Post subject: | |||
Tricia wrote: oh ic so i tried writing the code using that thanks and here's the code i wrote so this is wrong isn't it? coz it's not working
using the colour(n : int) command only changes the colour of outputed text (using the put command). It does not change the colour of the box. To do that, you have to change the last parameter of the drawfillbox command. |