generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Editing GUIs With Scripts?

Previous Thread :: Next Thread 
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 06:47 PM
Okay, I know how to make GUIS, but how do I edit their size, color, transparency, position and all that, in a script instead of in the properties panel? I appreciate any help! ^-^
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
15 Feb 2013 06:55 PM
local gui = script.Parent -- Point to the gui you wish to changed


gui.Property = Value

Ex:
gui.Name = "BOB"
gui.Size = Udim2.new(0,0,0,0)
gui.Position= Udim2.new(0,0,0,0)
gui.Visible = false

Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
15 Feb 2013 06:59 PM
UDim2.new() not Udim2.new()
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 07:46 PM
Thanks but how do you alter transparency? (That's what I'm trying to do right now) Here's what I've been trying but doesn't work:

while true do
Title = Script.parent --Script is inside the GUI
Title.Transparency = 1
end
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
15 Feb 2013 07:49 PM
that should work but you should put a wait() in that while loop...and why is there a while loop?
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
15 Feb 2013 07:50 PM
Well, for a frame, image button and image label you can change its BackgroundTransparency. For a text label, text button and a text box you can change its TextStrokeTrsnaprency, BackgroundTransparency or its TextTransparency.

Remember... The wiki is your friend.

http://wiki.roblox.com/index.php/BackgroundTransparency_(Property)
http://wiki.roblox.com/index.php/TextTransparency_(Property)
http://wiki.roblox.com/index.php/TextStrokeTransparency_(Property)
Report Abuse
kubuto2 is not online. kubuto2
Joined: 16 Jul 2008
Total Posts: 1275
15 Feb 2013 07:52 PM
UDim2 hold 4 values. UDim2.new(Size,OffSet,Size,OffSet)
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 07:53 PM
notsopwnedg,

I do not know... You see I have another script that changes a block's transparency and I kind of just used that for reference. And it had a while loop so... X3
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 07:55 PM
Desperian,

Thanks, but I didn't really understand the Background Transparency one. It was pretty vague and didn't explain anything [helpful] really...
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 08:00 PM
So for the background transparency on my GUI, do I input:

gui transparency = 1

or

gui BackgroundTransparency = 1
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
15 Feb 2013 08:01 PM
Okay, so for example if I had a frame that had a size of {1,0}, {1,0} inside a ScreenGui then I could do this to make it so the screen fades to grey (Or whatever else the BackgroundColor3 is set to)

for i = 0,1,0.1 do -- Counts up to 1 in increments of 0.1
wait(0.1)
script.Parent.St00f.BackgroundTransparency = i
end

Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
15 Feb 2013 08:03 PM
For what you've just asked,

Frame = script.Parent.Frame
Frame.BackgroundTransparency = 0.5

(Interchangeable with all the GUI elements that have a background transparency property)
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 08:05 PM
Okay, thanks. But... (Oh no, I have SO MANY questions! XD) Why isn't this working?

Title = Script.parent
Title.BackgroundTransparency = 1

I think I may need an "end" at the end and something at the beginning, but I can't remember... (Sorry guys, please go easy on me, I'm a beginner! D:)
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
15 Feb 2013 08:07 PM
Heh, Lua likes correct capitalisation.

Title = script.Parent
Title.BackgroundTransparency = 1
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 08:10 PM
That was the only problem!? Wow! And, thanks so much guys! ^-^ BUT IT STILL DOESN'T WORK! -_- I'm about to just stop bugging you guys if this proceeds and try to figure this out some other day...
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
15 Feb 2013 08:12 PM
It should work so long as the scripts parent is a GUI object that has a BackgroundTransparency property.
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 08:13 PM
Hmm... It is; it's an ImageLabel, but I treally don't know why it doesn't work. -.- Oh well...
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 08:16 PM
There must just be something wrong with Roblox Studio, because I even tried what you said (with the for loop) and it didn't work. I guess I'll stop bugging you now... And try another day... Curse you script!
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
15 Feb 2013 08:19 PM
Eh, if it's an image label then the issue may be that it doesn't have a transparent background when it was uploaded, perhaps?
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 08:19 PM
Thanks for trying though! I appreciated it!
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
15 Feb 2013 08:20 PM
Oh whoops, I replied and didn't see your post. Yes, its transparency is already 0.
Report Abuse
captinsoap is not online. captinsoap
Joined: 24 Jan 2010
Total Posts: 9570
15 Feb 2013 10:34 PM
put this in the frame of the gui

while true do
script.Parent.Transparency = 0.1
wait(0.5)
script.Parent.Transparency = 0.2
wait(0.5)
script.Parent.Transparency = 0.3
wait(0.5)
script.Parent.Transparency = 0.4
wait(0.5)
script.Parent.Transparency = 0.5
wait(0.5)
script.Parent.Transparency = 0.6
wait(0.5)
script.Parent.Transparency = 0.7
wait(0.5)
script.Parent.Transparency = 0.8
wait(0.5)
script.Parent.Transparency = 0.9
wait(0.5)
script.Parent.Transparency = 1
end

it will keep repeating and changing transparency






★MY SIGGY IS IN CAPS SO RESPECT ME★
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
15 Feb 2013 10:50 PM
So inefficient.
Report Abuse
Angel2538 is not online. Angel2538
Joined: 01 Jan 2011
Total Posts: 165
16 Feb 2013 04:09 PM
captinsoap,

Thanks! I'll just change it so it doesn't loop, because I want it to just be the title fading in. -.- Hopefully it works...
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
16 Feb 2013 04:13 PM
Captain's script scares me...


local i = 0
while true do
local i = 0
repeat
i = i + 1
script.Parent.Transparency = i
wait(0.5)
until i == 1
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image