.. a7 Graphics Object class .. _gpath-label: Class GPath =========== This class represents a sequence of line segements. The path is defined by the ``points`` attribute which is an (even) sequence of alternating x and y values. When drawn in a :ref:`GView <gview-label>` object, the line starts from one x-y pair in ``points`` and goes to the next x-y pair. If ``points`` has length 2n, then the result is n-1 line segments. The class uses the attribute ``linecolor`` to determine the color of the line and the attribute `linewidth` to determine the width. The attribute ``fillcolor`` is unused (even though it is inherited from `GObject`). The attributes ``width`` and ``height`` are present in this object, but they are now read-only. These values are computed from the list of points. On the other hand, the attributes ``x`` and ``y`` are used. By default, these values are 0. However, if they are nonzero, then Python will add them to all of the points in the path, shifting the path accordingly. Constructor ----------- .. autoclass:: game2d.GPath Attributes ---------- This class has all of the attributes of :ref:`GObject <gobject-label>`. In addition, it has the following new or altered attributes. .. currentmodule:: game2d .. autoattribute:: GPath.points .. autoattribute:: GPath.x .. autoattribute:: GPath.y .. autoattribute:: GPath.width .. autoattribute:: GPath.height .. attribute:: GPath.fillcolor This attribute is ignored. Methods ------- This class has all of the methods of :ref:`GObject <gobject-label>`. In addition, it has the following new or altered methods. .. automethod:: GPath.contains .. automethod:: GPath.near :ref:`Return to top level <top-label>`