Class: Nuklear::UI::Label
- Includes:
- TextAlign
- Defined in:
- lib/nuklear/ui/label.rb
Instance Attribute Summary collapse
-
#align ⇒ Object
Returns the value of attribute align.
-
#color ⇒ Object
Returns the value of attribute color.
-
#text ⇒ Object
Returns the value of attribute text.
-
#wrap ⇒ Object
Returns the value of attribute wrap.
Instance Method Summary collapse
-
#initialize(text, color: nil, wrap: false, align: :left, **options) ⇒ Label
constructor
A new instance of Label.
- #to_command ⇒ Object
Methods included from TextAlign
Methods inherited from Base
Methods included from Enableable
#disable, #disabled=, #disabled?, #enable, #enabled=, #enabled?
Methods included from Events
#event_listeners_for, #on, #trigger
Constructor Details
#initialize(text, color: nil, wrap: false, align: :left, **options) ⇒ Label
Returns a new instance of Label.
8 9 10 11 12 13 14 |
# File 'lib/nuklear/ui/label.rb', line 8 def initialize(text, color: nil, wrap: false, align: :left, **) super(**) self.text = text self.color = color self.wrap = wrap self.align = align end |
Instance Attribute Details
#align ⇒ Object
Returns the value of attribute align.
6 7 8 |
# File 'lib/nuklear/ui/label.rb', line 6 def align @align end |
#color ⇒ Object
Returns the value of attribute color.
6 7 8 |
# File 'lib/nuklear/ui/label.rb', line 6 def color @color end |
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/nuklear/ui/label.rb', line 6 def text @text end |
#wrap ⇒ Object
Returns the value of attribute wrap.
6 7 8 |
# File 'lib/nuklear/ui/label.rb', line 6 def wrap @wrap end |
Instance Method Details
#to_command ⇒ Object
16 17 18 |
# File 'lib/nuklear/ui/label.rb', line 16 def to_command [:ui_label, text, color, wrap, align_as_flags(align)] end |