Class GRectangle

This class represents a solid rectangle to draw on the screen. It is a subclass of GObject, and inherits all of its attributes and methods.

Constructor

class game2d.grectangle.GRectangle(**keywords)

A class representing a (potentially) solid rectangle.

As with GObject, the attributes x and y refer to the center of the rectangle. This is so that when you rotate the rectangle, it spins about the center.

The interior (fill) color of this rectangle is fillcolor. If this value is None, then the rectangle is not solid. The color linecolor is the color of the border.

The only new property for this class is linewidth, which controls the width of the border around the rectangle. For all other properties, see the documentation for GObject.

Attributes

This class has all of the attributes of GObject. In addition, it has the following new attributes.

GRectangle.linewidth

The width of the exterior line of this shape.

Setting this to 0 means that the rectangle has no border.

invariant: Value must be an int or float >= 0.

Methods

This class does not have any methods beyond those defined in GObject.