From 7b52cc13af4e85f1ca2deb6b6c77de9c95ea0dcf Mon Sep 17 00:00:00 2001 From: scuri Date: Fri, 17 Oct 2008 06:10:33 +0000 Subject: First commit - moving from LuaForge to SourceForge --- html/en/func/polygon.html | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 html/en/func/polygon.html (limited to 'html/en/func/polygon.html') diff --git a/html/en/func/polygon.html b/html/en/func/polygon.html new file mode 100644 index 0000000..4e18664 --- /dev/null +++ b/html/en/func/polygon.html @@ -0,0 +1,87 @@ + + + + + + +Polygons + + + + + +

Open, Closed and Filled Polygons,
+Bezier Lines and
+Regions Creation

+ +

The functions cdBegin, + cdVertex and + cdEnd are use for many situations. + cdBegin is called once, + cdVertex can be called many + times, and cdEnd is called once + to actually do something. If you call cdBegin + again before cdEnd the process is + restarted, except for cdBegin(CD_REGION) + that can contains one or more polygons inside.

+ +
+
void cdCanvasBegin(cdCanvas* canvas, int mode); [in C]
+
+canvas:Begin(mode: number) [in Lua]
+ +

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. + Do not create embedded polygons, that is, do not call function + cdBegin twice without a call to + cdEnd in between.

+ + +

Open, Closed and Filled Polygons
+

+

Bezier Lines
+

+
void cdCanvasVertex(cdCanvas* canvas, int x, int y); [in C]
+void cdfCanvasVertex(cdCanvas* canvas, double x, double y); [in C]
+void wdCanvasVertex(cdCanvas* canvas, double x, double y); (WC) [in C]
+
+canvas:Vertex(x, y: number) [in Lua]
+canvas:wVertex(x, y: number) (WC) [in Lua]
+ +

Adds a vertex to the polygon definition.

+ +
void cdCanvasEnd(cdCanvas* canvas); [in C]
+
+canvas:End() [in Lua]
+ +

Ends the polygon's definition and draws it.

+ + + + + -- cgit v1.2.3