Draws to the framebuffer by calling a function that contains drawing instructions.
The parameter, callback
, is a function with the drawing instructions for the framebuffer. For example, calling myBuffer.draw(myFunction)
will call a function named myFunction()
to draw to the framebuffer. Doing so has the same effect as the following:
myBuffer.begin();
myFunction();
myBuffer.end();
Examples
Syntax
draw(callback)
Parameters
Related References
textToContours
Returns an array of arrays of points outlining a string of text written using the font.
textToModel
Converts text into a 3D model that can be rendered in WebGL mode.
textToPaths
Returns a flat array of path commands that describe the outlines of a string of text.
textToPoints
Returns an array of points outlining a string of text written using the font.