Polygon.new: Difference between revisions

From GiderosMobile
Created page with "__NOTOC__ '''Available since:''' Gideros 2015.03.22<br/> '''Class:''' Clipper<br/> === Description === Creates a new clipping engine. <syntaxhighlight lang="lua"> (Clippe..."
 
No edit summary
 
Line 4: Line 4:


=== Description ===
=== Description ===
Creates a new clipping engine.
Creates an empty polygon.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
(Clipper) = Clipper.new()
(Polygon) = Polygon.new()
</syntaxhighlight>
</syntaxhighlight>


A Clipper combines subject and clip polygons and computes their boolean result.
=== Return values ===
'''Returns''' (Polygon) the new polygon<br/>


=== Return values ===
=== Example ===
'''Returns''' (Clipper) the new engine<br/>
<syntaxhighlight lang="lua">
local poly = Polygon.new()
poly:addPoint(0, 0)
poly:addPoint(100, 0)
poly:addPoint(100, 100)
poly:addPoint(0, 100)
</syntaxhighlight>


{{Clipper}}
{{Clipper}}

Latest revision as of 03:44, 14 November 2026

Available since: Gideros 2015.03.22
Class: Clipper

Description

Creates an empty polygon.

(Polygon) = Polygon.new()

Return values

Returns (Polygon) the new polygon

Example

local poly = Polygon.new()
poly:addPoint(0, 0)
poly:addPoint(100, 0)
poly:addPoint(100, 100)
poly:addPoint(0, 100)