font

package
v1.0.0-rc.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

func KeepInCache

func KeepInCache(dst *ebiten.Image)

We always keep the game character set in cache. This has to be repeated regularly as ebiten expires unused cache entries.

Types

type Face

type Face struct {
	Face    font.Face
	Outline font.Face
}

Face is an alias to font.Face so users do not need to import the font package.

var (
	ByName         = map[string]Face{}
	Centerprint    Face
	CenterprintBig Face
	DebugSmall     Face
	MenuBig        Face
	Menu           Face
	MenuSmall      Face
)

func (Face) BoundString

func (f Face) BoundString(str string) m.Rect

BoundString returns the bounding rectangle of the given text.

func (Face) Draw

func (f Face) Draw(dst draw.Image, str string, pos m.Pos, centerX bool, fg, bg color.Color)

Draw draws the given text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL