Class: GD2::Canvas::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/gd2/canvas.rb

Instance Method Summary collapse

Constructor Details

#initialize(font, point, angle, string) ⇒ Text

Returns a new instance of Text.



185
186
187
188
189
190
# File 'lib/gd2/canvas.rb', line 185

def initialize(font, point, angle, string)
  @font = font
  @point = point
  @angle = angle
  @string = string
end

Instance Method Details

#draw(image, color) ⇒ Object



192
193
194
# File 'lib/gd2/canvas.rb', line 192

def draw(image, color)
  @font.draw(image.image_ptr, @point.x, @point.y, @angle, @string, color)
end