SpikexpJoin Date: 2008-08-05 Post Count: 513 |
Understanding GUI's Part: 2
Now, we've obviously read the first post (http://www.roblox.com/Forum/ShowPost.aspx?PostID=30858898 for those that haven't), so we'll go from there. We're even going to do some scripting! But first, a Quick Re-cap.
-We should call it a G-U-I instead of “gooey” when learning (Although it's completely acceptable to pronounce it “gooey”
-Inserting and Sizing objects is easy!
-Inserting Images is easy!
-Changing colours is easy!
-We also learned what each part of a GUI is, and how it's used
So, we've made the base of our GUI, and we've even put images in it, too. Now, we're going to put some changing text. Just because we can.
0. This is zero, because it's not really an “instruction”. You have to open Output to view problems with your script, even though there shouldn’t be...
View>Output
1. To start off, insert a Text Label into your basic GUI Insert>Object>TextLabel
2. Change the size of X to 1, as this means it's as wide as your GUI
3. Change the size of Y to 0.1, or whatever makes it just high than the text
4. Ignore the text right now, it doesn't really matter.
5. Insert a script into the Label you just made. (Woohoo!) Insert>Objects>Script
(Third column, fourth from the bottom) Make sure it does NOT say “LocalScript”*
6. Double click on the script. It should be called “Script”
7. Once it's open, your script should just say print 'Hello World'
8. That's a pretty lame script. Also, it only will print “Hello World”, so we're going to change it. First, delete print “Hello World”. Then, we'll start with [ while true do ]. This makes it a loop.
--Remove the square brackets, this is just telling YOU what is supposed to go in the script.
9. After that, type in [ a=”text here” ] then put in what you want the text to say first
10. Then put [ b=”text here” ]. Make “text here” the second thing you want it to say.
--For simplicities sake, this will only be two options, but play around with the script to do more.
-- Pro Tip! Always make sure your text is in quotation marks!
11. Now write in [ script.Parent.Text=a ].This is basically telling Roblox that “This script's Parent's “Text” variable should be 'text here' “
12. Then we'll place a “wait()” I put in [ wait(3) ] because that gives enough time to read, without lasting too long.
--Tech Jargon: “wait(3)” tells Roblox “Pause for 3 seconds” The three can be changed to any number.
13. Now we have to change it to the other text. Can you guess what it will be? If you said [ script.Parent.Text=b ], you're right!
14. We'll put in another [ wait(3) ] so that it pauses for another three seconds...
15. Then we write “end”, so that Roblox knows that we've ended the script.
--Pro Tip! We aren't actually ending the script, we're ending the function “while true do”
*Most good scripters would say “You fool, A local script will still let the script run!”
Yes, I know that, but basics first. No need to rush into things, amirite?
Please request things, I don't know what you guys want!
Seriously, I'm at a loss for ideas...
Happy Scripting!
--Spikexp
::GLOSSARY::
Roblox: is a massively multiplayer online game (MMOG) virtual playground and workshop designed for children aged 6 and over.
GUI: Graphical User Interface
“--Pro Tip!”: A snippet of information not necessary at a low level of something, but possibly useful later on
“--Tech Jargon:”: Help understanding a certain term, or terms, used in the last sentence/instruction.
“--”: Marks a comment that may be helpful to the instruction at hand.
|