Class: GD2::Canvas::Line
- Inherits:
-
Object
- Object
- GD2::Canvas::Line
- Defined in:
- lib/gd2/canvas.rb
Instance Method Summary collapse
- #draw(image, mode) ⇒ Object
-
#initialize(point1, point2) ⇒ Line
constructor
A new instance of Line.
Constructor Details
#initialize(point1, point2) ⇒ Line
Returns a new instance of Line.
56 57 58 |
# File 'lib/gd2/canvas.rb', line 56 def initialize(point1, point2) @p1, @p2 = point1, point2 end |
Instance Method Details
#draw(image, mode) ⇒ Object
60 61 62 63 64 |
# File 'lib/gd2/canvas.rb', line 60 def draw(image, mode) GD2FFI.send(:gdImageLine, image.image_ptr, @p1.x.to_i, @p1.y.to_i, @p2.x.to_i, @p2.y.to_i, mode.to_i) nil end |