Documentation
¶
Overview ¶
Package animation are the components for running and sprite.Sprite animations
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Get = gets{ Animation: func(e *entity.Entity) Animation { return e.Get(TYPE.Animation).(Animation) }, State: func(e *entity.Entity) State { return e.Get(TYPE.State).(State) }, Sequence: func(e *entity.Entity) Sequence { return e.Get(TYPE.Sequence).(Sequence) }, }
Get animation component
View Source
var TYPE = types{ Animation: reflect.TypeOf(Animation{}), State: reflect.TypeOf(State{}), Sequence: reflect.TypeOf(Sequence{}), }
TYPE hold the reflect.Type for our animation components
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct { Sequences map[string]Sequence // Sequences is the different AnimationSequence for this Animation Current string // Current is the animation that be like to run Speed float32 // Speed is a multiplier of th speed of the current animation FlipX bool // FlipX indicates if the Animation is flipped in the X-Assis FlipY bool // FlipY indicates if the Animation is flipped in the Y-Assis }
Animation allow to easily switch animations
type Sequence ¶
type Sequence struct { Sheet string // Sheet is the sprite sheet where the animation sprites are Base string // Base is the base name for each frame. ex : Idle_%d.png Rotation float32 // Rotation for this AnimationSequence Scale float32 // Scale for this AnimationSequence Frames int32 // Frames are the number of frame in this animation Delay float32 // Delay number of seconds to wait in each frame }
Sequence represent a set of frames that will be render with a delay
Click to show internal directories.
Click to hide internal directories.