Documentation
¶
Index ¶
- type Editor
- type Preview
- type Selector
- type Sprite
- func (s *Sprite) Bounds() image.Rectangle
- func (s *Sprite) Draw(screen *ebiten.Image)
- func (s *Sprite) PreferredSize() (int, int)
- func (s *Sprite) SetPosition(x, y int)
- func (s *Sprite) SetSize(sx, sy int)
- func (s *Sprite) SetVisible(visible bool)
- func (s *Sprite) Swap(src *model.Sprite) (prev *model.Sprite)
- func (s *Sprite) Update() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
Editor allows for pixel-by-pixel modification of a Sprite
func (*Editor) Draw ¶
func (e *Editor) Draw(screen *ebiten.Image)
Draw renders the Editor to a screen
func (*Editor) PreferredSize ¶
PreferredSize returns the desired width and height of the Editor
func (*Editor) SetPosition ¶
SetPosition changes the XY coordinate of the upper-left pixel
func (*Editor) SetVisible ¶
SetVisible changes the visibility of the Editor
type Preview ¶
type Preview struct {
// contains filtered or unexported fields
}
Preview provides an enlarged view of a Sprite
func NewPreview ¶
NewPreview creates a new Preview for the specified Palette
func (*Preview) Bounds ¶
Bounds returns a rectangle indicating the visible boundaries of the Preview
func (*Preview) Draw ¶
func (p *Preview) Draw(screen *ebiten.Image)
Draw renders the Preview to a screen
func (*Preview) PreferredSize ¶
PreferredSize calculates the desired width and height of the Preview
func (*Preview) SetPosition ¶
SetPosition changes the XY coordinate of the upper-left pixel
func (*Preview) SetVisible ¶
SetVisible changes the visibility of the Preview
type Selector ¶
type Selector struct {
// contains filtered or unexported fields
}
Selector is a 2D grid of Sprites
func NewSelector ¶
NewSelector creates a Selector for the provided SpriteSet with the specified Palette
func (*Selector) Bounds ¶
Bounds returns a rectangle indicatign the visible boundaries of the Selector
func (*Selector) Draw ¶
func (s *Selector) Draw(screen *ebiten.Image)
Draw renders the selector to the screen
func (*Selector) PreferredSize ¶
PreferredSize calculates the desired width and height of the Selector
func (*Selector) SetPosition ¶
SetPosition changes the XP coordinate of the upper-left pixel
func (*Selector) SetVisible ¶
SetVisible changes the visibility of the Selector
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
Sprite represents a square sprite of pixels
func NewSprite ¶
NewSprite creates a new empty Sprite of the specified size, scale (multiplier), and color Palette
func (*Sprite) Draw ¶
func (s *Sprite) Draw(screen *ebiten.Image)
Draw renders the Sprite to a screen
func (*Sprite) PreferredSize ¶
PreferredSize calculates the desired width and height of the Sprite
func (*Sprite) SetPosition ¶
SetPosition changes the XY coordinate of the upper-left pixel
func (*Sprite) SetVisible ¶
SetVisible changes the visibility of the Sprite