Documentation ¶
Index ¶
- Constants
- type ANIMSTATUS
- type ANIMVALTYPE
- type Anim
- func (a *Anim) AddKeyFrame(frameindex int, frameval interface{}) *Anim
- func (a *Anim) Fps() float64
- func (a *Anim) Play() *Anim
- func (a *Anim) SetLoop(isloop bool) *Anim
- func (a *Anim) SetOnPlayingListener(playfuc func(int, interface{})) *Anim
- func (a *Anim) SetOnStopingListener(stopfuc func()) *Anim
- func (a *Anim) Status() ANIMSTATUS
- func (a *Anim) Stop() *Anim
- func (a *Anim) Update(delay float64) bool
- type Animatable
- type Animation
- func (this *Animation) Animate(target IAnimationTarget, delay float64, from int, to int, loop bool, ...) bool
- func (this *Animation) GetAnimId() int64
- func (this *Animation) Init(name string, framePerSecond float64, dataType int, loopMode int)
- func (this *Animation) SetEasingFunction(easingFunc tools.IEasingFunction)
- func (this *Animation) SetKeys(values []*AnimationKeyFrame)
- func (this *Animation) SetOnErrorListener(errorfuc func(*Animation, error))
- func (this *Animation) SetOnPlayingListener(playfuc func(*Animation, int, interface{}))
- func (this *Animation) SetOnStopingListener(stopfuc func(*Animation))
- type AnimationKeyFrame
- type IAnimatable
- type IAnimation
- type IAnimationTarget
Constants ¶
View Source
const ( ANIMATIONTYPE_INT = 0 ANIMATIONTYPE_FLOAT = 1 ANIMATIONTYPE_VECTOR2 = 2 //Repeat the animation incrementing using key value gradients. ANIMATIONLOOPMODE_RELATIVE = 0 ANIMATIONLOOPMODE_CYCLE = 1 //Restart the animation from initial value ANIMATIONLOOPMODE_CONSTANT = 2 //Pause the animation at the final value )
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 ¶
func (*Anim) AddKeyFrame ¶
func (*Anim) SetOnPlayingListener ¶
func (*Anim) SetOnStopingListener ¶
func (*Anim) Status ¶
func (a *Anim) Status() ANIMSTATUS
type Animatable ¶
type Animatable struct { FromFrame int ToFrame int LoopAnimation bool AnimationStartedDate int SpeedRatio float64 // contains filtered or unexported fields }
func NewAnimatable ¶
func NewAnimatable(target IAnimationTarget, from int, to int, loop bool, speedRatio float64) *Animatable
func (*Animatable) Animate ¶
func (this *Animatable) Animate(delay float64) bool
func (*Animatable) GetTarget ¶
func (this *Animatable) GetTarget() IAnimationTarget
interface
type IAnimatable interface { GetTarget() IAnimationTarget Animate() bool }
func (*Animatable) Init ¶
func (this *Animatable) Init(target IAnimationTarget, from int, to int, loop bool, speedRatio float64)
type Animation ¶
type Animation struct { Name string Id int64 FramePerSecond float64 DataType int LoopMode int // contains filtered or unexported fields }
func NewAnimation ¶
loopmodel = -1
func (*Animation) Animate ¶
func (this *Animation) Animate(target IAnimationTarget, delay float64, from int, to int, loop bool, speedRatio float64) bool
interface
type IAnimation interface { Animate(target IAnimationTarget, delay float64, from float64, to float64, loop bool, speedRatio float64) bool }
func (*Animation) SetEasingFunction ¶
func (this *Animation) SetEasingFunction(easingFunc tools.IEasingFunction)
func (*Animation) SetKeys ¶
func (this *Animation) SetKeys(values []*AnimationKeyFrame)
func (*Animation) SetOnErrorListener ¶
func (*Animation) SetOnPlayingListener ¶
func (*Animation) SetOnStopingListener ¶
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 IAnimationTarget ¶
type IAnimationTarget interface { GetAnimations() []IAnimation GetAnimatables() []IAnimatable }
Click to show internal directories.
Click to hide internal directories.