anim

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANIMATIONTYPE_INT     = 0
	ANIMATIONTYPE_FLOAT   = 1
	ANIMATIONTYPE_VECTOR2 = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ANIMSTATUS

type ANIMSTATUS uint8
const (
	AnimstatusPlaying ANIMSTATUS = iota
	AnimstatusStop
)

type ANIMVALTYPE

type ANIMVALTYPE uint8
const (
	AnimValTypeInt ANIMVALTYPE = iota
	AnimValTypeFloat
	AnimValTypeVector2
)

type Anim

type Anim struct {
	Id   int
	Name string
	// contains filtered or unexported fields
}

func NewAnim

func NewAnim(name string, fps float64, totalframe int, isLoop bool) *Anim

func (*Anim) AddChannel added in v1.1.0

func (this *Anim) AddChannel(name string, dataType ANIMVALTYPE, values []*AnimationKeyFrame)

func (*Anim) Fps

func (a *Anim) Fps() float64

func (*Anim) Play

func (a *Anim) Play() *Anim

func (*Anim) SampleChannel added in v1.1.0

func (this *Anim) SampleChannel(name string) interface{}

func (*Anim) SetEasingFunction added in v1.1.0

func (this *Anim) SetEasingFunction(easingFunc tools.IEasingFunction)

func (*Anim) SetLoop

func (a *Anim) SetLoop(isloop bool) *Anim

func (*Anim) SetOnErrorListener added in v1.1.0

func (this *Anim) SetOnErrorListener(errorfuc func(error))

func (*Anim) SetOnPlayingListener

func (this *Anim) SetOnPlayingListener(playfuc func(int, bool, float64))

func (*Anim) SetOnStopingListener

func (this *Anim) SetOnStopingListener(stopfuc func())

func (*Anim) Status

func (a *Anim) Status() ANIMSTATUS

func (*Anim) Stop

func (a *Anim) Stop() *Anim

func (*Anim) Update

func (this *Anim) Update(delay float64) bool

type AnimChannel added in v1.1.0

type AnimChannel struct {
	Name     string
	DataType int
	// contains filtered or unexported fields
}

func NewAnimChannel added in v1.1.0

func NewAnimChannel(name string, dataType int, easingFunc tools.IEasingFunction, keys []*AnimationKeyFrame) *AnimChannel

loopmodel = -1

func (*AnimChannel) SetEasingFunction added in v1.1.0

func (this *AnimChannel) SetEasingFunction(easingFunc tools.IEasingFunction)

type AnimationKeyFrame

type AnimationKeyFrame struct {
	Frame int
	Value interface{} // Vector2 or Int or Float
}

type IAnimatable

type IAnimatable interface {
	GetTarget() IAnimationTarget
	Animate() bool
}

type IAnimation

type IAnimation interface {
	GetAnimId() int64
	Animate(delay float64, from int, to int, loop bool, speedRatio float64) bool
}

type IAnimationTarget

type IAnimationTarget interface {
	GetAnimations() []IAnimation
	GetAnimatables() []IAnimatable
}

Jump to

Keyboard shortcuts

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