Difference between revisions of "SHIP:Sail:draw"

From Serious Documentation
Jump to: navigation, search
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
{{SailFuncTableStart|}}<onlyinclude>
 
{{SailFuncTableStart|}}<onlyinclude>
|{{SailFunc|draw}}||No return value||style="text-align:center;"|v5.0||Causes run-time drawing in a {{Node|canvas}} {{v5}}</onlyinclude>
+
|{{SailFunc|draw}}||No return value||style="text-align:center;"|v5.0||Causes run-time drawing in a {{Node|canvas}}</onlyinclude>
 
|}
 
|}
 
== See Also: ==
 
== See Also: ==

Revision as of 11:58, 14 October 2016

Function Returns Introduced Description
draw No return value v5.0 Causes run-time drawing in a canvas

See Also:

Prototype

draw(Node canvas, draw-command [, arg, arg, ...], ...);

Parameters/Return Value

Parameter Data Type Description
canvas Node Canvas to draw on
draw-command draw-command Commands to execute
... draw-command Multiple draw-commands can be entered in a single command
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(PENCOLOR colorBlk, MOVEABSXY, 0, 0); Pen color is black, moved to 0,0 coord