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


167
168
169
170
171
172
# File 'lib/gd2/canvas.rb', line 167

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

Instance Method Details

#draw(image, color) ⇒ Object


174
175
176
# File 'lib/gd2/canvas.rb', line 174

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