The title is somewhat confusing, and I’m having trouble figuring out how to find the UI position of the last character inside of a string, if it’s even possible. Can anyone help me or lead me in the right direction because I’m pretty lost at this point.
(ScalarX, PixelX, ScalarY, PixelY)
like this
local gui = gui.Position ----- gui here
obj = gui.UDim2.Y
print(obj)
I’m not trying to find the position of the GUI object itself. I’m looking for the position of the last character inside the textlabel. Essentially, I’m creating a cursor that flashes right in front of the last character in the label as it types out. I’m going for something along the lines of what I just attached. (Apologies for the low resolution image)
idont think you can get character inside the textlabel position try other way like adding a green icon
Alright, thanks. I’ll try to substitute it with something easier to work with.
Perhaps using TextService:GetTextSize, you can find the position of the last element and if you have the green cursor as a child of the text label, you can set its position to the size of the text:
local TextService = game:GetService("TextService")
local label = -- text label reference
local size = TextService:GetTextSize(label.Text, label.TextSize, label.Font, Vector2.new(9e4, 9e4))
cursor.Position = UDim2.fromOffset(size.x, 0)
I’ll give it a shot! Thanks for your help!