Class: Text
- Inherits:
-
Object
- Object
- Text
- Defined in:
- lib/r2d/text.rb
Overview
text.rb
Instance Attribute Summary collapse
-
#c ⇒ Object
readonly
Returns the value of attribute c.
-
#color ⇒ Object
Returns the value of attribute color.
-
#content ⇒ Object
Returns the value of attribute content.
-
#h ⇒ Object
readonly
Returns the value of attribute h.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #adapter ⇒ Object
- #add ⇒ Object
-
#initialize(x = 0, y = 0, h = 50, content = "Hello World!", c = "white", visible = true) ⇒ Text
constructor
A new instance of Text.
- #remove ⇒ Object
Constructor Details
#initialize(x = 0, y = 0, h = 50, content = "Hello World!", c = "white", visible = true) ⇒ Text
Returns a new instance of Text.
8 9 10 11 12 13 |
# File 'lib/r2d/text.rb', line 8 def initialize(x=0, y=0, h=50, content="Hello World!", c="white", visible=true) @x, @y, @h, @content, @color = x, y, h, content, c update_color(c) @text = R2D::Adapters.text(h) if visible then add end end |
Instance Attribute Details
#c ⇒ Object (readonly)
Returns the value of attribute c.
6 7 8 |
# File 'lib/r2d/text.rb', line 6 def c @c end |
#color ⇒ Object
Returns the value of attribute color.
6 7 8 |
# File 'lib/r2d/text.rb', line 6 def color @color end |
#content ⇒ Object
Returns the value of attribute content.
6 7 8 |
# File 'lib/r2d/text.rb', line 6 def content @content end |
#h ⇒ Object (readonly)
Returns the value of attribute h.
6 7 8 |
# File 'lib/r2d/text.rb', line 6 def h @h end |
#x ⇒ Object
Returns the value of attribute x.
5 6 7 |
# File 'lib/r2d/text.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'lib/r2d/text.rb', line 5 def y @y end |