How to find if there is a gap in the text?

so im making the script that makes random 1 and 0 at the text
and sometimes it makes weird gaps
image
is there some way to detect there is a gap and the script have to fill it?

Is this in a text label? Is the textXalignment set to align left?

1 Like

yes its a textlabel
and its center
image

So the gaps either side on the last line is just because the text is centered.
I guess you want to make sure the whole label is completely filled?
Assuming the text doesn’t scale, and the label won’t be changing size, I would use a while loop to keep adding the numbers using textlabel.textfits as a condition to stop the loop.

--something like this
while textlabel.textfits do
  addNumberFunction()
end

it doesnt seem to work?

Is the text label a fixed size? Or does it resize based on content (as that would be a problem)

image
yes its fixed size

Scale the text using a Plugin or the property “TextScaled”

im using text scaled actually and textfits actually

Weird, is Clips descendants true? And is the text a fixed size (or constrained) if textscaled is true it usually sets text fits to true permanently.

its turned off
image

text scaled is true
sooooooooo

Try

Clips descendants= true
Textscaled= false

Basically the method I suggested relies on creating a text overflow. It’s a simple script but requires the right properties setup.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.