tiles

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: ISC Imports: 6 Imported by: 1

Documentation

Overview

Package tiles provides common utilities for manipulation of graphical tiles, such as drawing fonts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Drawer

type Drawer struct {
	// contains filtered or unexported fields
}

Drawer can be used to draw a text rune on an image of appropriate size to be used as a tile. See the example in examples/messages/tiles.go for an example of use.

func NewDrawer

func NewDrawer(face font.Face) (*Drawer, error)

NewDrawer returns a new tile Drawer given a monospace font face.

func (*Drawer) Draw

func (d *Drawer) Draw(r rune, fg, bg image.Image) image.Image

Draw draws a rune and returns the produced image with foreground and background colors given by images fg and bg.

func (*Drawer) Size

func (d *Drawer) Size() gruid.Point

Size returns the size of drawn tiles, in pixel points.

Jump to

Keyboard shortcuts

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