Computer Science Canada Mouse Commands: Mouse.ButtonWait and Mouse.Where |
Author: | bwong [ Sat Jun 04, 2011 8:32 pm ] | ||
Post subject: | Mouse Commands: Mouse.ButtonWait and Mouse.Where | ||
What is it you are trying to achieve? I am making a menu, where when users scroll over an object, the name attributed to the object will appear, and when the user scrolls away from the object, it will go back to black. at the same time, I want to make it so that when the user clicks on it, the object will link to somewhere else. What is the problem you are having? I am able to have both of these functions work independently, but when I try to implement them together, it does not work. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) All variables have been declared beforehand.
Please specify what version of Turing you are using 4.1.1 |
Author: | Badsniper [ Sat Jun 04, 2011 9:56 pm ] | ||
Post subject: | Re: Mouse Commands: Mouse.ButtonWait and Mouse.Where | ||
Look at the comments I put in.
|
Author: | Raknarg [ Sat Jun 04, 2011 10:41 pm ] |
Post subject: | RE:Mouse Commands: Mouse.ButtonWait and Mouse.Where |
The issue is that you are using cls. This clears the entire screen, not just the box. Instead, you should say something like draw a box over the selected area. Just to make you life easier, if I were you, I would scrap the second set of ifs. Instead, use that drawfillbox method I talked about and put it beforehand. That way, it'll always draw the black boxes in, but it'll write over it if the mouse is over the box. |
Author: | bwong [ Sun Jun 05, 2011 8:02 pm ] |
Post subject: | Re: RE:Mouse Commands: Mouse.ButtonWait and Mouse.Where |
Raknarg @ Sat Jun 04, 2011 10:41 pm wrote: The issue is that you are using cls. This clears the entire screen, not just the box. Instead, you should say something like draw a box over the selected area. Just to make you life easier, if I were you, I would scrap the second set of ifs. Instead, use that drawfillbox method I talked about and put it beforehand. That way, it'll always draw the black boxes in, but it'll write over it if the mouse is over the box.
My bad. The cls was only used to indicate that the click function worked (independently) because I haven't finished everything else yet. Oh, and at BadSniper, how would, or what should I do to implement such boolean variables? |