Documentation ¶
Index ¶
- Constants
- type AsepriteAnimation
- type AsepriteFile
- func (asf *AsepriteFile) GetAnimation(animName string) *AsepriteAnimation
- func (asf *AsepriteFile) GetFrameXY() (float32, float32)
- func (asf *AsepriteFile) HitTag(tagName string) bool
- func (asf *AsepriteFile) HitTags() []string
- func (asf *AsepriteFile) IsPlaying(animName string) bool
- func (asf *AsepriteFile) LeftTag(tagName string) bool
- func (asf *AsepriteFile) LeftTags() []string
- func (asf *AsepriteFile) Play(animName string)
- func (asf *AsepriteFile) TouchingTag(tagName string) bool
- func (asf *AsepriteFile) TouchingTags() []string
- func (asf *AsepriteFile) Update(deltaTime float32)
- type AsepriteFrame
Constants ¶
const ( // AsepritePlayForward plays animations forward AsepritePlayForward = "forward" // AsepritePlayBackward plays animations backwards AsepritePlayBackward = "reverse" // AsepritePlayPingPong plays animation forward then backward AsepritePlayPingPong = "pingpong" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsepriteAnimation ¶
AsepriteAnimation contains the details of each tagged animation
type AsepriteFile ¶
type AsepriteFile struct { ImagePath string FrameWidth int32 FrameHeight int32 Frames []AsepriteFrame Animations []AsepriteAnimation CurrentAnimation *AsepriteAnimation CurrentFrame int32 PrevFrame int32 PlaySpeed float32 Playing bool // contains filtered or unexported fields }
AsepriteFile contains all properties of an exported aseprite file.
func New ¶
func New(aseJSONFilePath string) AsepriteFile
New Parses and returns an AsepriteFile. Your starting point.
func (*AsepriteFile) GetAnimation ¶
func (asf *AsepriteFile) GetAnimation(animName string) *AsepriteAnimation
GetAnimation Returns a pointer to an AsepriteAnimation of the desired name. If it can't be found, it will return `nil`.
func (*AsepriteFile) GetFrameXY ¶
func (asf *AsepriteFile) GetFrameXY() (float32, float32)
GetFrameXY Returns the current frame's X and Y coordinates on the source sprite sheet for drawing the sprite.
func (*AsepriteFile) HitTag ¶
func (asf *AsepriteFile) HitTag(tagName string) bool
HitTag Returns if the AsepriteFile's playback just touched a tag by the specified name.
func (*AsepriteFile) HitTags ¶
func (asf *AsepriteFile) HitTags() []string
HitTags Returns a list of tags the AsepriteFile just touched.
func (*AsepriteFile) IsPlaying ¶
func (asf *AsepriteFile) IsPlaying(animName string) bool
IsPlaying Returns if the named animation is playing.
func (*AsepriteFile) LeftTag ¶
func (asf *AsepriteFile) LeftTag(tagName string) bool
LeftTag Returns if the AsepriteFile's playback just left a tag by the specified name.
func (*AsepriteFile) LeftTags ¶
func (asf *AsepriteFile) LeftTags() []string
LeftTags Returns a list of tags the AsepriteFile just left.
func (*AsepriteFile) Play ¶
func (asf *AsepriteFile) Play(animName string)
Play Queues playback of the specified animation (assuming it can be found).
func (*AsepriteFile) TouchingTag ¶
func (asf *AsepriteFile) TouchingTag(tagName string) bool
TouchingTag Returns if the AsepriteFile's playback is touching a tag (animation) by the specified name.
func (*AsepriteFile) TouchingTags ¶
func (asf *AsepriteFile) TouchingTags() []string
TouchingTags Returns a list of tags the playback is touching.
func (*AsepriteFile) Update ¶
func (asf *AsepriteFile) Update(deltaTime float32)
Update Steps the file forward in time, updating the currently playing animation (and also handling looping).
type AsepriteFrame ¶
AsepriteFrame contains the frame information