Skip to content

yauhen-l/text-animator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This library provides only one method DrawGif which generates animated GIF image, based on an imput.

Here is an example:

f, _ := os.OpenFile("out.gif", os.O_WRONLY|os.O_CREATE, 0600)
defer f.Close()

err := DrawGif(DefaultFace(), []string{
"ba ",
"   DUM!",
" Tss",
}, []int{10, 50, 100}, f)

Arguments are:

  • *truetype.Font - which font to use for rendering
  • slice of frames to animate
  • slice of timings for frames in 100ths of a second
  • io.Writer - where to write data (in this example it is a file out.gif)

out.gif output file in this case will look like this:

ba-DUM-Tss

This library I use in telegram bot: https://telegram.me/text_shots_bot