Graphene.Quad¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
points |
r |
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
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:
Computes the bounding rectangle of self and places it into r.
New in version 1.0.
- contains(p)¶
- Parameters:
p (
Graphene.Point
) – aGraphene.Point
- Returns:
true
if the point is inside theGraphene.Quad
- Return type:
Checks if the given
Graphene.Quad
contains the givenGraphene.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:
- Return type:
Retrieves the point of a
Graphene.Quad
at the given index.New in version 1.0.
- init(p1, p2, p3, p4)¶
- Parameters:
p1 (
Graphene.Point
) – the first point of the quadrilateralp2 (
Graphene.Point
) – the second point of the quadrilateralp3 (
Graphene.Point
) – the third point of the quadrilateralp4 (
Graphene.Point
) – the fourth point of the quadrilateral
- Returns:
the initialized
Graphene.Quad
- Return type:
Initializes a
Graphene.Quad
with the given points.New in version 1.0.
- init_from_points(points)¶
- Parameters:
points ([
Graphene.Point
]) – an array of 4Graphene.Point
- Returns:
the initialized
Graphene.Quad
- Return type:
Initializes a
Graphene.Quad
using an array of points.New in version 1.2.
- init_from_rect(r)¶
- Parameters:
r (
Graphene.Rect
) – aGraphene.Rect
- Returns:
the initialized
Graphene.Quad
- Return type:
Initializes a
Graphene.Quad
using the four corners of the givenGraphene.Rect
.New in version 1.0.