Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you add custom characters to a TextLabel?

Asked by 7 years ago

This is not a direct question. I'm theorizing here - I'm only looking for conceptual answers.

Suppose we had a textlabel with text on it. If we do not turn on "TextScaled", the text will take up an exact amount of pixels on any given screen (Correct me if I'm wrong). Also suppose that the screen size does not change, so when the label is made, it will remain the same size.

Since the amount of space each item takes is always the same, could one put an icon/imageGui right over a bit of text so that it looks like the icon is in the textbox? Because the amount of space that the Text takes up is always the same, the calculations for creating a GUI over top of the label would be easier.

For example, say I had the word "PI" in a sentence. I want to change out PI for the symbol PI. So I have a script create a GUI right on top of where PI appears on the text label so it looks like there is a character in line with the text.

Let me know what you think

0
Yes you could. Based on how you explain your question, putting a text label and an imagelabel over a bit of text is possible if you shrink it a bit to fit the size of the text. 7_c 37 — 7y
0
you'll want to use TextBounds to get the size of the text to position the image Disillusions 61 — 7y
0
@Disillusions I thought it was GetTextSize from TextService. Is this TextBounds something different? randomsmileyface 375 — 7y

Answer this question