Computer Science Canada How to make button help!?! |
Author: | Sam_sam [ Fri Dec 19, 2008 8:44 pm ] | ||||
Post subject: | How to make button help!?! | ||||
Hey, I am no good at this.. so don't expect much. I am in gr.9 doing a grade ten course.. crazy lol Now.. I am making a title page which is the entrance to a store.. and I want to make a button that will lead to the rest of the project.. however.. IT WON'T WORK!... I put the rest of my code as a comment except for the button and it works but when I use my whole code.. it won't work.. I would really appreciate it if you could tell me why and how to fix it! THANKS P.S- I am trying to get the button with the Welcome screen.. that is possible right :opps: ? Code:
Mod Edit: Remember to use syntax tags! Thanks ![]()
|
Author: | Sam_sam [ Fri Dec 19, 2008 9:03 pm ] |
Post subject: | Re: How to make button help!?! |
Thanks!.. Now I know ![]() BUT I STILL NEED HELP.. LOL! |
Author: | andrew. [ Fri Dec 19, 2008 9:07 pm ] | ||
Post subject: | RE:How to make button help!?! | ||
The reason is that your first code (that you commented out) is before your loop with the GUI. Since the loop never ends, it never gets to draw the GUI button. Try putting that loop code in a procedure and then call it from the procedure menu. e.g.
That should be your basic structure of the code. P.S. Try to make your variables have better names. Like fonts could be named fontPapyrus or menue could be named menuButton. |
Author: | Sam_sam [ Fri Dec 19, 2008 9:15 pm ] | ||
Post subject: | Re: How to make button help!?! | ||
OHH!! Maybe I should be more clear.. the commented out one with the loop is just there to help me when I want to know the coordinates of one point... it is nothing.. my main problem is the uncommented ones Thanks for trying! ![]() This is the new code:
|
Author: | andrew. [ Fri Dec 19, 2008 9:23 pm ] |
Post subject: | RE:How to make button help!?! |
Oh, imports have to be the first things that you do. Move your import statement to the very top and it will work. |
Author: | Sam_sam [ Fri Dec 19, 2008 9:29 pm ] |
Post subject: | Re: How to make button help!?! |
Now.. I have stumbled upon a new Problem..*sigh* It only shows the button.. ![]() |
Author: | Tyr_God_Of_War [ Fri Dec 19, 2008 9:47 pm ] |
Post subject: | RE:How to make button help!?! |
I think the best way to solve your problem is to abandon the built in GUI. If you right your own code it will be easy for you to fix it, as you will understand it. Look into the tutorials and Mouse.Where. |
Author: | Sam_sam [ Fri Dec 19, 2008 9:52 pm ] |
Post subject: | Re: How to make button help!?! |
Thanks Guys!.. I'll check it out 2morrow.. need to sleep Bye |
Author: | Sam_sam [ Sat Dec 20, 2008 6:03 pm ] |
Post subject: | Re: How to make button help!?! |
Do you mean the the type where you click on and area and it ACTS like a button..? |
Author: | Insectoid [ Sat Dec 20, 2008 6:12 pm ] |
Post subject: | RE:How to make button help!?! |
It doesn't act like a button, it is a button. That is essentially how every mouse-oriented button works. It's easier because you can tell it exactly what to do, when do disappear, what it looks like. It is far better than the built-in GUI. |
Author: | Sam_sam [ Sat Dec 20, 2008 10:04 pm ] |
Post subject: | Re: How to make button help!?! |
Can you give me an example of a type of code? Greatly Appreciated ![]() |
Author: | Clayton [ Sat Dec 20, 2008 10:35 pm ] |
Post subject: | RE:How to make button help!?! |
Search Turing Submissions for Custom Buttons. I know myself and others have submitted some nifty modules for creating buttons that aren't Turing's built-in buttons. |
Author: | Sam_sam [ Sun Dec 21, 2008 1:25 pm ] |
Post subject: | Re: How to make button help!?! |
Ok.. it helped... but a little I know that I am being picky, but I really would like to understand.. can someone maybe give me a quick run down of how to make a button, or suggest a place for newbies like me to go? Thanks |
Author: | andrew. [ Sun Dec 21, 2008 3:37 pm ] |
Post subject: | RE:How to make button help!?! |
Well, all you have to do is have Mouse.Where in your main loop so that your mouse position is checked each time. Then whenever the mouse x and y values are over the "button" you made and the mouse button is pressed, then it will do what you want. Basically, you do that with an if statement and because of this, you can put what you want to do inside the if statement and you don't have to make another procedure). EDIT: To make your button, you draw a rectangle or something. Maybe use a picture or something. |
Author: | Sam_sam [ Sun Dec 21, 2008 6:03 pm ] |
Post subject: | RE:How to make button help!?! |
Thanks SO MUCH! ![]() |
Author: | Insectoid [ Sun Dec 21, 2008 9:43 pm ] |
Post subject: | RE:How to make button help!?! |
This and this. |
Author: | Sam_sam [ Wed Dec 31, 2008 4:02 pm ] |
Post subject: | RE:How to make button help!?! |
Thanks |