ElixirQuake.Text (elixir_quake v0.1.0)

Copy Markdown View Source

Text in Quake's console font (conchars, sixteen rows of sixteen 8 by 8 characters), drawn onto a Cauldron3D.Frame. Colour 0 of the font is see-through.

frame = ElixirQuake.Text.draw(frame, "You got the shells", {8, 8})

Summary

Functions

Lines of text as one frame width wide, each centred, on colour clear, for drawing over a picture.

text with its top left at {x, y}; :alternate draws it in the font's other colour.

Character code of the font, as an 8 by 8 texture.

Functions

centred(lines, width, clear \\ 0)

@spec centred([String.t()], pos_integer(), byte()) :: Cauldron3D.Frame.t()

Lines of text as one frame width wide, each centred, on colour clear, for drawing over a picture.

draw(frame, text, arg, opts \\ [])

text with its top left at {x, y}; :alternate draws it in the font's other colour.

glyph(font, code)

@spec glyph(Cauldron3D.Texture.t() | nil, 0..255) :: Cauldron3D.Texture.t()

Character code of the font, as an 8 by 8 texture.