Font:getVertices

Edit

Returns a table of vertices for a piece of text, along with a Material to use when rendering it. The Material returned by this function may not be the same if the Font's texture atlas needs to be recreated with a bigger size to make room for more glyphs.

vertices, material = Font:getVertices(halign, valign)

Arguments

NameTypeDescription
halignHorizontalAlign The horizontal align.
valignVerticalAlign The vertical align.

Returns

NameTypeDescription
verticestable The table of vertices. See below for the format of each vertex.
materialMaterial A Material to use when rendering the vertices.

Notes

Each vertex is a table of 4 floating point numbers with the following data:

{ x, y, u, v }

These could be placed in a vertex buffer using the following buffer format:

{ 'vec2:VertexPosition', 'vec2:VertexUV' }

See also