Class: RILabel
- Inherits:
-
Object
- Object
- RILabel
- Defined in:
- lib/RIUI/RILabel.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#font ⇒ Object
Returns the value of attribute font.
-
#size ⇒ Object
Returns the value of attribute size.
-
#text ⇒ Object
Returns the value of attribute text.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ RILabel
constructor
A new instance of RILabel.
- #mouse_down_actions(x, y) ⇒ Object
- #mouse_move_actions(x, y) ⇒ Object
- #mouse_up_actions ⇒ Object
- #setText(opts = [:text]) ⇒ Object
- #update_actions ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ RILabel
Returns a new instance of RILabel.
3 4 5 6 7 8 9 10 11 |
# File 'lib/RIUI/RILabel.rb', line 3 def initialize(opts = {}) @x = opts[:x] || 0 @y = opts[:y] || 0 @font = opts[:font] || '' @size = opts[:size] || 20 @color = opts[:color] || 'black' @text = opts[:text] || 'RIUI Label' @label = Text.new(x: @x, y: @y, font: @font, size: @size, color: @color, text: @text) end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
2 3 4 |
# File 'lib/RIUI/RILabel.rb', line 2 def color @color end |
#font ⇒ Object
Returns the value of attribute font.
2 3 4 |
# File 'lib/RIUI/RILabel.rb', line 2 def font @font end |
#size ⇒ Object
Returns the value of attribute size.
2 3 4 |
# File 'lib/RIUI/RILabel.rb', line 2 def size @size end |
#text ⇒ Object
Returns the value of attribute text.
2 3 4 |
# File 'lib/RIUI/RILabel.rb', line 2 def text @text end |
#x ⇒ Object
Returns the value of attribute x.
2 3 4 |
# File 'lib/RIUI/RILabel.rb', line 2 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
2 3 4 |
# File 'lib/RIUI/RILabel.rb', line 2 def y @y end |
Instance Method Details
#mouse_down_actions(x, y) ⇒ Object
19 |
# File 'lib/RIUI/RILabel.rb', line 19 def mouse_down_actions(x, y); end |
#mouse_move_actions(x, y) ⇒ Object
20 |
# File 'lib/RIUI/RILabel.rb', line 20 def mouse_move_actions(x, y); end |
#mouse_up_actions ⇒ Object
18 |
# File 'lib/RIUI/RILabel.rb', line 18 def mouse_up_actions; end |
#setText(opts = [:text]) ⇒ Object
12 13 14 15 16 |
# File 'lib/RIUI/RILabel.rb', line 12 def setText(opts = [:text]) @text = opts[:text] @label.remove @label = Text.new(x: @x, y: @y, font: @font, size: @size, color: @color, text: @text) end |
#update_actions ⇒ Object
17 |
# File 'lib/RIUI/RILabel.rb', line 17 def update_actions; end |