sprite

package
v0.0.0-...-abed7bd Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2015 License: BSD-3-Clause Imports: 21 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandSync

func CommandSync(ss []*Sprite, cmds [][]string, sync_tag string)

Types

type Data

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

type FrameRect

type FrameRect struct {
	X, Y, X2, Y2 int
}

type Manager

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

func MakeManager

func MakeManager() *Manager

func (*Manager) LoadSprite

func (m *Manager) LoadSprite(path string) (*Sprite, error)

type Sprite

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

func LoadSprite

func LoadSprite(path string) (*Sprite, error)

func (*Sprite) Anim

func (s *Sprite) Anim() string

func (*Sprite) AnimState

func (s *Sprite) AnimState() string

func (*Sprite) Bind

func (s *Sprite) Bind() (x, y, x2, y2 float64)

func (*Sprite) Command

func (s *Sprite) Command(cmd string)

func (*Sprite) CommandN

func (s *Sprite) CommandN(cmds []string)

func (*Sprite) Dims

func (s *Sprite) Dims() (dx, dy int)

func (*Sprite) Facing

func (s *Sprite) Facing() int

func (*Sprite) GetSpriteState

func (s *Sprite) GetSpriteState() SpriteState

func (*Sprite) Idle

func (s *Sprite) Idle() bool

func (*Sprite) NumPendingCmds

func (s *Sprite) NumPendingCmds() int

func (*Sprite) SetSpriteState

func (s *Sprite) SetSpriteState(state SpriteState) error

func (*Sprite) SetTriggerFunc

func (s *Sprite) SetTriggerFunc(tf TriggerFunc)

func (*Sprite) State

func (s *Sprite) State() string

func (*Sprite) StateFacing

func (s *Sprite) StateFacing() int

func (*Sprite) Think

func (s *Sprite) Think(dt int64)

func (*Sprite) Wait

func (s *Sprite) Wait(states []string)

type SpriteState

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

An opaque object that contains everything necessary to start a sprite from a particular point. Useful when rewinding something, for example. Gobbable.

func (*SpriteState) GobDecode

func (ss *SpriteState) GobDecode(data []byte) error

func (*SpriteState) GobEncode

func (ss *SpriteState) GobEncode() ([]byte, error)

type TriggerFunc

type TriggerFunc func(*Sprite, string)

A trigger func is a function that is called when a certain frame of animation is reached. It is specified by line like "func:foo bar wingding" in the animation graph, and such a line will mean that when that frame is reached by any sprite with that graph the TriggerFunc foo will be called with two parameters, the Sprite that reached that frame, and the text "foo bar wingding".

Jump to

Keyboard shortcuts

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