Documentation
¶
Index ¶
- Constants
- func MakeGPUSpriteMap(font *LbxFont) (*ebiten.Image, int, int, int, int)
- func MakeGPUSpriteMapWithPalette(font *LbxFont, palette color.Palette) (*ebiten.Image, int, int, int, int)
- type Font
- func (font *Font) CreateWrappedText(maxWidth float64, scale float64, text string) WrappedText
- func (font *Font) Height() int
- func (font *Font) MeasureTextWidth(text string, scale float64) float64
- func (font *Font) Print(image *ebiten.Image, x float64, y float64, scale float64, ...)
- func (font *Font) PrintCenter(image *ebiten.Image, x float64, y float64, scale float64, ...)
- func (font *Font) PrintDropShadow(destination *ebiten.Image, x float64, y float64, scale float64, ...)
- func (font *Font) PrintOptions(image *ebiten.Image, x float64, y float64, scale float64, ...)
- func (font *Font) PrintOutline(destination *ebiten.Image, edgeShader *ebiten.Shader, x float64, y float64, ...)
- func (font *Font) PrintRight(image *ebiten.Image, x float64, y float64, scale float64, ...)
- func (font *Font) PrintWrap(image *ebiten.Image, x float64, y float64, maxWidth float64, scale float64, ...)
- func (font *Font) PrintWrapCenter(image *ebiten.Image, x float64, y float64, maxWidth float64, scale float64, ...)
- func (font *Font) RenderWrapped(image *ebiten.Image, x float64, y float64, wrapped WrappedText, ...)
- type FontJustify
- type FontOptions
- type Glyph
- type LbxFont
- type WrappedText
Constants ¶
View Source
const NewLine = 0x14
FIXME: put this somewhere else
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Font ¶
type Font struct { Image *ebiten.Image GlyphWidth int GlyphHeight int Rows int Columns int Glyphs []Glyph // contains filtered or unexported fields }
func MakeOptimizedFont ¶
func (*Font) CreateWrappedText ¶
func (font *Font) CreateWrappedText(maxWidth float64, scale float64, text string) WrappedText
precompute an object that can be used to render a wrapped string
func (*Font) MeasureTextWidth ¶
func (*Font) Print ¶
func (font *Font) Print(image *ebiten.Image, x float64, y float64, scale float64, colorScale ebiten.ColorScale, text string)
print the text with no border/outline
func (*Font) PrintCenter ¶
func (*Font) PrintDropShadow ¶
func (*Font) PrintOptions ¶
func (*Font) PrintOutline ¶
func (font *Font) PrintOutline(destination *ebiten.Image, edgeShader *ebiten.Shader, x float64, y float64, scale float64, colorScale ebiten.ColorScale, text string)
draws a 1px outline around each glyph the edge shader should be shaders.ShaderEdgeGlow, although it should probably be changed to shaders.ShaderOutline just use PrintDropShadow for now
func (*Font) PrintRight ¶
func (*Font) PrintWrapCenter ¶
func (*Font) RenderWrapped ¶
func (font *Font) RenderWrapped(image *ebiten.Image, x float64, y float64, wrapped WrappedText, colorScale ebiten.ColorScale, options FontOptions)
type FontJustify ¶
type FontJustify int
const ( FontJustifyLeft FontJustify = iota FontJustifyCenter FontJustifyRight )
type FontOptions ¶
type FontOptions struct { // left is default Justify FontJustify // no shadow is default DropShadow bool // if DropShadow is true, this is the color of the shadow, which defaults to black ShadowColor color.Color }
for rendering, to specify justification, wrapping and shadows
type WrappedText ¶
func (*WrappedText) Clear ¶
func (text *WrappedText) Clear()
Click to show internal directories.
Click to hide internal directories.