Skip to content

GPolygon extends GObject

Factory Functions

function GPolygon([x=0, y=0])
Creates an empty GPolygon. The object's x and y coordinates can also be specified — if left unspecified, defaults to 0, 0.

Methods

function GPolygon::addVertex(x, y)
Adds a vertex at (x, y) relative to the polygon's origin.
function GPolygon::addEdge(dx, dy)
Adds a vertex at wherever the last point was placed (or 0, 0 if this is the first), shifted by dx and dy.
function GPolygon::addPolarEdge(r, theta)
Adds a vertex at wherever the last point was placed (or, 0, 0 if this is the first), shifted by r units in the direction theta. theta is measured in degrees counterclockwise from the +x axis.
See Also: GObject::movePolar
function GPolygon::getCurrentPoint()
Returns: A GPoint, representing the last point that was added to this GPolygon.
See Also: GPoint