Documentation
¶
Index ¶
- func SaveSprites() error
- func SetPalette(p *Palette)
- func SetSprites(set *SpriteSet)
- type Palette
- type Sprite
- func (s *Sprite) Bounds() image.Rectangle
- func (s *Sprite) Clone() (next *Sprite)
- func (s *Sprite) HasChanged() bool
- func (s *Sprite) Image() *image.Paletted
- func (s *Sprite) IsModified() bool
- func (s Sprite) MarshalJSON() (bs []byte, err error)
- func (s *Sprite) Palette() *Palette
- func (s *Sprite) SetBG(x, y int)
- func (s *Sprite) SetFG(x, y int)
- func (s *Sprite) SetPalette(colors *Palette)
- func (s *Sprite) UnmarshalJSON(b []byte) (err error)
- func (s *Sprite) Update()
- type SpriteSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetPalette ¶
func SetPalette(p *Palette)
SetPalette swaps the current Palette with a different one
func SetSprites ¶
func SetSprites(set *SpriteSet)
SetSprites swaps out the current SpriteSet with a different one
Types ¶
type Palette ¶
type Palette struct { Name string `json:"name"` Author string `json:"author"` Date time.Time `json:"date"` Revision int `json:"revision"` Colors encoding.Colors `json:"colors"` // contains filtered or unexported fields }
Palette is a color picker for a Palette of colors
func LoadPalette ¶
LoadPalette reads a Palette from a JSON file and unmarshals it
func (*Palette) Describe ¶
func (p *Palette) Describe()
Describe privides a simple description of the Palette with its Metadata
func (Palette) HasChanged ¶
HasChanged indicates that this palette has undergone changes
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
Sprite holds the data for a single sprite
func (*Sprite) HasChanged ¶
HasChanged report if the Sprite has been edited or if the color palette has changed
func (*Sprite) IsModified ¶
IsModified reports if this Sprite has edited
func (Sprite) MarshalJSON ¶
MarshalJSON is a custom marshaler for the Sprite type
func (*Sprite) SetPalette ¶
SetPalette changes the color palette for this sprite
func (*Sprite) UnmarshalJSON ¶
UnmarshalJSON is a custom unmarshaler for the Sprite type
type SpriteSet ¶
type SpriteSet struct { Name string `json:"name"` Author string `json:"author"` Date time.Time `json:"date"` Revision int `json:"revision"` Sprites []*Sprite `json:"sprites"` // contains filtered or unexported fields }
SpriteSet represents one or more sprites belonging to a single set
func GetSprites ¶
func GetSprites() *SpriteSet
GetSprites retrieves a list of all of the sprints in the current SpriteSet
func LoadSpriteSet ¶
LoadSpriteSet reads in a SpriteSet for a JSON file and decodes it
func (*SpriteSet) Close ¶
func (ss *SpriteSet) Close()
Close lets go of the file for this sprite set
func (*SpriteSet) Describe ¶
func (ss *SpriteSet) Describe()
Describe summarizes a SpriteSet according to its metadata
func (*SpriteSet) IsModified ¶
IsModified checks if any fo the sprites have been modified
func (*SpriteSet) SetPalette ¶
SetPalette sets the color Palette for this SpriteSet