Engine 2.22 adds a justify property to text element components (playcanvas/engine#9185, resolves playcanvas/engine#4633). It stretches wrapped lines to be flush with both edges of the element by widening the gaps between their words.
The inspector does not expose it yet, so the only way to use it in a project is from a script.
Suggested change:
- Add a boolean field for
justify to the text element inspector, next to Alignment and Wrap Lines.
- It only does anything when Wrap Lines is on and Auto Width is off, so it is a candidate for the same conditional visibility those fields already use.
Notes:
justify is a plain boolean, defaults to false.
- It does not replace Alignment. Alignment keeps positioning the lines that are never stretched — the last line of the text, lines ended by an explicit line break, and lines with no gaps to widen — so the two fields are both meaningful at the same time.
Should wait until the engine release containing it is out.
Engine 2.22 adds a
justifyproperty to text element components (playcanvas/engine#9185, resolves playcanvas/engine#4633). It stretches wrapped lines to be flush with both edges of the element by widening the gaps between their words.The inspector does not expose it yet, so the only way to use it in a project is from a script.
Suggested change:
justifyto the text element inspector, next to Alignment and Wrap Lines.Notes:
justifyis a plain boolean, defaults tofalse.Should wait until the engine release containing it is out.