Class: GD2::Canvas::Rectangle
- Inherits:
-
Object
- Object
- GD2::Canvas::Rectangle
- Defined in:
- lib/gd2/canvas.rb
Direct Known Subclasses
Instance Method Summary collapse
- #draw(image, mode) ⇒ Object
- #draw_sym ⇒ Object
-
#initialize(point1, point2) ⇒ Rectangle
constructor
A new instance of Rectangle.
Constructor Details
#initialize(point1, point2) ⇒ Rectangle
Returns a new instance of Rectangle.
57 58 59 |
# File 'lib/gd2/canvas.rb', line 57 def initialize(point1, point2) @p1, @p2 = point1, point2 end |
Instance Method Details
#draw(image, mode) ⇒ Object
61 62 63 64 |
# File 'lib/gd2/canvas.rb', line 61 def draw(image, mode) SYM[draw_sym].call(image.image_ptr, @p1.x, @p1.y, @p2.x, @p2.y, mode) nil end |
#draw_sym ⇒ Object
66 67 68 |
# File 'lib/gd2/canvas.rb', line 66 def draw_sym :gdImageRectangle end |