README
¶
gifview
Animated GIFs for TView-based TUIs (powered by pixelview)
Usage
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)
Based on
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Animate ¶
func Animate(app *tview.Application)
Animate triggers the application to redraw every 50ms
Types ¶
type GifView ¶
GifView is a box which displays animated gifs via Omnikron13's pixelview dynamic color rendering. It automatically draws the right frame based on time elapsed since creation. You can trigger re-drawing by executing Animate(tview.Application) in a goroutine.
func FromImagePath ¶
FromImagePath creates a new GifView from a file on disk
func (*GifView) GetCurrentFrame ¶
GetCurrentFrame returns the current frame the GIF is on