drew8732
|
  |
| Joined: 01 Apr 2010 |
| Total Posts: 1965 |
|
|
| 20 Aug 2013 04:43 PM |
What function could I use so when people MouseOver my TextBox, its border color changes? (To look like it's being "highlighted.")
I found one called MouseMoved on the wiki, but it didn't look right for what I'm trying to do. I'd like the script to be parented to be TextBox.
I'm assuming it's called something like "MouseOver?" Thanks!
|
|
|
| Report Abuse |
|
|
|
| 20 Aug 2013 04:46 PM |
http://wiki.roblox.com/index.php/RBX.lua.TextBox_%28Object%29
MouseEnter
Just look at the wiki page. |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
|
| 20 Aug 2013 04:54 PM |
Put a script inside the text button and add this code inside:
script.Parent.MouseEnter:connect(function() --When the mouse enters. script.Parent.TextStrokeColor3 = Color3.new(255,255,255) --Change the number's to your liking. for i = 1,10 do script.Parent.TextStrokeTransparency = script.Parent.TextStrokeTransparency - .1 wait(0.025) end end)
script.Parent.MouseLeave:connect(function() --When the mouse leaves. script.Parent.TextStrokeColor3 = Color3.new(255,255,255) --Again, change the number's to your liking. for i = 1,10 do script.Parent.TextStrokeTransparency = script.Parent.TextStrokeTransparency + .1 wait(0.025) end end) |
|
|
| Report Abuse |
|
|
drew8732
|
  |
| Joined: 01 Apr 2010 |
| Total Posts: 1965 |
|
|
| 20 Aug 2013 07:52 PM |
| Thanks! But just wondering, what's the "for i = 1,10 do" part about? I've seen that line in a lot of scripts and just wondered how it works. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Aug 2013 07:55 PM |
| http://www.roblox.com/Forum/ShowPost.aspx?PostID=110411773 |
|
|
| Report Abuse |
|
|
Kasumo
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 2467 |
|
|
| 20 Aug 2013 07:57 PM |
I used the for i = 1,10 part to make a smooth effect. So when the mouse enter's the text box the color will fade in smoothly. Rather than just being choppy and automatically turn whatever color.
Now if you want to know what 'for' actually means, 'for' is a type of loop and is used for running a command a certain amount of times. The first number is that starting value, and the second number is the ending value.
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 20 Aug 2013 07:59 PM |
| and the optional third number is the increasement |
|
|
| Report Abuse |
|
|