View on GitHub

3DreamEngine

3DreamEngine is an *awesome* 3d engine for LÖVE.

GlyphAtlas

A glyph atlas to be used in text rendering

Constructors

GlyphAtlas:newGlyphAtlas(margin)

Creates new glyph atlas

Arguments

margin (number) Size of margin around each character. You need at least 2^mipmapping levels of margin for no bleeding artifacts.

Returns

(GlyphAtlas)


Methods

GlyphAtlas:renderCharacters(characters)

Render the characters to the atlas

Arguments

characters (string[])


GlyphAtlas:getAllCharacters()

Get all characters contained in the font


GlyphAtlas:splitCharacters(str)

Split the utf-8 string into characters

Arguments

str (string)


GlyphAtlas:getGlyph(character)

Renders that glyph if not already rendered and returns it

Arguments

character (string)

Returns

(Glyph)


GlyphAtlas:getDimensions()

Returns the current atlas dimensions in pixels

Returns

(number, number)


GlyphAtlas:getTexture()

Gets the texture, updates it if the atlas was dirty

Returns

(Texture)


GlyphAtlas:getCachedSpacing(glyph)

Arguments

glyph (any)


GlyphAtlas:getCachedKerning(prevGlyph, glyph)

Arguments

prevGlyph (any)

glyph (any)


GlyphAtlas:getNewCodePoints()

Returns

(MaterializedCodepoints)


GlyphAtlas:getWrap(text, wrapLimit)

Wraps a materialized text into lines

Arguments

text (MaterializedText)

wrapLimit (number)


GlyphAtlas:getCodepointWrap(codepoints, wrapLimit)

Wraps the given materialized code points and returns a list of line widths and a list of materialized code points.

Arguments

codepoints (MaterializedCodepoints)

wrapLimit (number)

Returns

(number[], MaterializedCodepoints[])