1. Home
  2. Docs
  3. 3D Text Effects – Quick How-Tos
  4. How To – Make your own animation scripts

How To – Make your own animation scripts

This tutorial is based on the scene found in Text3D/Tutorials/Random Typing.

On many occasion we would like to create a completely custom text sequence from script. 3D Text Effect has access methods that allow you to animate text changes. This can be done in the following way:

1. Add a 3D text element to your scene

2. Create a new script and add a DynamicTextElement property to it:

    public DynamicTextElement TextElement; // the text element we will be operating on
// you can also add a custom animation:
AnimationEntry animation;

3. set up default animation for the text element. These are the animations that are used when no animation is specified in the script call.

4. You can modify the text element using the following calls:


 // append text:
  TextElement.AppendText("New text"); // appends "New text" at the end of text element  
  TextElement.AppendText("New text",animation); // appends a text with a custom animation
// insert text:
  TextElement.InsertText(2, "T"); // inserts the letter T in index 2
  TextElement.InsertText(2, "T",animation); // use a custom animation
// remove text
  TextElement.RemoveAt(2); // remove one char in index 2
  TextElement.RemoveAt(2,animation); // use a custom animation
  TextElement.RemoveLast(); // removes the last char
  TextElement.RemoveLast(animation); // use a custom animation
  TextElement.RemoveText(2,3); // removes 3 chars from index 2
  TextElement.RemoveText(2,3,animation); // use a custom animation
// animating glyph without changing text
TextElement.AnimateGlyph(2,animation) ;// animates the glyph at index 2 with a custom animation
// change all the text
TextElement.AnimateTextChange("New Text"); // replace all the text with "New Text"

5. In the Random typing tutorial( Text3D/Tutorials/Random Typing) , we use two of these methods to create random text changes at a constant time. Make sure to review it if you wish to learn more.