Class: Kawaii::TextField

Inherits:
Object
  • Object
show all
Defined in:
lib/kawaii/text_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fontObject

Returns the value of attribute font.



5
6
7
# File 'lib/kawaii/text_field.rb', line 5

def font
  @font
end

#positionObject

Returns the value of attribute position.



5
6
7
# File 'lib/kawaii/text_field.rb', line 5

def position
  @position
end

#textObject

Returns the value of attribute text.



5
6
7
# File 'lib/kawaii/text_field.rb', line 5

def text
  @text
end

Instance Method Details

#drawObject



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