Class: GD2::Canvas::Polygon
- Inherits:
-
Object
- Object
- GD2::Canvas::Polygon
show all
- Defined in:
- lib/gd2/canvas.rb
Instance Method Summary
collapse
Constructor Details
#initialize(points) ⇒ Polygon
Returns a new instance of Polygon.
89
90
91
|
# File 'lib/gd2/canvas.rb', line 89
def initialize(points)
@points = points
end
|
Instance Method Details
#draw(image, mode) ⇒ Object
93
94
95
96
97
98
|
# File 'lib/gd2/canvas.rb', line 93
def draw(image, mode)
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 ⇒ Object
100
101
102
|
# File 'lib/gd2/canvas.rb', line 100
def draw_sym
:gdImagePolygon
end
|