Graphene.Quad

Fields

Name

Type

Access

Description

points

[Graphene.Point]

r

Methods

class

alloc ()

bounds ()

contains (p)

free ()

get_point (index_)

init (p1, p2, p3, p4)

init_from_points (points)

init_from_rect (r)

Details

class Graphene.Quad

A 4 vertex quadrilateral, as represented by four Graphene.Point.

The contents of a Graphene.Quad are private and should never be accessed directly.

New in version 1.0.

classmethod alloc()
Returns:

the newly created Graphene.Quad instance

Return type:

Graphene.Quad

Allocates a new Graphene.Quad instance.

The contents of the returned instance are undefined.

New in version 1.0.

bounds()
Returns:

return location for a Graphene.Rect

Return type:

r: Graphene.Rect

Computes the bounding rectangle of self and places it into r.

New in version 1.0.

contains(p)
Parameters:

p (Graphene.Point) – a Graphene.Point

Returns:

true if the point is inside the Graphene.Quad

Return type:

bool

Checks if the given Graphene.Quad contains the given Graphene.Point.

New in version 1.0.

free()

Frees the resources allocated by Graphene.Quad.alloc()

New in version 1.0.

get_point(index_)
Parameters:

index (int) – the index of the point to retrieve

Returns:

a Graphene.Point

Return type:

Graphene.Point

Retrieves the point of a Graphene.Quad at the given index.

New in version 1.0.

init(p1, p2, p3, p4)
Parameters:
Returns:

the initialized Graphene.Quad

Return type:

Graphene.Quad

Initializes a Graphene.Quad with the given points.

New in version 1.0.

init_from_points(points)
Parameters:

points ([Graphene.Point]) – an array of 4 Graphene.Point

Returns:

the initialized Graphene.Quad

Return type:

Graphene.Quad

Initializes a Graphene.Quad using an array of points.

New in version 1.2.

init_from_rect(r)
Parameters:

r (Graphene.Rect) – a Graphene.Rect

Returns:

the initialized Graphene.Quad

Return type:

Graphene.Quad

Initializes a Graphene.Quad using the four corners of the given Graphene.Rect.

New in version 1.0.