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.
90
91
92
|
# File 'lib/gd2/canvas.rb', line 90
def initialize(points)
@points = points
end
|
Instance Method Details
#draw(image, mode) ⇒ Object
94
95
96
97
98
99
|
# File 'lib/gd2/canvas.rb', line 94
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 ⇒ Object
101
102
103
|
# File 'lib/gd2/canvas.rb', line 101
def draw_sym
:gdImagePolygon
end
|