Skip to content

Expose text element justify property in the inspector #2209

Description

@mvaligursky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: editor interfaceenhancementNew feature or requestrequires: engineBlocked on an engine change not yet in the editor's engine dependencyrequires: schemaRequires a backend schema change before the editor work can land

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions