Method: Processing::GraphicsContext#shape
- Defined in:
- lib/processing/graphics_context.rb
#shape(img, a, b) ⇒ nil #shape(img, a, b, c, d) ⇒ nil Also known as: drawShape
Draws a shape.
The parameters a, b, c, and d are determined by shapeMode().
1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 |
# File 'lib/processing/graphics_context.rb', line 1808 def shape(shp, a = 0, b = 0, c = nil, d = nil) assertDrawing__ return nil unless shp.isVisible drawWithTexture__ do |_| if c || d || @shapeMode__ != CORNER x, y, w, h = toXYWH__ @shapeMode__, a, b, c || shp.width, d || shp.height shp.draw__ @painter__, x, y, w, h else shp.draw__ @painter__, a, b end end nil end |