LogoLogo
Showcase & FeaturesDiscord✨Get on the asset store✨
Text Animations for UI Toolkit
Text Animations for UI Toolkit
  • Text Animations for UI Toolkit
  • Getting Started
  • Animated Visual Elements
  • Text Animation Settings
  • USS Properties
  • Templates
  • Performance Optimization Guide
  • Animations
    • Built-in Animations
    • Custom Animations
  • Typewriting
    • Built-in Text Appearance / Vanishing Animations
    • Typewriter Animation Settings
    • Typewriter Control Tags
  • Events
    • Events
    • Built-in Event Handlers
    • Custom Events
  • C# Extensions
    • Custom C# Animations
    • Custom Event Handlers
  • Technical Details
    • Limitations
Powered by GitBook
On this page
  • Reacting to events with the Animated Text Events component
  • Reacting to events from C#

Was this helpful?

  1. Events

Custom Events

PreviousBuilt-in Event HandlersNextCustom C# Animations

Last updated 5 months ago

Was this helpful?

You can emit custom events by using the <event="customEvent"> tag. Adding this tag will create a CustomEvent with the name field set to "customEvent".

For example, the following text would emit two events:

<event="wave">Hi! I hope you enjoy using <event="jump"><bounce>animations</bounce>

At the start it emits a CustomEvent with the name "wave", later it emits an event with the name "jump" right when the word "animations" starts to appear.

Custom events only work when you have Text Appearance enabled in your Text Animation Settings.

Reacting to events with the Animated Text Events component

You can add as many custom events as you want. Use the On Custom Event UnityEvent to interact with your scene.

Reacting to events from C#

You can add an event handler to the customEventTriggered event on your animated visual elements.

var animatedLabel = uiDocument.rootVisualElement.Q<AnimatedLabel>("animated-label");
animatedLabel.customAnimationTriggered += YourEventHandler;