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 » Scripters
Home Search
 

Re: Question.

Previous Thread :: Next Thread 
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
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 is not online. drink
Joined: 03 Mar 2008
Total Posts: 23
16 Jul 2015 07:47 PM
Huh?
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
16 Jul 2015 07:48 PM
Huh? [2]


I don't need a siggy
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
16 Jul 2015 07:49 PM
sound.TimeLength to get the time of the audio in seconds
Report Abuse
DigitalVeer is not online. DigitalVeer
Joined: 23 Jun 2009
Total Posts: 4182
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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
16 Jul 2015 07:50 PM
X = 1 -- multiplier
TextLabel.Size = UDim2.new(Sound.TimeLength * X, 0, 0, 20)

??
Report Abuse
iiEssence is not online. 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
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
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
DigitalVeer is not online. DigitalVeer
Joined: 23 Jun 2009
Total Posts: 4182
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
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
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 is not online. 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 is not online. 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
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
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 is not online. 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
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
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 is not online. drink
Joined: 03 Mar 2008
Total Posts: 23
16 Jul 2015 08:01 PM
no it doesn't
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
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 is not online. drink
Joined: 03 Mar 2008
Total Posts: 23
16 Jul 2015 08:02 PM
what's in your text label?
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
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
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
16 Jul 2015 08:19 PM
Anyone?

I stole YOUR siggy!
Report Abuse
drink is not online. drink
Joined: 03 Mar 2008
Total Posts: 23
16 Jul 2015 08:21 PM
sorry, i cant script well
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
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 is not online. drink
Joined: 03 Mar 2008
Total Posts: 23
16 Jul 2015 08:24 PM
no, i actually cant
Report Abuse
SurfaceLight is not online. SurfaceLight
Joined: 06 Apr 2014
Total Posts: 7574
16 Jul 2015 08:28 PM
Ok.. That's fine I guess.

I stole YOUR siggy!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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