textureatlas

package
v0.0.0-...-4a525b6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Solid = '\uE000'

Solid is an item key for an item that is a single solid (opaque) pixel.

Variables

This section is empty.

Functions

This section is empty.

Types

type TextureAtlas

type TextureAtlas struct {
	Texture uint32
	// contains filtered or unexported fields
}

func NewTextureAtlas

func NewTextureAtlas(maxGlyphWidth, maxGlyphHeight int) *TextureAtlas

func (*TextureAtlas) AddItem

func (ta *TextureAtlas) AddItem(
	key string,
	pixels *[]byte,
	width, height int,
	topBearing, leftBearing float32,
) *TextureItem

func (*TextureAtlas) Item

func (ta *TextureAtlas) Item(key string) *TextureItem

type TextureItem

type TextureItem struct {

	// in pixels
	PixelLeft   int
	PixelRight  int
	PixelTop    int
	PixelBottom int

	// in pixels
	TopBearing  float32
	LeftBearing float32

	// in texture co-ordinates
	Left   float32
	Top    float32
	Right  float32
	Bottom float32
	// contains filtered or unexported fields
}

func (*TextureItem) PixelHeight

func (ti *TextureItem) PixelHeight() int

func (*TextureItem) PixelWidth

func (ti *TextureItem) PixelWidth() int

Jump to

Keyboard shortcuts

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