class

Opal::UI::Digits

Inherits Opal::UI::Element < Opal::UI::Themable < Reference < Object

Large 3x5 block character digital number and clock display inspired by Python Textual's Digits. Renders numbers 0-9, colon :, dash -, plus +, slash /, and periods in bold block characters.

Constants

GLYPH_3X5 = {'0' => ["█▀█", "█ █", "█ █", "█ █", "▀▀▀"], '1' => [" █ ", "██ ", " █ ", " █ ", "▀▀▀"], '2' => ["█▀█", " █", "█▀█", "█ ", "▀▀▀"], '3' => ["█▀█", " █", " ▀█", " █", "▀▀▀"], '4' => ["█ █", "█ █", "▀▀█", " █", " ▀"], '5' => ["█▀█", "█ ", "▀▀█", " █", "▀▀▀"], '6' => ["█▀█", "█ ", "█▀█", "█ █", "▀▀▀"], '7' => ["▀▀█", " █", " █", " █", " ▀"], '8' => ["█▀█", "█ █", "█▀█", "█ █", "▀▀▀"], '9' => ["█▀█", "█ █", "▀▀█", " █", "▀▀▀"], ':' => [" ", "●", " ", "●", " "], '.' => [" ", " ", " ", " ", "▀"], '-' => [" ", " ", "▀▀▀", " ", " "], '+' => [" ", " █ ", "▀█▀", " █ ", " "], '/' => [" █", " █", " █ ", "█ ", "█ "], '%' => ["▀ █", " █", " █ ", "█ ", "█ ▀"], ' ' => [" ", " ", " ", " ", " "]}

Constructors

new(text : String, fg : Color | Symbol | String = :bright_cyan, bg : Color | Symbol | String = Color.none, bold : Bool = true)
Source

Instance methods

bg=(bg : Color)
Source
bold=(bold : Bool)
Source
bold?
Source
fg=(fg : Color)
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
text
Source
text=(text : String)
Source