Skip to content

Add Action Handling API to TypeWriter/TextReader Using TextMotionPro Parsing #4

@BluePixelDev

Description

@BluePixelDev

Description:
Extend the TypeWriter/TextReader component to support inline action execution during text animation, using pre-parsed data from the existing TextMotionPro component. This allows real-time reactions to actions such as {wait} and {speed} at specific character indices.

Requirements:

  • Leverage the existing TextMotionPro parsing output to identify action tags.

  • Provide a public API to query actions at a given character index, e.g.:

    List<TextAction> GetActionsAtIndex(int charIndex);
  • Integrate action tags directly into the reading logic:

    • {wait} → pause text reveal for a given duration.
    • {speed=X} → update reveal speed dynamically.
  • Add a delegate/event system to notify listeners when an action tag is encountered during reading:

    public delegate void OnActionTagTriggered(TextAction action);
    public event OnActionTagTriggered ActionTagTriggered;

Implementation Notes:

  • Action tags are not rendered in the final output; only their effects are applied.
  • The TextMotionPro component is responsible for parsing and holding the tag metadata.
  • Ensure tag execution is frame-accurate and non-blocking where possible.
  • {wait} and {speed} should be implemented as built-in/integrated actions.

Example Flow:

  1. Reader reaches character index 10.
  2. TextMotionPro reports {wait=1.0} at index 10.
  3. TypeWriter pauses output for 1 second and triggers ActionTagTriggered.

Goals:

  • Modular action handling that decouples tag parsing from execution logic.
  • Allow easy extension with custom tags for future features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions