Skip to content

Latest commit

 

History

History
70 lines (49 loc) · 2.43 KB

README.md

File metadata and controls

70 lines (49 loc) · 2.43 KB

TMP-Text-Juicer

License: MIT

Text Juicer for Text Mesh PRO Is a plugin to allow you do "per-character-animation" on text fields, like this one:

Component Work flow

Controlling the animation

This git is a ready to be used as sub-module, so just add to your project anywhere inside the Assets Folder, something like Assets/Text Juicer/

If you don't know how to add as a sub-module you can check this guide

Controlling the animation

Basically you can access and change the progress of the animation by the animator itself, or using the helpers inside the TextAnimation, by simply caling, Play(), Stop() and Restart()

Adding new effects

Is quite simple, you just need to extend the TextJuicerVertexModifier

[RequireComponent(typeof(TMP_TextJuicer))]
    public abstract class TextJuicerVertexModifier : MonoBehaviour
    {
        private TMP_TextJuicer cachedTextJuicer;

        public abstract bool ModifyGeometry { get; }
        public abstract bool ModifyVertex { get; }
        protected TMP_TextJuicer TextJuicer
        {
            get
            {
                if (cachedTextJuicer == null)
                    cachedTextJuicer = GetComponent<TMP_TextJuicer>();
                return cachedTextJuicer;
            }
        }

        private void OnValidate()
        {
            TextJuicer.SetDirty();
        }

        public abstract void ModifyCharacter(CharacterData characterData, TMP_Text textComponent,
            TMP_TextInfo textInfo,
            float progress,
            TMP_MeshInfo[] meshInfo);
    }
Multiple Effects

Current Effects:

  • Transform Modifier (Position / Scale / Rotation)
  • Color Modifier
  • Gradient Modifier
  • Color Modifier
  • Warp Modifier

Inspired in this post from reddit, and the awesome ui-extensions