Okay, I’ve just taken a quick look at the code and I may have overstated the simplicity slightly ![]()
How familiar are you with Slate?
Essentially what needs to happen is that the draw location of everything needs to be offset in SEditableText::OnPaint based on the justification used, FTextLayout::JustifyLayout shows what the text layout does to achieve this (except it’s offsetting the text blocks rather than hacking it into paint) - you could probably use GetDesiredSize() to get the size of the text currently in the editable text.
The part I’d initially forgotten you’d have to do, and this is where a text layout shines as it does this for you, is that your mouse input also has to be adjusted to compensate for the fact that the text is being drawn at an offset (see SEditableText::OnMouseButtonDown, SEditableText::OnMouseButtonUp, SEditableText::OnMouseMove, and SEditableText::OnMouseButtonDoubleClick). You can use FPointerEvent::MakeTranslatedEvent to adjust the hit position by the inverse of the transform applied in OnPaint before letting the function handle the mouse event.