TextBox text moves forward 1 pixel

I’m writing a script editor and I have a TextBox (for writing) and a TextLabel (for colors).

Everything works fine but when I go to the beginning of a line, the entire text seems to move forward:

This gets fixed when you delete the text somehow.
Not sure if it’s a bug though.

Any way to fix this?

The text in the video seems to bolden when you go to the first character of a line.
(It’s not actually bold but the textbox moves ever so slightly such that it doesn’t line up perfectly with the textlabel)

When clicking off of the textbox the text will go back 1 pixel like nothing changed.

Any idea on how I could fix this?

Sadly but there no ways of fixing that.
I had the same exact issue heppening to me…
That just how selected text looks like in roblox.
You may try making some shenanigans with text layers to make it look less weird but other than that no solution.
You may try making richtext fake layer move upward when entering focus but that makes selection with mouse impossible.

Thanks for the suggestion, I actually found a solution.

Use offset Position

The raw text input roblox uses can only handle pure integer-based pixels from what I’ve collected.
So it rounds to the nearest pixel it seems.

The simplest solution was to just make the parent frame be offset on the X (and Y).
Now it works properly.

2 Likes

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