Documentation Index | From module rabbyt.primitives.

Quad

Quad(definition)

Quad provides a convenient representation of a quadrilateral. This is useful for specifying Sprite.shape and Sprite.tex_shape.

definition can be in a number of forms:

Quad has a number of properties to make modifying it easier. The width and height properties will scale the vertexes from the center, but all other properties will move all vertexes the same amount. (e.g., assigning to left will move the right side as well: the width says the same.)

Properties

bottom

The y coordinate of the bottom-most point.

height

The height between the top-most and bottom-most vertexes.

Assigning to this property will scale all vertexes from the center. So the y property will remain the same, but top and bottom properties will change.

left

The x coordinate of the left-most point.

right

The x coordinate of the right-most point.

top

The y coordinate of the top-most point.

width

The width between the left-most and right-most vertexes.

Assigning to this property will scale all vertexes from the center. So the x property will remain the same, but left and right properties will change.

x

Halfway between left and right.

xy

The coordinates of the center of the Quad.

y

Halfway between top and bottom.