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


148
149
150
# File 'lib/gd2/canvas.rb', line 148

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

Instance Method Details

#draw(image, mode) ⇒ Object


152
153
154
155
156
# File 'lib/gd2/canvas.rb', line 152

def draw(image, mode)
  ::GD2::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