class Gosuplus::GUI::Text

Attributes

body[RW]

Public Class Methods

new(text, font, position = nil) click to toggle source
# File lib/Gosuplus/gui/text.rb, line 7
def initialize(text, font, position = nil)
  position = Vec2.new(0, 0) if position.is_a? NilClass

  @text, @font = text, font
  @body = Body.new(position, font.text_width(text), font.height)
end

Public Instance Methods

draw() click to toggle source
# File lib/Gosuplus/gui/text.rb, line 15
def draw; @font.draw(@text, @body.position.x, @body.position.y, 500); end
text=(new_text) click to toggle source
# File lib/Gosuplus/gui/text.rb, line 17
def text=(new_text)
  @text = new_text
  @width = @font.text_width(text)
end
update() click to toggle source
# File lib/Gosuplus/gui/text.rb, line 14
def update; end