A module that gets the lines of a textbox

Ok guys I made a module that lets you get each line of a textbox even if it has Multiline enabled

GetLines.rbxm (1.6 KB)

Here are examples


image

image


image

image


The lines will be stored in a table and can be accessed like this

lines[lineNumber].Text will retrieve the text

lines[lineNumber].Position.Start will retrieve the start position of the text in pixels (relative to the textbox)

lines[lineNumber].Position.End is the same but it will retrieve the end position of the text in pixels (also relative to the textbox)

Position Values are stored as Vector2

Also I don’t think this is really optimized
Feedback will be appreciated

5 Likes

does it work with different resolutions? in a smaller screen there should be a diferent number of lines

Yes it does (im pretty sure)

30 30 30 30 30 30 30 30

Oops sorry guys I accidentally put this in the Scripting Support category