Recently I’ve been working on a nametag system for my game which supports stuff like ranks/titles, and after searching a bunch of resources for reference I’ve noticed that a lot of the existing nametag systems use Scale for their BillboardGui.
This is okay and it does the job, but with a cost. It makes the text and strokes (if any) look weird. Refer to an earlier screenshot of my nametag system where it did use Scale.
It’s not very noticeable at first, but the strokes also get larger depending on how close or far you are from the BillboardGui. As a workaround for this. I ended up just using offset for the nametag. It made the nametag look good and clean, but it didn’t support smaller screen sizes.
Here, I was stumped. But then I remembered that we can dynamically resize the nametag by using a UIScale modifier to make the nametag look both consistent and good on all screen sizes.
Example Code:
local camera = workspace.CurrentCamera
local multiplier = 1 / 1080 -- default resolution
local x, y = camera.ViewportSize.X, camera.ViewportSize.Y
local currentScale = if y < x
then multiplier * y
else multiplier * x
local uiScale = nametag:FindFirstChildWhichIsA("UIScale")
uiScale.Scale = currentScale
Now this doesn’t mean that you have to automatically use this. This is only really for the people that have really want their BillboardGuis to look consistent and clean. But using Scale is completely fine for your BillboardGui.
tl;dr - Use Offset with a UIScale modifier instead of Scale for BillboardGuis
This is my first quick tutorial on the devforum so if you’ve read through the entirety of this, kudos to you and thank you for taking your time to read this.
Another reason for why I had to use offset instead of scale for my nametags is because some of the “titles” have 2d particle effects which I use to make it look cooler. The problem is that this module uses offset internally, so keeping the BillboardGui sizing to offset helped tremendously without having to completely rewrite the particle emitter + the UIScale would automatically resize the particles inside the nametag.
This is really just a very specific use-case type deal which is why I didn’t mention it in the main post.
Assume lengh of part to be a X axis and height to be Y axis;Caculate its ratio (X devided by Y) and then apply formula from my post (2nd formula).
That would be way easier and more convinient as for me.
Wow you really didnt read anything at all, did you?
I also don’t think you realize how expensive it is to constantly change the thickness of a UIStroke as well.
You even contradicted yourself in the replies (even though you’re completely wrong)