Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var XMargin int
XMargin sets a per glyph clipping of Width/4 on the left and right of a glyph
Functions ¶
This section is empty.
Types ¶
type Font ¶
type Font struct { Name string `json:"name"` Author string `json:"author"` Date time.Time `json:"date"` Revision int `json:"revision"` Glyphs []*Glyph `json:"sprites"` // contains filtered or unexported fields }
Font represents one or more glyphs belonging to a single face
func (*Font) Describe ¶
func (f *Font) Describe()
Describe summarizes a Font according to its metadata
func (*Font) Render ¶
func (f *Font) Render()
Render generates images for each Glyph to be later used in the rendering process
func (*Font) SetPalette ¶
SetPalette sets the color Palette for the Glyphs in this Font
type Glyph ¶
type Glyph struct {
// contains filtered or unexported fields
}
Glyph holds the data for a single glyph
func (*Glyph) Image ¶
func (g *Glyph) Image() *ebiten.Image
Image returns the internal image as an ebiten image
func (*Glyph) SetPalette ¶
SetPalette changes the color palette for this Glyph and crops as needed
func (*Glyph) UnmarshalJSON ¶
UnmarshalJSON is a custom unmarshaler for the Glyph type
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"` }
Palette is a color picker for a Palette of colors
func DecodePalette ¶
DecodePalette decodes a Palette from an embedded JSON file and unmarshals it