Class: GD2::Canvas::Ellipse

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

Direct Known Subclasses

FilledEllipse

Instance Method Summary collapse

Constructor Details

#initialize(center, width, height) ⇒ Ellipse

Returns a new instance of Ellipse.



166
167
168
# File 'lib/gd2/canvas.rb', line 166

def initialize(center, width, height)
  @center, @width, @height = center, width, height
end

Instance Method Details

#draw(image, mode) ⇒ Object



170
171
172
173
174
# File 'lib/gd2/canvas.rb', line 170

def draw(image, mode)
  GD2FFI.send(:gdImageArc, image.image_ptr, @center.x.to_i, @center.y.to_i,
    @width.to_i, @height.to_i, 0, 360, mode.to_i)
  nil
end