Wolfram Research

Function Repository Resource:

TextChangeAnimation

Source Notebook

Create an animation of text changing

Contributed by: Bob Sandheinrich

ResourceFunction["TextChangeAnimation"][str1,str2,n]

gives an animation of text str1 changing into str2 in n steps.

ResourceFunction["TextChangeAnimation"][str1,str2]

uses 10 steps.

Details and Options

ResourceFunction["TextChangeAnimation"] accepts the options of both ListAnimate and Graphics as well as the following:
"TextStyle" 16 Style specification for the text
"AnimationFunction" ListAnimate function to use for animation
Values for "AnimationFunction" must accept the same inputs and options as ListAnimate.
The text is converted to lowercase.
Characters from str2 that are not in str1 come from the outside.
Characters from str1 that are not in str2 go to the outside.

Examples

Basic Examples

Create a text change animation:

In[1]:=
ResourceFunction[
 "TextChangeAnimation"]["turn this text", "into something else"]
Out[1]=

Scope

Create only four frames:

In[2]:=
ResourceFunction[
 "TextChangeAnimation"]["turn this text", "into something else", 4]
Out[2]=

Options

TextStyle

Specify the text style:

In[3]:=
ResourceFunction[
 "TextChangeAnimation"]["this is purple", "it is also large", "TextStyle" -> Directive[32, Purple, FontFamily -> "Source Code Pro"]]
Out[3]=

AnimationFunction

Use the SimpleListAnimate resource function to create the animation:

In[4]:=
ResourceFunction[
 "TextChangeAnimation"]["this is purple", "it is also large", "AnimationFunction" -> ResourceFunction["SimpleListAnimate"]]
Out[4]=

Graphics Options

Specify the style of the background:

In[5]:=
ResourceFunction[
 "TextChangeAnimation"]["radical contrast", "creates drama", "TextStyle" -> Directive[16, White], Background -> Black]
Out[5]=

ListAnimate Options

Specify the animation direction:

In[6]:=
ResourceFunction[
 "TextChangeAnimation"]["goes forward", "backward too", AnimationDirection -> ForwardBackward]
Out[6]=

Properties and Relations

Get the frames:

In[7]:=
Cases[ResourceFunction["TextChangeAnimation"]["turn this text", "into something else"], _Graphics, 10]
Out[7]=

Create just three frames:

In[8]:=
Cases[ResourceFunction["TextChangeAnimation"]["turn this text", "into something else", 3], _Graphics, 10]
Out[8]=

Resource History

Related Resources

License Information