Haiku API Bindings
Polygon
Not logged in

Documentation | InterfaceKit | Polygon

SYNOPSIS

Perl

use HaikuR1::Polygon;

my $polygon = HaikuR1::Polygon->new()
$polygon->AddPoints([ [10,10], [20,20] ]);

Python

from HaikuR1.InterfaceKit import Polygon

polygon = Polygon()
polygon.AddPoints([ [10,10], [20,20] ])

DESCRIPTION

Exposes the BPolygon object.

For more information on Polygon, see the Be Book class description, the Be Book overview, and the Haiku Book class description.

METHODS

Constructor

Creates a Polygon.

Perl

HaikuR1::Polygon->new($points);
HaikuR1::Polygon->new($other);
HaikuR1::Polygon->newEmpty();

Python

Polygon(points)
Polygon(other)
Polygon.Empty()

copy

Copies the contents of another object into this object.

Perl

$polygon->copy($copy_from);

Python

polygon.copy(copy_from)

AddPoints

Adds the given points to the Polygon.

Perl

$polygon->AddPoints($points);

Python

polygon.AddPoints(points)

CountPoints

Returns the number of points in the Polygon.

Perl

$polygon->CountPoints();

Python

polygon.CountPoints()

Frame

Returns the smallest Rect that contains the Polygon.

Perl

$polygon->Frame();

Python

polygon.Frame()

MapTo

Maps the Ploygon from the source rectangle to the destination rectangle.

Perl

$polygon->MapTo($srcRect, $dstRect);

Python

polygon.MapTo(srcRect, dstRect)

PrintToStream

Prints the contents of the Polygon to standard out.