Skip to content

Custom Inspector for Rich Text Tag Application #3

@kwan3854

Description

@kwan3854

Summary

Develop a custom Inspector for TMP_Text objects that allows users to apply rich text tags (e.g., <b>, <i>, <color>) to selected portions of the text directly in the Unity Inspector. This eliminates the need to manually write rich text tags and improves workflow efficiency.


Motivation

Manually typing rich text tags can be error-prone and time-consuming, especially for large or complex text content. A visual tool that lets users select a portion of text and apply rich text formatting with a single click will streamline the process and reduce mistakes.


Deliverables

  1. A custom Inspector for TMP_Text objects with:
    • A visual text editing area.
    • Rich text formatting options (bold, italic, color, size, etc.).
    • Drag-and-drop or selection-based tag application.
  2. Support for previewing the formatted text in the Inspector.

Example Workflow

Workflow in Unity Editor

  1. Select a TMP_Text object in the scene.
  2. In the custom Inspector:
    • Highlight a portion of the text in a dedicated text editing area.
    • Choose a formatting option (e.g., Bold, Italic, Color).
    • The selected text is automatically wrapped with the appropriate rich text tags.
  3. Preview the formatted text directly in the Inspector.

Example UI in Inspector

  • Text Area: Displays and allows selection of text.
  • Formatting Buttons:
    • B: Apply <b> for bold text.
    • I: Apply <i> for italic text.
    • Color Picker: Apply <color> with a chosen color.
    • Font Size: Apply <size> with a specified value.
  • Apply and Undo Options: Quickly preview or revert changes.

Priority

Medium: This feature will significantly enhance usability for developers working with richly formatted text, especially in large UI projects.


Notes

The custom Inspector should support all standard rich text tags supported by TextMeshPro and handle edge cases such as overlapping or nested tags. Future iterations could include support for RubyTextMeshPro and other custom extensions.

Metadata

Metadata

Assignees

Labels

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions