Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sheet ¶
type Sheet struct {
// contains filtered or unexported fields
}
Sheet contains the data and meta-data for a sprite sheet.
func NewSheet ¶
NewSheet creates a new sprite sheet from the given image, with fixed width and height sprites.
type TextRenderer ¶
type TextRenderer struct {
// contains filtered or unexported fields
}
TextRenderer provides functions for rendering blocks of text from a sprite-sheet based font.
func NewTextRenderer ¶
func NewTextRenderer(sheet *Sheet, chars string, caseSensitive bool) *TextRenderer
NewTextRenderer creates a new TextRenderer that will use sprites from the given sheets corresponding to the set of characters. If caseSensitive is set to false then case is ignored when searching for a matching sprite.
func (*TextRenderer) Render ¶
func (t *TextRenderer) Render(image *ebiten.Image, x, y float64, text string)
Render renders the given text line by line starting at the given co-ordinates.
func (*TextRenderer) RenderWrapped ¶
func (t *TextRenderer) RenderWrapped(image *ebiten.Image, x, y float64, width float64, text string)
RenderWrapped renders the given text onto the image, starting at the given co-ordinates. Wrapping is done at the nearest space character; if a single word is longer than the maximum width then it will be cut mid-word.