cdCanvasBegin
| Definition: |
include pGUI.e
cdCanvasBegin(cdCanvas canvas, integer mode) |
| Description: |
Starts defining a polygon to be drawn (or filled) according to the mode: CD_CLOSED_LINES, CD_OPEN_LINES, CD_FILL, CD_CLIP, CD_REGION or CD_BEZIER.
Bezier Lines
Do not create embedded polygons, that is, do not call function cdCanvasBegin twice without a call to cdCanvasEnd in between. |
| pwa/p2js: | Supported. Note that on desktop/Phix, cdCanvasEnd() in effect implies a cdCanvasBegin() call for subsequent cdCanvasVertex() (quite probably more by accident or convenience than deliberate design), whereas under pwa/p2js an explicit call to cdCanvasBegin() is required each time, otherwise all the vertices end up being accumulative and intermeshed (which might actually have been entirely intentional for the HTML5 canvas primitives this routine wraps on that platform). Should it become necessary I may reconsider adding various flags (etc) to mimic desktop/Phix more accurately, or perhaps go the other way and start adding HTML5 capabilities to the desktop. |
| Comments: |
The functions cdCanvasBegin, cdCanvasVertex and
cdCanvasEnd are used for many situations. cdCanvasBegin is called once, cdCanvasVertex can be called many times, and cdCanvasEnd is called once to actually do something. If you call cdCanvasBegin again before cdCanvasEnd the process is restarted, except for cdCanvasBegin(CD_REGION) that can contain one or more polygons inside. |
| See Also: | cdCanvasVertex, cdCanvasEnd |