sprite_file

0th

Percentile

Wrap an image sprite for easy handling

This function is equivalent to gif_file() but works for animations encoded as a sprite. A sprite is a single image file where each frame of the animation is stacked next to each other. The animation then happens by changing what slice of the image is shown. The implementation used allow users to click on the animation in order to toggle pause/play.

Keywords
internal
Usage
sprite_file(file, fps, width, full_width, height)

# S3 method for sprite_image print(x, width = NULL, ...)

knit_print.sprite_image(x, options, ...)

Arguments
file

A png file with frames placed horizontally

fps

The framerate for the sprite animation

width, height

The dimension of a single frame

full_width

The width of the whole image

x

A sprite_image object

...

Arguments passed on

Value

sprite_file returns a sprite_image object which is a shallow wrapper around the file path text string along with dimensions and fps used for animating the sprite when printing.

Aliases
  • sprite_file
  • print.sprite_image
  • knit_print.sprite_image
Documentation reproduced from package gganimate, version 1.0.3, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.