anime

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StepAnimation

type StepAnimation struct {
	// contains filtered or unexported fields
}

StepAnimation is an animation. This animates according to the number of steps.

func NewStepAnimation

func NewStepAnimation(frames []*ebiten.Image, duration int) *StepAnimation

NewStepAnimation returns a new StepAnimation generated with args.

func (*StepAnimation) AddStep

func (s *StepAnimation) AddStep(steps float64)

AddStep adds steps information. If your character moved, please call this function with steps information.

func (*StepAnimation) GetCurrentFrame

func (s *StepAnimation) GetCurrentFrame() *ebiten.Image

GetCurrentFrame returns a current frame image. This function determines the current frame based on the information on how far a character moved. If the sum of steps is grater than the DurationSteps, this function will return the next frame.

type TimeAnimation

type TimeAnimation struct {
	// contains filtered or unexported fields
}

TimeAnimation is an animation. This animates according to elapsed time.

func NewTimeAnimation

func NewTimeAnimation(frames []*ebiten.Image, duration float64) *TimeAnimation

NewTimeAnimation returns a new TimeAnimation generated with args.

func (*TimeAnimation) GetCurrentFrame

func (t *TimeAnimation) GetCurrentFrame() *ebiten.Image

GetCurrentFrame returns a current frame image. This function determines the current frame according to elapsed time. If the elapsed time is grater than the DurationSecond, this function will return the next frame.

Jump to

Keyboard shortcuts

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