|
| 23 Jun 2014 02:02 PM |
This is the script: function OnMouseHover() script.Parent.Info.BackgroundTransparency = 0.4 end script.Parent.MouseEnter:connect(OnMouseHover)
function OnMouseNotHover() script.Parent.Info.BackgroundTransparency = 1 end script.Parent.MouseLeave:connect(OnMouseNotHover)
So basically, if the mouse hovers over the parent, then the BackGroundTransparency is set to the value. If it not, then the background transparency is set to another value. I want to make a hover GUI, and it works so far.
Basically, when you hover over the gun buy button, its stats pop up. But the problem is, only the Info (which is a Frame) goes transparent, not its children which are TextBoxes. I would like the entire thing to disappear!
Is there any way to make all the children of 'Info' transparency 0.4 when the mouse is over them, and 1 when it is not? Thanks for all replies! |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2014 02:06 PM |
BUMP! In a more simpler way, is there a way to select all the CHILDREN of the thing (AND THE THING ITSELF) and edit them? |
|
|
| Report Abuse |
|
|
Rethiux
|
  |
| Joined: 14 Nov 2012 |
| Total Posts: 1132 |
|
| |
|
|
| 23 Jun 2014 02:09 PM |
| How? Sorry, I don't really get it. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2014 02:11 PM |
function OnMouseHover() script.Parent:GetChildren(TextBox)BackgroundTransparency = 0.4 end script.Parent.MouseEnter:connect(OnMouseHover)
function OnMouseNotHover() script.Parent:GetChildren(TextBox)BackgroundTransparency = 1 end script.Parent.MouseLeave:connect(OnMouseNotHover)
How about this? |
|
|
| Report Abuse |
|
|
| |
|
Rethiux
|
  |
| Joined: 14 Nov 2012 |
| Total Posts: 1132 |
|
|
| 23 Jun 2014 02:20 PM |
local GUI = "Whatever the GUI is here" local C = GUI:GetChildren() function OnMouseHover() C.Visible = true end
function OnMouseNotHover() C.Visible = false end
script.Parent.MouseLeave:connect(OnMouseNotHover)
script.Parent.MouseEnter:connect(OnMouseHover) |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2014 02:20 PM |
function OnMouseHover() script.Parent.Info.BackgroundTransparency = 0.4 script.Parent.Info.TextBox.BackgroundTransparency = 1 script.Parent.Info.TextBox1.BackgroundTransparency = 1 script.Parent.Info.TextBox2.BackgroundTransparency = 1 script.Parent.Info.TextBox3.BackgroundTransparency = 1 script.Parent.Info.TextBox.TextTransparency = 0 script.Parent.Info.TextBox1.TextTransparency = 0 script.Parent.Info.TextBox2.TextTransparency = 0 script.Parent.Info.TextBox3.TextTransparency = 0 end script.Parent.MouseEnter:connect(OnMouseHover)
function OnMouseNotHover() script.Parent.Info.BackgroundTransparency = 1 script.Parent.Info.TextBox.TextTransparency = 1 script.Parent.Info.TextBox1.TextTransparency = 1 script.Parent.Info.TextBox2.TextTransparency = 1 script.Parent.Info.TextBox3.TextTransparency = 1 end script.Parent.MouseLeave:connect(OnMouseNotHover)
Here is the finished script! It took a while but I just individually selected all of the children (which were TextBoxes) and made them a certain transparency. |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2014 02:21 PM |
| Thanks anyway, Rethiux, that's a lot less than mine :D. |
|
|
| Report Abuse |
|
|
DevFrank
|
  |
| Joined: 04 Apr 2012 |
| Total Posts: 1469 |
|
|
| 23 Jun 2014 02:22 PM |
function OnMouseHover () script.Parent.Info.Visible = true end script.Parent.MouseEnter:connect(OnMouseHover)
function OnMouseNotHover() script.Parent.Info.Visible = false end script.Parent.MouseLeave:connect(OnMouseNotHover)
have its transpsarency to 0.4 and use this.
|
|
|
| Report Abuse |
|
|
Rethiux
|
  |
| Joined: 14 Nov 2012 |
| Total Posts: 1132 |
|
|
| 23 Jun 2014 02:25 PM |
| @Dev; That's basically mine... |
|
|
| Report Abuse |
|
|
DevFrank
|
  |
| Joined: 04 Apr 2012 |
| Total Posts: 1469 |
|
|
| 23 Jun 2014 02:27 PM |
| Still. Mine might be easier to understand for others. |
|
|
| Report Abuse |
|
|