class GD2::Canvas::Polygon

Public Class Methods

new(points) click to toggle source
# File lib/gd2/canvas.rb, line 71
def initialize(points)
  @points = points
end

Public Instance Methods

draw(image, mode) click to toggle source
# File lib/gd2/canvas.rb, line 75
def draw(image, mode)
  ::GD2::GD2FFI.send(draw_sym, image.image_ptr, @points.map { |point|
    point.coordinates.pack('i_i_')
  }.join(''), @points.length, mode.to_i)
  nil
end
draw_sym() click to toggle source
# File lib/gd2/canvas.rb, line 82
def draw_sym
  :gdImagePolygon
end