Class GTriangle

class graphics.GTriangle(**keywords)

Instance represents a triangle in the GameView

The triangle is defined by the attribute points which is a list of 6 floats. It stores the three x-y pairs that define the triangle. The object uses fillcolor for the interior of the triangle and linecolor for its border.

Constructor: creates a new triangle.

param keywords:dictionary of keyword arguments

Precondition: See below.

To use the constructor for this class, you should provide it with a list of keyword arguments that initialize various attributes. For example, to create a triangle with the points (0,0), (0,2), and (1,1), use the constructor call

GTriangle(points=[0,0,0,2,1,1])

This class supports the same keywords as GObject. In addition, it supports the keyword points for the attribute of the same name.

The attributes size and pos are redundant in objects for this class. They are computed automatically from points.

This class is a subclass of GObject, and inherits all of its attributes and methods.

Attributes

These attributes are in addition to those from GObject.

points

Property that represents a list.

Only lists are allowed. Tuple or any other classes are forbidden.

height

This attribute is computed automatically from the attribute points

width

This attribute is computed automatically from the attribute points

x

This attribute is computed automatically from the attribute points

y

This attribute is computed automatically from the attribute points

Table Of Contents

Previous topic

Class GLine

Next topic

Class GRectangle

This Page