amazing
i’m a bit confused on this line of code tho
Grid.CellSize = UDim2.fromScale(#Text.Text / 25 ,1)
why do you use #Text.Text / 25
?
amazing
i’m a bit confused on this line of code tho
Grid.CellSize = UDim2.fromScale(#Text.Text / 25 ,1)
why do you use #Text.Text / 25
?
I think it’s to fit the billboard GUI on the character’s head as #Text finds the length of the string and then divides it by 25 to fit on the player’s head.
Exactly, and i’m dividing it by 25 to get a decimal number so it fit to the scale size which is bewteen 0 and 1.
It was divided by 20 at first because it is the maximum number of characters for usernames… i increased it to 25 i don’t remember why xD
I’ve did some experimenting, I’ve tried to add this line of code to offset the image a bit
UIPadding.PaddingLeft = UDim.new(3 - (#Text.Text * 0.1), 1)
It seems to not work very well, and it even broke the layout a few times, should I go back to GetTextBoundsAsync?
Oh yeah, i did a few tests and as the image size is also being “ghostly” resized by the grid layout it change the padding distance a little bit from the name.
You can simply play a bit with the divide factor of the grid
Highter the division is, less spacing there will be between the text and the image, and lower the division is, more spacing there will be between the text and the image, you could try to adjust it by yourself
if #Text.Text <= 5 then --number of characters 3 to 5
Grid.CellSize = UDim2.fromScale(#Text.Text/18, 1)
elseif #Text.Text > 5 then --number of characters 6 to 20
Grid.CellSize = UDim2.fromScale(#Text.Text/25, 1)
end
alright, I’ll give it a shot, ty for now :))
Alright i reworked it so it is more accurate and you can change image position directly from it’s properties, if you want more or less distance from the text.
Billboard Scaling.rbxl (52.7 KB)