Scenic.Primitive.Text (Scenic v0.11.0-beta.0) View Source

Draw text on the screen.

Data

text

The data for a Text primitive is a bitstring

  • text - the text to draw

Styles

This primitive recognizes the following styles

  • hidden - show or hide the primitive
  • fill - fill in the area of the text. Only solid colors!
  • font - name (or key) of font to use
  • font_size - point size of the font
  • font_blur - option to blur the characters
  • text_align - alignment of lines of text
  • text_height - spacing between lines of text

Usage

You should add/modify primitives via the helper functions in Scenic.Primitives

graph
  |> text( "Some example text", fill: :green, font: :roboto_mono, font_size: 64 )

Link to this section Summary

Functions

Returns a list of styles recognized by this primitive.

Link to this section Types

Specs

styles_t() :: [
  :hidden
  | :scissor
  | :font
  | :font_size
  | :line_height
  | :text_align
  | :text_base
  | :line_height
]

Specs

t() :: String.t()

Link to this section Functions

Specs

valid_styles() :: styles_t()

Returns a list of styles recognized by this primitive.