How do I make a paragraph look like a typewriter animation?

64 views Asked by At

I am trying to get a paragraph to be animated as if a typewriter is doing it with typewriter sound effects

The code I have figured out won't show the whole paragraph or I can't save it as a gif/ video or there's no sound effect can anyone help?

The R code I used will only show some of the paragraph

library(animation)
library(magick)

text_to_animate <- "The designer has the freedom to manipulate a space to direct
and follow its users. Freedom to see change how an individual views and interacts
with a space driven by the designer's mind. How the designer wants the world to 
be and feel. It allows the designer to change the world, specify it to an 
individual, allowing someone to see the world in the vision that they want it to 
be. It can come in many variations, where it is in small versions of changing 
the color or an enlarged version by manipulating scale. The changing of small
details which cause a person to stop and think, adding two inches to the height
of a stair, causes the person to break out of the norms. Impacting somebody in
the smallest ways, or in the largest ways that the person isn’t even aware. 
Manipulating the design standards* can impact somebody consciously or 
unconsciously how they tactilely feel the world, how they see the world, 
how they navigate the world and how they move in the world."

typewriter_animation <- function() {
  for (j in 1:3) {
    for (i in 1:nchar(text_to_animate)) {
      plot.new()
      text(x = -2, y = 1.5, substr(text_to_animate, 1, i), adj = 0)
      Sys.sleep(0.1)
    }
  }
}

ani.options(interval = 0.1, nmax = nchar(text_to_animate), 
            ani.width = 600, ani.height = 400, 
            loop = TRUE, duration = Inf)


typewriter_frames <- saveGIF({
  typewriter_animation()
0

There are 0 answers