SHIP:Sail:draw

From Serious Documentation
Jump to: navigation, search
Function Returns Introduced Description
draw v5.0 Causes run-time drawing in a canvas

See Also:

Prototype

draw(Node canvas, drawCmd [, arg, arg, ...], ...);

Parameters/Return Value

Parameter Data Type Description
canvas Node Canvas to draw on
drawCmd drawCmd Commands to execute
... drawCmd Multiple drawCmds can be entered in a single draw function
Return No return

Detailed Description

Although you would expect many of these commands to use Dimension for their arguments, note how many use Float. The pen position and orientation is maintained by the system in a floating point coordinate in order to retain drawing precision across numerous relative movements, for example drawing a star or box using a series of MOVE and ROTATE commands, such that the ending spot joins well with the starting spot.

Examples

Example Results Notes
draw(homeCanvas, CLEAR, colorBg); Clear canvas to colorBg
draw(homeCanvas, PENCOLOR colorBlk, MOVEABSXY, 0, 0); Pen color is black, moved to 0,0 coord