Class GLine

class graphics.GLine(**keywords)

Instance represents a sequence of line segments in the GameView

The line is defined by the points attribute which is an (even) sequence of alternating x and y values. When added to the graphics view, the view draws a sequence of line segments, starting from one x-y pair in points and going to the next x-y pair. If points has length 2n, then the result is n-1 line segments.

The object uses the attribute linecolor to determine the color of the line. The attribute fillcolor is unused (even though it is inherited from GObject).

Constructor: creates a new sequence of line segments.

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 line from (0,0) to (2,3), use the constructor call

GLine(points=[0,0,2,3])

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.

fillcolor

This attribute is ignored.

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 GObject

Next topic

Class GTriangle

This Page