Method: Ruby2D::Canvas#fill_polygon
- Defined in:
- lib/ruby2d/canvas.rb
#fill_polygon(coordinates:, color: nil, colour: nil) ⇒ Object
Note:
Currently only supports convex polygons or simple polygons with one concave corner.
Note:
Supports per-vertex coloring, but the triangulation may change and affect the coloring.
Fill a polygon made up of N points.
258 259 260 261 262 263 264 |
# File 'lib/ruby2d/canvas.rb', line 258 def fill_polygon(coordinates:, color: nil, colour: nil) return if coordinates.nil? || coordinates.count < 6 || (color.nil? && colour.nil?) colors = colors_to_a(color || colour) ext_fill_polygon(coordinates, colors) update_texture if @update end |