databrain
|
  |
| Joined: 01 Jan 2013 |
| Total Posts: 3342 |
|
|
| 23 Jul 2014 07:17 PM |
Whenever I use TextBounds, in my local script, on my TextLabel, it returns Vector2.new(0, 0).
My script is local, and my TextLabel doesn't have TextScaled set to true. Any help on this?
Is TextBounds no longer supported? It doesn't seem to work in online mode. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jul 2014 08:01 PM |
| Try waiting before getting it so it can render |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jul 2014 08:06 PM |
| (I found this to be annoying. I am 90% certain its JUST being a descendant of a PlayerGui and being renderable, IDK if Visible affects it) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jul 2014 08:06 PM |
| I don't think Visible affects it but when I used to use TextBounds, adding a wait usually fixed my problem of it returning (0, 0) |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 08:08 PM |
| cntkillme: Don't wait, just check TextBounds after its parented and it will function correctly (IDK if it being offscreen affects it, I know being hidden by ClipsDescendants doesn't) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jul 2014 08:10 PM |
| Wouldn't it already be parented if he just puts it in a GUI in StarterGui? Or are you assuming he is Instance.newing? |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 08:12 PM |
| I am assuming he is cloning it from somewhere, checking TextBounds, then parenting it last. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jul 2014 08:16 PM |
Probably.
Anyway the scenario I was talking about (or at least it was like this a year ago) was when I had a GUI in starterGUI but I couldn't instantly check textbounds (example being: print(script.Parent.Label.TextBounds)), but after adding a wait it seemed to work.
Maybe it was something wrong on my part. |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 08:17 PM |
| Unless I do something wrong I never have that issue... Maybe they fixed it, but I don't remember a year ago or if I had a chat GUI a year ago (The largest use I use it for) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Jul 2014 08:19 PM |
| I think I was using a BillboardGUI actually, parent being StarterGui and adronee'd to some part in workspace. |
|
|
| Report Abuse |
|
|
databrain
|
  |
| Joined: 01 Jan 2013 |
| Total Posts: 3342 |
|
|
| 23 Jul 2014 10:25 PM |
So, it has to be parented?
That's a pain. I was meaning to make it not show the text until it calculated the positions based off the text length.
Allthough, if it's clipped by ClipDescendants, will it still work? |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2014 10:26 PM |
| They wont notice, so why does it matter? |
|
|
| Report Abuse |
|
|