|
"DTD/xhtml1-strict.dtd">
Return a new Imlib2::Polygon Examples: poly = Imlib2::Polygon.new points = [[10, 10], [20, 30], [15, 8], [6, 3], [12, 2]] poly = Imlib2::Polygon.new *points
Constructor for Imlib2::Polygon Accepts the same arguments as Imlib2::Polygon.new.
Add a point to the polygon Example: poly.add_point 123, 456
Return the bounding rectangle of the given polygon. Example: bounds = poly.bounds %q(x y w h).each_index { |i, v| puts v << ' = ' << bounds[i] }
Return the bounding rectangle of the given polygon. Example: bounds = poly.bounds %q(x y w h).each_index { |i, v| puts v << ' = ' << bounds[i] }
Does the given point lie within the polygon? Example: if poly.contains? 12, 5 puts 'yes' else puts 'no' end
Does the given point lie within the polygon? Example: if poly.contains? 12, 5 puts 'yes' else puts 'no' end |