.. a7 Graphics Triangle class .. _gtriangle-label: Class GTriangle ================ This class represents a solid triangle to draw on the screen. The triangle is defined as a sequence of three points. Just as with the :ref:`GPath <gpath-label>` class (which is the parent of this class), it has an attribute ``points`` which represents these points as an even-length sequence of ints or floats. The interior (fill) color of this triangle is ``fillcolor``, while ``linecolor`` is the color of the border. If `linewidth` is set to 0, then the border is not visible. As with :ref:`GPath <gpath-label>`, the attributes ``x`` and ``y`` may be used to shift the triangle position. By default, these values are 0. However, if they are nonzero, then Python will add them to the triangle vertices. Similarly, the attributes ``width`` and ``height`` are immutable, and are computed directly from the points Constructor ----------- .. autoclass:: game2d.GTriangle Attributes ---------- This class does not have any attributes beyond those defined in :ref:`GPath <gpath-label>`. Methods ------- This class has all of the methods of :ref:`GPath <gpath-label>`. In addition, it has the following altered method. .. currentmodule:: game2d .. automethod:: GTriangle.contains :ref:`Return to top level <top-label>`