Animated GIFs for TView-based TUIs (powered by pixelview)
There are two ways to create a new GifView:
// From an existing gif.GIF object
gifImg := &gif.GIF{}
img, err := gifview.FromImage(gifImg)
// From a file path
gifPath := "images/dancing-baby.gif"
img, err := gifview.FromImagePath(gifPath)
Once you have one or more GifViews, they will animate whenever the application re-draws. You can force that to happen on a regular basis by using the Animate
function.
app := tview.NewApplication()
go gifview.Animate(app)