rgif

package
v0.0.0-...-7ca39b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2020 License: Zlib Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawGif

func DrawGif(gif *GifImage, x int, y int, tint r.Color)

DrawGif draws a single frame of a gif

func DrawGifEx

func DrawGifEx(gif *GifImage, position r.Vector2, rotation float32, scale float32, tint r.Color)

DrawGifEx draws a gif with rotation and scale

Types

type FrameDisposal

type FrameDisposal int
const (
	FrameDisposalNone FrameDisposal = iota
	FrameDisposalDontDispose
	FrameDisposalRestoreBackground
	FrameDisposalRestorePrevious
)

type GifImage

type GifImage struct {

	//Texture is the current frame of the gif
	Texture r.Texture2D
	//Width is the width of a single frame
	Width int
	//Height is the height of a single frame
	Height int
	//Frames is the number of frames available
	Frames int
	//Timing is the delay (in 100ths of seconds) a frame has
	Timing []int
	//Disposal is the disposal for each frame
	Disposal []FrameDisposal
	// contains filtered or unexported fields
}

GifImage represents a gif texture

func LoadGifFromFile

func LoadGifFromFile(fileName string) (*GifImage, error)

LoadGifFromFile loads a new gif

func (*GifImage) CurrentFrame

func (gif *GifImage) CurrentFrame() int

CurrentFrame returns the current frame index

func (*GifImage) CurrentTiming

func (gif *GifImage) CurrentTiming() int

CurrentTiming gets the current timing for the current frame

func (*GifImage) GetRectangle

func (gif *GifImage) GetRectangle(frame int) r.Rectangle

GetRectangle gets a rectangle crop for a specified frame

func (*GifImage) NextFrame

func (gif *GifImage) NextFrame()

NextFrame increments the frame counter and resets the timing buffer

func (*GifImage) Reset

func (gif *GifImage) Reset()

Reset clears the last frame time and resets the current frame to zero

func (*GifImage) Step

func (gif *GifImage) Step(timeSinceLastStep float32)

Step performs a time step.

func (*GifImage) Unload

func (gif *GifImage) Unload()

Unload unloads all the textures and images, making this gif unusable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL