|
| 16 Jul 2015 07:43 PM |
Is there a wiki on how to convert the size of a TextLabel to the length of an audio? And how it's size changes for how long the audio is? If there isn't, I need help going about how to do it.
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|
drink
|
  |
| Joined: 03 Mar 2008 |
| Total Posts: 23 |
|
| |
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 16 Jul 2015 07:48 PM |
Huh? [2]
I don't need a siggy |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 07:49 PM |
| sound.TimeLength to get the time of the audio in seconds |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 07:50 PM |
If you take a look at the properties, you'll realize that there is a 'TimeLength' property of Sound. This gives you the length of the audio in seconds.
http://wiki.roblox.com/index.php?title=API:Class/Sound
So, let's say that an X Scale of .8 of the screen is considered "%100" done with the song. You can use Tweening and some basic math to accomplish this.
local sound = whatever local time = sound.TimeLength local label = script.Parent
sound.Changed:connect(function(p) time = sound.TimeLength --Incase of a switch in song if p == "TimePosition" then local percent = (sound.TimePosition/time) * 100 label:TweenSize(UDim2.new(percent*(.008),0,label.Size.Y.Scale,label.Size.Y.Offset) end end)
Don't expect this to work, but its just a little concept and how it can work
|
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 07:50 PM |
X = 1 -- multiplier TextLabel.Size = UDim2.new(Sound.TimeLength * X, 0, 0, 20)
?? |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 16 Jul 2015 07:52 PM |
I still don't get why you want to use a TextLabel
I don't need a siggy |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 07:52 PM |
I'll try to edit it, thanks guys. Also, first 2 people must not know english.(No offenses)
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 07:53 PM |
iiEs, is that really what you are concerned about?
He can use a "Text"Label to put "Text". |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 07:53 PM |
ii, because textbox's and textbuttons make no sense for this situation.
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 16 Jul 2015 07:54 PM |
I'm sorry for being multilingual. English isn't my first language.
I don't need a siggy |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 16 Jul 2015 07:55 PM |
Oh, I get what you are trying to do now
I don't need a siggy |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 07:55 PM |
Well, it makes complete sense. I've really never worked with this type of thing before, so It's really new to me, also, time is in blue.. SO Should I change that to something else?
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|
drink
|
  |
| Joined: 03 Mar 2008 |
| Total Posts: 23 |
|
|
| 16 Jul 2015 07:57 PM |
"I'll try to edit it, thanks guys. Also, first 2 people must not know english.(No offenses)"
"No Offenses"
ok bro
oh and
"And how it's size changes for how long the audio is? If there isn't, I need help going about how to do it."
"and how it's size changes for how long the audio is?"
that doesn't make sense |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 07:59 PM |
It makes complete sense, The TextLabel's size changes for how long the Audio's timelength is. Is it that hard to comprehend?
Also, I'm not your "bro" and thirdly, I came for help. Not for responses that don't include anything to do with what I'm asking for.
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|
drink
|
  |
| Joined: 03 Mar 2008 |
| Total Posts: 23 |
|
| |
|
|
| 16 Jul 2015 08:02 PM |
It does, I just put the wrong words to describe what I wanted.
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|
drink
|
  |
| Joined: 03 Mar 2008 |
| Total Posts: 23 |
|
|
| 16 Jul 2015 08:02 PM |
| what's in your text label? |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 08:03 PM |
Btw, I was trying to edit my Custom Health script into this type of topic, I just need someone that can edit it for me.
here it is:
local Sound = game.Workspace.Sound TimePosition = Sound.TimePosition
TimePosition.Changed:connect(function() script.Parent.Health.Frame.Size = UDim2.new(TimePosition.Value/TimePosition.Value,0,1,0) script.Parent.Frame.Text.TextLabel.Text=""..(math.floor(TimePosition.Value)).."/"..TimePosition.Value" " if TimePosition.Value <= TimePosition.Value*0.25 then script.Parent.Health.Frame.BackgroundColor3 = Color3.new(170/255, 0/255, 0/255) else script.Parent.Health.Frame.BackgroundColor3 = Color3.new(0/255, 85/255, 0/255) end end)
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2015 08:19 PM |
Anyone?
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|
drink
|
  |
| Joined: 03 Mar 2008 |
| Total Posts: 23 |
|
| |
|
|
| 16 Jul 2015 08:22 PM |
I'm sure you can, you're just not wanting to help.
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|
drink
|
  |
| Joined: 03 Mar 2008 |
| Total Posts: 23 |
|
| |
|
|
| 16 Jul 2015 08:28 PM |
Ok.. That's fine I guess.
I stole YOUR siggy! |
|
|
| Report Abuse |
|
|