Class: Kawaii::TextField
- Inherits:
-
Object
- Object
- Kawaii::TextField
- Defined in:
- lib/kawaii/text_field.rb
Instance Attribute Summary collapse
-
#font ⇒ Object
Returns the value of attribute font.
-
#position ⇒ Object
Returns the value of attribute position.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(font = nil, position = Kawaii::Vector2.new, text = "") ⇒ TextField
constructor
A new instance of TextField.
- #set_text(text) ⇒ Object
Constructor Details
#initialize(font = nil, position = Kawaii::Vector2.new, text = "") ⇒ TextField
Returns a new instance of TextField.
7 8 9 10 |
# File 'lib/kawaii/text_field.rb', line 7 def initialize font = nil, position = Kawaii::Vector2.new, text = "" # TODO: complete @font, @position, @text = font, position, text end |
Instance Attribute Details
#font ⇒ Object
Returns the value of attribute font.
5 6 7 |
# File 'lib/kawaii/text_field.rb', line 5 def font @font end |
#position ⇒ Object
Returns the value of attribute position.
5 6 7 |
# File 'lib/kawaii/text_field.rb', line 5 def position @position end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/kawaii/text_field.rb', line 5 def text @text end |
Instance Method Details
#draw ⇒ Object
17 18 19 20 |
# File 'lib/kawaii/text_field.rb', line 17 def draw # TODO: complete @font.draw(@position.x, @position.y, 0) end |
#set_text(text) ⇒ Object
12 13 14 15 |
# File 'lib/kawaii/text_field.rb', line 12 def set_text text @text = text # TODO: complete end |