
    \
j                        d Z ddlZddlmZmZmZ ddlmZmZmZ ddlm	Z	m
Z
mZmZmZ ddlmZmZ d Z G d d	e          Z G d
 d          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          Zd ZdS )!ah  2D shapes.

This module provides classes for a variety of simplistic 2D shapes,
such as Rectangles, Circles, and Lines. These shapes are made
internally from OpenGL primitives, and provide excellent performance
when drawn as part of a :py:class:`~pyglet.graphics.Batch`.
Convenience methods are provided for positioning, changing color
and opacity, and rotation (where applicable). To create more
complex shapes than what is provided here, the lower level
graphics API is more appropriate.
See the :ref:`guide_graphics` for more details.

A simple example of drawing shapes::

    import pyglet
    from pyglet import shapes

    window = pyglet.window.Window(960, 540)
    batch = pyglet.graphics.Batch()

    circle = shapes.Circle(700, 150, 100, color=(50, 225, 30), batch=batch)
    square = shapes.Rectangle(200, 200, 200, 200, color=(55, 55, 255), batch=batch)
    rectangle = shapes.Rectangle(250, 300, 400, 200, color=(255, 22, 20), batch=batch)
    rectangle.opacity = 128
    rectangle.rotation = 33
    line = shapes.Line(100, 100, 100, 200, width=19, batch=batch)
    line2 = shapes.Line(150, 150, 444, 111, width=4, color=(200, 20, 20), batch=batch)
    star = shapes.Star(800, 400, 60, 40, num_spikes=20, color=(255, 255, 0), batch=batch)

    @window.event
    def on_draw():
        window.clear()
        batch.draw()

    pyglet.app.run()



.. versionadded:: 1.5.4
    N)GL_COLOR_BUFFER_BITGL_SRC_ALPHAGL_ONE_MINUS_SRC_ALPHA)GL_TRIANGLESGL_LINESGL_BLEND)glPushAttribglPopAttribglBlendFuncglEnable	glDisable)GroupBatchc                 <   t          j        |           }t          j        |          }t          j        |          }g }| D ]Y}|d         |z
  |z  |d         |z
  |z  z
  |z   }	|d         |z
  |z  |d         |z
  |z  z   |z   }
|                    |	|
f           Z|S )a  Rotate the vertices by the angle around x, y.

    :Parameters:
        `vertices` : list
            A list of (x, y) tuples, representing each vertex to rotate.
        `angle` : float
            The angle of the rotation in degrees.
        `x` : int or float
            X coordinate of the center of rotation.
        `y` : int or float
            Y coordinate of the center of rotation.
    r      )mathradianscossinappend)verticesanglexyrcrsrrotated_verticesvertex	rotated_x	rotated_ys              G/DATA/AppData/hermes/venv/lib/python3.11/site-packages/pyglet/shapes.py_rotater#   U   s     
e		A	!B	!B 8 8AY]b(F1IMR+??!C	AY]b(F1IMR+??!C	I 67777    c                   <     e Zd ZdZd fd	Zd Zd Zd Zd Z xZ	S )	_ShapeGroupzShared Shape rendering Group.

    The group is automatically coalesced with other shape groups
    sharing the same parent group and blend parameters.
    Nc                 f    t                                          |           || _        || _        dS )a  Create a Shape group.

        The group is created internally. Usually you do not
        need to explicitly create it.

        :Parameters:
            `blend_src` : int
                OpenGL blend source mode; for example,
                ``GL_SRC_ALPHA``.
            `blend_dest` : int
                OpenGL blend destination mode; for example,
                ``GL_ONE_MINUS_SRC_ALPHA``.
            `parent` : `~pyglet.graphics.Group`
                Optional parent group.
        N)super__init__	blend_src
blend_dest)selfr*   r+   parent	__class__s       r"   r)   z_ShapeGroup.__init__v   s/      	   "$r$   c                     t          t                     t          t                     t	          | j        | j                   d S N)r	   r   r   r   r   r*   r+   r,   s    r"   	set_statez_ShapeGroup.set_state   s9    ()))DNDO44444r$   c                 J    t          t                     t                       d S r0   )r   r   r
   r1   s    r"   unset_statez_ShapeGroup.unset_state   s    (r$   c                 z    |j         | j         u o-| j        |j        u o| j        |j        k    o| j        |j        k    S r0   )r.   r-   r*   r+   )r,   others     r"   __eq__z_ShapeGroup.__eq__   sI    4>1 4u|+4%/14 5#33	5r$   c                 ^    t          t          | j                  | j        | j        f          S r0   )hashidr-   r*   r+   r1   s    r"   __hash__z_ShapeGroup.__hash__   s#    R__dndoFGGGr$   r0   )
__name__
__module____qualname____doc__r)   r2   r4   r7   r;   __classcell__)r.   s   @r"   r&   r&   o   s         % % % % % %(5 5 5
  5 5 5H H H H H H Hr$   r&   c                   >   e Zd ZdZdZdZdZdZdZdZ	dZ
dZdZdZd Zd Zd	 Zd
 Zd Zed             Zej        d             Zed             Zej        d             Zed             Zej        d             Zed             Zej        d             Zed             Zej        d             Zed             Zej        d             Zed             Zej        d             Zed             Zej        d             Zed             Zej        d             ZdS )
_ShapeBasezBase class for Shape objects   rD   rD   rD   Tr   Nc                 J    | j         | j                                          d S d S r0   _vertex_listdeleter1   s    r"   __del__z_ShapeBase.__del__   s.    ($$&&&&& )(r$   c                     t           r0   NotImplementedErrorr1   s    r"   _update_positionz_ShapeBase._update_position       !!r$   c                     t           r0   rK   r1   s    r"   _update_colorz_ShapeBase._update_color   rN   r$   c                     | j                                          | j                            t                     | j                                          dS zDraw the shape at its current position.

        Using this method is not recommended. Instead, add the
        shape to a `pyglet.graphics.Batch` for efficient rendering.
        N)_groupset_state_recursiverG   drawr   unset_state_recursiver1   s    r"   rU   z_ShapeBase.draw   sI     	'')))|,,,))+++++r$   c                 F    | j                                          d | _         d S r0   rF   r1   s    r"   rH   z_ShapeBase.delete   s%      """ r$   c                     | j         S )@X coordinate of the shape.

        :type: int or float
        )_xr1   s    r"   r   z_ShapeBase.x        wr$   c                 <    || _         |                                  d S r0   )rZ   rM   r,   values     r"   r   z_ShapeBase.x   !    r$   c                     | j         S )@Y coordinate of the shape.

        :type: int or float
        )_yr1   s    r"   r   z_ShapeBase.y   r[   r$   c                 <    || _         |                                  d S r0   )rb   rM   r]   s     r"   r   z_ShapeBase.y   r_   r$   c                     | j         | j        fS )zThe (x, y) coordinates of the shape, as a tuple.

        :Parameters:
            `x` : int or float
                X coordinate of the sprite.
            `y` : int or float
                Y coordinate of the sprite.
        )rZ   rb   r1   s    r"   positionz_ShapeBase.position   s     wr$   c                 L    |\  | _         | _        |                                  d S r0   )rZ   rb   rM   r,   valuess     r"   re   z_ShapeBase.position   s(    !r$   c                     | j         S )zJThe X coordinate of the anchor point

        :type: int or float
        )	_anchor_xr1   s    r"   anchor_xz_ShapeBase.anchor_x        ~r$   c                 <    || _         |                                  d S r0   )rj   rM   r]   s     r"   rk   z_ShapeBase.anchor_x   !    r$   c                     | j         S )zJThe Y coordinate of the anchor point

        :type: int or float
        )	_anchor_yr1   s    r"   anchor_yz_ShapeBase.anchor_y   rl   r$   c                 <    || _         |                                  d S r0   )rp   rM   r]   s     r"   rq   z_ShapeBase.anchor_y  rn   r$   c                     | j         | j        fS )zThe (x, y) coordinates of the anchor point, as a tuple.

        :Parameters:
            `x` : int or float
                X coordinate of the anchor point.
            `y` : int or float
                Y coordinate of the anchor point.
        )rj   rp   r1   s    r"   anchor_positionz_ShapeBase.anchor_position  s     ~t~--r$   c                 L    |\  | _         | _        |                                  d S r0   )rj   rp   rM   rg   s     r"   rt   z_ShapeBase.anchor_position  s(    )/&r$   c                     | j         S )a  The shape color.

        This property sets the color of the shape.

        The color is specified as an RGB tuple of integers '(red, green, blue)'.
        Each color component must be in the range 0 (dark) to 255 (saturated).

        :type: (int, int, int)
        )_rgbr1   s    r"   colorz_ShapeBase.color  s     yr$   c                 |    t          t          t          |                    | _        |                                  d S r0   )tuplemapintrw   rP   rg   s     r"   rx   z_ShapeBase.color&  s3    #c6**++	r$   c                     | j         S )a  Blend opacity.

        This property sets the alpha component of the color of the shape.
        With the default blend mode (see the constructor), this allows the
        shape to be drawn with fractional opacity, blending with the
        background.

        An opacity of 255 (the default) has no effect.  An opacity of 128
        will make the shape appear translucent.

        :type: int
        )_opacityr1   s    r"   opacityz_ShapeBase.opacity+  s     }r$   c                 <    || _         |                                  d S r0   )r~   rP   r]   s     r"   r   z_ShapeBase.opacity;  s!    r$   c                     | j         S )z>True if the shape will be drawn.

        :type: bool
        )_visibler1   s    r"   visiblez_ShapeBase.visible@  s     }r$   c                 <    || _         |                                  d S r0   )r   rM   r]   s     r"   r   z_ShapeBase.visibleH  s!    r$   )r<   r=   r>   r?   rw   r~   r   rZ   rb   rj   rp   _batchrS   rG   rI   rM   rP   rU   rH   propertyr   setterr   re   rk   rq   rt   rx   r   r    r$   r"   rB   rB      s       &&DHH	
B	
BIIFFL' ' '" " "" " ", , ,! ! !   X X    X    X X    X  	  	  X	  _    _    X _    _    X _    _  	. 	. X	.       
 
 X
 \  \   X ^  ^   X ^    ^     r$   rB   c                   v    e Zd Zdej        dddddfdZd Zd Zed             Z	e	j
        d	             Z	d
 ZdS )ArcNr   FrC   c                    || _         || _        || _        |pt          dt	          |dz                      | _        | j        dz  |rdndz   | _        || _        || _        || _	        || _
        d| _        |	pt                      | _        t          t          t           |
          | _        | j                            | j        t&          | j        dd          | _        |                                  |                                  dS )a;  Create an Arc.

        The Arc's anchor point (x, y) defaults to it's center.

        :Parameters:
            `x` : float
                X coordinate of the circle.
            `y` : float
                Y coordinate of the circle.
            `radius` : float
                The desired radius.
            `segments` : int
                You can optionally specify how many distinct line segments
                the arc should be made from. If not specified it will be
                automatically calculated using the formula:
                `max(14, int(radius / 1.25))`.
            `angle` : float
                The angle of the arc, in radians. Defaults to tau (pi * 2),
                which is a full circle.
            `start_angle` : float
                The start angle of the arc, in radians. Defaults to 0.
            `closed` : bool
                If True, the ends of the arc will be connected with a line.
                defaults to False.
            `color` : (int, int, int)
                The RGB color of the circle, specified as a tuple of
                three ints in the range of 0-255.
            `batch` : `~pyglet.graphics.Batch`
                Optional batch to add the circle to.
            `group` : `~pyglet.graphics.Group`
                Optional parent group of the circle.
                 ?   r   v2fc4BN)rZ   rb   _radiusmaxr|   	_segments
_num_vertsrw   _angle_start_angle_closed	_rotationr   r   r&   r   r   rS   addr   rG   rM   rP   )r,   r   r   radiussegmentsr   start_angleclosedrx   batchgroups              r"   r)   zArc.__init__O  s    D !@SS$-?-?%@%@.1,V0BC	'&uww!,0FNN KOODOXt{TY[`aar$   c                 P  	
 | j         sd| j        z  dz  }n| j        | j        z   	| j        | j        z   
| j        | j        | j        z  | j        t          j
        | j                  z
  	
fdt          | j        dz             D             }g }t          t          |          dz
            D ]-}g ||         ||dz            R }|                    |           .| j        r(g |d         |d         R }|                    |           || j        j        d d <   d S )Nr      c           	          g | ]B}t          j        |z  z             z  z   t          j        |z  z             z  z   fCS r   r   r   r   .0ir   r   tau_segsr   r   s     r"   
<listcomp>z(Arc._update_position.<locals>.<listcomp>  r     m m mMN A!h,+)E F FFGA!h,+)E F FFGI m m mr$   r   r   )r   r   rZ   rj   rb   rp   r   r   r   r   r   r   rangelenextendr   rG   r   )r,   r   pointsr   line_pointschord_pointsr   r   r   r   r   s         @@@@@r"   rM   zArc._update_position  sr   } 	.dn,q0HH$.(A$.(AA{T^3H+dl4>.J.JJKm m m m m m m mRWX\XfijXjRkRkm m mF H3v;;?++ - -8vay86!a%=88,,,,| .6r
6VAY66---(0"111%%%r$   c                 n    g | j         t          | j                  | j        z  | j        j        d d <   d S r0   rw   r|   r~   r   rG   colorsr1   s    r"   rP   zArc._update_color  9    &F	&F3t}3E3E&F&X ###r$   c                     | j         S zClockwise rotation of the arc, in degrees.

        The arc will be rotated about its (anchor_x, anchor_y)
        position.

        :type: float
        r   r1   s    r"   rotationzArc.rotation       ~r$   c                 <    || _         |                                  d S r0   r   rM   r,   r   s     r"   r   zArc.rotation  !    !r$   c                 D    | j                             t                     dS rR   rG   rU   r   r1   s    r"   rU   zArc.draw  !     	x(((((r$   )r<   r=   r>   r   taur)   rM   rP   r   r   r   rU   r   r$   r"   r   r   N  s        .2$(PQ_D3 3 3 3j1 1 14Y Y Y   X _    _ ) ) ) ) )r$   r   c                   X    e Zd ZddZd Zd Zed             Zej        d             ZdS )	CircleNrC   c                    || _         || _        || _        |pt          dt	          |dz                      | _        || _        |pt                      | _        t          t          t          |          | _        | j                            | j        dz  t          | j        dd          | _        |                                  |                                  dS )a  Create a circle.

        The circle's anchor point (x, y) defaults to the center of the circle.

        :Parameters:
            `x` : float
                X coordinate of the circle.
            `y` : float
                Y coordinate of the circle.
            `radius` : float
                The desired radius.
            `segments` : int
                You can optionally specify how many distinct triangles
                the circle should be made from. If not specified it will
                be automatically calculated using the formula:
                `max(14, int(radius / 1.25))`.
            `color` : (int, int, int)
                The RGB color of the circle, specified as a tuple of
                three ints in the range of 0-255.
            `batch` : `~pyglet.graphics.Batch`
                Optional batch to add the circle to.
            `group` : `~pyglet.graphics.Group`
                Optional parent group of the circle.
        r   r      r   r   N)rZ   rb   r   r   r|   r   rw   r   r   r&   r   r   rS   r   r   rG   rM   rP   )r,   r   r   r   r   rx   r   r   s           r"   r)   zCircle.__init__  s    2 !@SS$-?-?%@%@	&uww!,0FNN KOODNQ,>dk[`bghhr$   c                   	 | j         sd| j        z  dz  }n| j        | j        z   | j        | j        z   	| j        t          j        dz  | j        z  	fdt          | j                  D             }g }t          |          D ],\  }}	g||dz
           |R }|                    |           -|| j        j        d d <   d S )Nr      r   c           	          g | ]<}t          j        |z            z  z   t          j        |z            z  z   f=S r   r   )r   r   r   r   r   r   s     r"   r   z+Circle._update_position.<locals>.<listcomp>  sg     Y Y Y=> AX 6 667AX 6 6679 Y Y Yr$   r   )r   r   rZ   rj   rb   rp   r   r   pir   	enumerater   rG   r   )
r,   r   r   r   pointtriangler   r   r   r   s
         @@@@r"   rM   zCircle._update_position  s   } 	*dn,q0HH$.(A$.(AAw{T^3HY Y Y Y Y Y YBGBWBWY Y YF H%f-- * *5a7&Q-7%77))))(0"111%%%r$   c                 t    g | j         t          | j                  | j        z  dz  | j        j        d d <   d S Nr   rw   r|   r~   r   rG   r   r1   s    r"   rP   zCircle._update_color  ?    &F	&F3t}3E3E&F&WZ[&[ ###r$   c                     | j         S z8The radius of the circle.

        :type: float
        r   r1   s    r"   r   zCircle.radius       |r$   c                 <    || _         |                                  d S r0   r   rM   r]   s     r"   r   zCircle.radius  !    r$   )NrC   NN)	r<   r=   r>   r)   rM   rP   r   r   r   r   r$   r"   r   r     s        $ $ $ $L1 1 1*\ \ \   X ]    ]     r$   r   c                       e Zd ZddZd Zd Zed             Zej        d             Zed             Z	e	j        d	             Z	ed
             Z
e
j        d             Z
d ZdS )EllipserC   Nc                    || _         || _        || _        || _        || _        d| _        t          t          ||          dz            | _        | j        dz  | _	        |pt                      | _        t          t          t          |          | _        | j                            | j	        t"          | j        dd          | _        |                                  |                                  dS )a   Create an ellipse.

        The ellipse's anchor point (x, y) defaults to the center of the ellipse.

        :Parameters:
            `x` : float
                X coordinate of the ellipse.
            `y` : float
                Y coordinate of the ellipse.
            `a` : float
                Semi-major axes of the ellipse.
            `b`: float
                Semi-minor axes of the ellipse.
            `color` : (int, int, int)
                The RGB color of the ellipse. specify as a tuple of
                three ints in the range of 0~255.
            `batch` : `~pyglet.graphics.Batch`
                Optional batch to add the circle to.
            `group` : `~pyglet.graphics.Group`
                Optional parent group of the circle.
        r   r   r   r   r   N)rZ   rb   _a_brw   r   r|   r   r   r   r   r   r&   r   r   rS   r   r   rG   rM   rP   )r,   r   r   abrx   r   r   s           r"   r)   zEllipse.__init__  s    , 	SAYY-...1,&uww!,0FNN KOODOXt{TY[`aar$   c                      j         sd j        z  dz  }nȉ j         j        z    j         j        z   t          j        dz   j        z   fdt           j        dz             D             } j
        rt          | j
                  }g }t          t          |          dz
            D ]-}g ||         ||dz            R }|                    |           .| j        j        d d <   d S )Nr   r   r   c           	          g | ]F}j         t          j        |z            z  z   j        t          j        |z            z  z   fGS r   )r   r   r   r   r   )r   r   r,   r   r   r   s     r"   r   z,Ellipse._update_position.<locals>.<listcomp>7  sk     a a aAB 47TXa(l%;%;;;47TXa(l%;%;;;= a a ar$   r   )r   r   rZ   rj   rb   rp   r   r   r   r   r   r#   r   r   rG   r   )r,   r   r   r   r   r   r   r   s   `    @@@r"   rM   zEllipse._update_position.  s8   } 	-do-1HH$.(A$.(Aw{T^3Ha a a a a a aFKDN]^L^F_F_a a aF ~ ? A>> H3v;;?++ - -8vay86!a%=88,,,,(0"111%%%r$   c                 n    g | j         t          | j                  | j        z  | j        j        d d <   d S r0   r   r1   s    r"   rP   zEllipse._update_colorE  r   r$   c                     | j         S )zBThe semi-major axes of the ellipse.

        :type: float
        )r   r1   s    r"   r   z	Ellipse.aH  r[   r$   c                 <    || _         |                                  d S r0   )r   rM   r]   s     r"   r   z	Ellipse.aP  r_   r$   c                     | j         S )zBThe semi-minor axes of the ellipse.

        :type: float
        )r   r1   s    r"   r   z	Ellipse.bU  r[   r$   c                 <    || _         |                                  d S r0   )r   rM   r]   s     r"   r   z	Ellipse.b]  r_   r$   c                     | j         S r   r   r1   s    r"   r   zEllipse.rotationb  r   r$   c                 <    || _         |                                  d S r0   r   r   s     r"   r   zEllipse.rotationm  r   r$   c                 D    | j                             t                     dS rR   r   r1   s    r"   rU   zEllipse.drawr  r   r$   rC   NN)r<   r=   r>   r)   rM   rP   r   r   r   r   r   rU   r   r$   r"   r   r     s       $ $ $ $L1 1 1.Y Y Y   X X    X    X X    X    X _    _ ) ) ) ) )r$   r   c                      e Zd Zdej        ddddfdZd Zd Zed             Z	e	j
        d             Z	ed	             Zej
        d
             Zed             Zej
        d             Zed             Zej
        d             ZdS )SectorNr   rC   c
                    || _         || _        || _        |pt          dt	          |dz                      | _        || _        || _        || _        d| _	        |pt                      | _        t          t          t          |	          | _        | j                            | j        dz  t"          | j        dd          | _        |                                  |                                  dS )a  Create a sector of a circle.

                The sector's anchor point (x, y) defaults to the center of the circle.

                :Parameters:
                    `x` : float
                        X coordinate of the sector.
                    `y` : float
                        Y coordinate of the sector.
                    `radius` : float
                        The desired radius.
                    `segments` : int
                        You can optionally specify how many distinct triangles
                        the sector should be made from. If not specified it will
                        be automatically calculated using the formula:
                        `max(14, int(radius / 1.25))`.
                    `angle` : float
                        The angle of the sector, in radians. Defaults to tau (pi * 2),
                        which is a full circle.
                    `start_angle` : float
                        The start angle of the sector, in radians. Defaults to 0.
                    `color` : (int, int, int)
                        The RGB color of the sector, specified as a tuple of
                        three ints in the range of 0-255.
                    `batch` : `~pyglet.graphics.Batch`
                        Optional batch to add the sector to.
                    `group` : `~pyglet.graphics.Group`
                        Optional parent group of the sector.
                r   r   r   r   r   r   N)rZ   rb   r   r   r|   r   rw   r   r   r   r   r   r&   r   r   rS   r   r   rG   rM   rP   )
r,   r   r   r   r   r   r   rx   r   r   s
             r"   r)   zSector.__init__|  s    > !@SS$-?-?%@%@	'&uww!,0FNN KOODNQ,>dk[`bghhr$   c                   	
 | j         sd| j        z  dz  }n| j        | j        z   	| j        | j        z   
| j        | j        | j        z  | j        t          j
        | j                  z
  	
fdt          | j        dz             D             }g }t          |dd          d          D ],\  }}	
g||dz
           |R }|                    |           -|| j        j        d d <   d S )Nr   r   c           	          g | ]B}t          j        |z  z             z  z   t          j        |z  z             z  z   fCS r   r   r   s     r"   r   z+Sector._update_position.<locals>.<listcomp>  r   r$   r   )start)r   r   rZ   rj   rb   rp   r   r   r   r   r   r   r   r   r   rG   r   )r,   r   r   r   r   r   r   r   r   r   r   s         @@@@@r"   rM   zSector._update_position  sD   } 	*dn,q0HH$.(A$.(AA{T^3H+dl4>.J.JJKm m m m m m m mRWX\XfijXjRkRkm m mF H%fQRRj::: * *5a7&Q-7%77))))(0"111%%%r$   c                 t    g | j         t          | j                  | j        z  dz  | j        j        d d <   d S r   r   r1   s    r"   rP   zSector._update_color  r   r$   c                     | j         S r0   )r   r1   s    r"   r   zSector.angle  s
    {r$   c                 <    || _         |                                  d S r0   )r   rM   r,   r   s     r"   r   zSector.angle  !    r$   c                     | j         S r0   )r   r1   s    r"   r   zSector.start_angle  s      r$   c                 <    || _         |                                  d S r0   )r   rM   r   s     r"   r   zSector.start_angle  s"    !r$   c                     | j         S r   r   r1   s    r"   r   zSector.radius  r   r$   c                 <    || _         |                                  d S r0   r   r]   s     r"   r   zSector.radius  r   r$   c                     | j         S )zClockwise rotation of the sector, in degrees.

        The sector will be rotated about its (anchor_x, anchor_y)
        position.

        :type: float
        r   r1   s    r"   r   zSector.rotation  r   r$   c                 <    || _         |                                  d S r0   r   r   s     r"   r   zSector.rotation  r   r$   )r<   r=   r>   r   r   r)   rM   rP   r   r   r   r   r   r   r   r$   r"   r   r   {  s=       .2$(PQ&d$. . . .`1 1 1,\ \ \   X \    \  ! ! X!         X ]    ]    X _    _     r$   r   c                       e Zd ZddZd Zd Zed             Zej        d             Zed	             Z	e	j        d
             Z	ed             Z
e
j        d             Z
dS )Liner   rC   Nc	                    || _         || _        || _        || _        || _        t          j        t          j        ||z
  ||z
                      | _        || _	        |pt                      | _        t          t          t          |          | _        | j                            dt"          | j        dd          | _        |                                  |                                  dS )a~  Create a line.

        The line's anchor point defaults to the center of the line's
        width on the X axis, and the Y axis.

        :Parameters:
            `x` : float
                The first X coordinate of the line.
            `y` : float
                The first Y coordinate of the line.
            `x2` : float
                The second X coordinate of the line.
            `y2` : float
                The second Y coordinate of the line.
            `width` : float
                The desired width of the line.
            `color` : (int, int, int)
                The RGB color of the line, specified as a tuple of
                three ints in the range of 0-255.
            `batch` : `~pyglet.graphics.Batch`
                Optional batch to add the line to.
            `group` : `~pyglet.graphics.Group`
                Optional parent group of the line.
        r   r   r   N)rZ   rb   _x2_y2_widthr   degreesatan2r   rw   r   r   r&   r   r   rS   r   r   rG   rM   rP   )	r,   r   r   x2y2widthrx   r   r   s	            r"   r)   zLine.__init__  s    2 djaa&@&@AA	&uww!,0FNN KOOA|T[%QVWWr$   c                    | j         sd| j        j        d d <   d S | j         }| j        | j        dz  z
  }| j        }| j        }|t          j	        | j
        |z
  | j        |z
            z   }|| j        z   }t          j        | j
        |z
  | j        |z
            }t          j        |          }t          j        |          }	||z  ||	z  z
  |z   }
||	z  ||z  z   |z   }||z  ||	z  z
  |z   }||	z  ||z  z   |z   }||z  ||	z  z
  |z   }||	z  ||z  z   |z   }||z  ||	z  z
  |z   }||	z  ||z  z   |z   }|
||||||
|||||f| j        j        d d <   d S )Nr   r   r   r   r   r   r   r   r   r   r   r   r   )r   rG   r   rp   rj   r  rZ   rb   r   hypotr   r   r  r   r   )r,   x1y1r   r   r  r  r   r   r   axaybxbycxcydxdys                     r"   rM   zLine._update_position  s   } 	],PD&qqq))).B$+/1BAAdjAtx!|<<<Bdk!B
48a<A66A!B!Bb27"Q&Bb27"Q&Bb27"Q&Bb27"Q&Bb27"Q&Bb27"Q&Bb27"Q&Bb27"Q&B-/RRRRQSUWY[,\D&qqq)))r$   c                 d    g | j         t          | j                  dz  | j        j        d d <   d S Nr   rw   r|   r~   rG   r   r1   s    r"   rP   zLine._update_color6  7    &F	&F3t}3E3E&F&J ###r$   c                     | j         S zGSecond X coordinate of the shape.

        :type: int or float
        r   r1   s    r"   r  zLine.x29       xr$   c                 <    || _         |                                  d S r0   r   rM   r]   s     r"   r  zLine.x2A  !    r$   c                     | j         S zGSecond Y coordinate of the shape.

        :type: int or float
        r   r1   s    r"   r  zLine.y2F  r  r$   c                 <    || _         |                                  d S r0   r   rM   r]   s     r"   r  zLine.y2N  r  r$   c                 6    | j         | j        | j        | j        fS )a~  The (x, y, x2, y2) coordinates of the line, as a tuple.

        :Parameters:
            `x` : int or float
                X coordinate of the line.
            `y` : int or float
                Y coordinate of the line.
            `x2` : int or float
                X2 coordinate of the line.
            `y2` : int or float
                Y2 coordinate of the line.
        )rZ   rb   r   r   r1   s    r"   re   zLine.positionS  s     w4833r$   c                 d    |\  | _         | _        | _        | _        |                                  d S r0   )rZ   rb   r   r   rM   rg   s     r"   re   zLine.positionc  s0    /5,$(DHr$   )r   rC   NN)r<   r=   r>   r)   rM   rP   r   r  r   r  re   r   r$   r"   r   r     s        & & & &P] ] ]0K K K   X Y    Y    X Y    Y  4 4 X4 _    _     r$   r   c                       e Zd ZddZd Zd Zed             Zej        d             Zed             Z	e	j        d	             Z	ed
             Z
e
j        d             Z
dS )	RectanglerC   Nc                 n   || _         || _        || _        || _        d| _        || _        |pt                      | _        t          t          t          |          | _        | j                            dt          | j        dd          | _        |                                  |                                  dS )aB  Create a rectangle or square.

        The rectangle's anchor point defaults to the (x, y) coordinates,
        which are at the bottom left.

        :Parameters:
            `x` : float
                The X coordinate of the rectangle.
            `y` : float
                The Y coordinate of the rectangle.
            `width` : float
                The width of the rectangle.
            `height` : float
                The height of the rectangle.
            `color` : (int, int, int)
                The RGB color of the rectangle, specified as
                a tuple of three ints in the range of 0-255.
            `batch` : `~pyglet.graphics.Batch`
                Optional batch to add the rectangle to.
            `group` : `~pyglet.graphics.Group`
                Optional parent group of the rectangle.
        r   r   r   r   N)rZ   rb   r  _heightr   rw   r   r   r&   r   r   rS   r   r   rG   rM   rP   )r,   r   r   r  heightrx   r   r   s           r"   r)   zRectangle.__init__j  s    . 	&uww!,0FNN KOOA|T[%QVWWr$   c                 Z   | j         sd| j        _        d S | j        | j        z
  }| j        | j        z
  }|| j        z   }|| j        z   }| j        }| j        }||f||f||f||f||f||fg}| j	        rt          || j	        ||          }t          d |D                       | j        _        d S )Nr  c              3   $   K   | ]}|D ]}|V  d S r0   r   r   r   r^   s      r"   	<genexpr>z-Rectangle._update_position.<locals>.<genexpr>  s1      .`.`Y_.`.`PUu.`.`.`.`.`.`.`r$   )r   rG   r   rZ   rj   rb   rp   r  r)  r   r#   rz   )r,   r
  r  r  r  r   r   r   s           r"   rM   zRectangle._update_position  s    } 	a)MD&&&4>)B4>)Bdk!Bdl"BAAR2r(RHr2hR2r(SH~ C"8T^QBB)..`.`8.`.`.`)`)`D&&&r$   c                 d    g | j         t          | j                  dz  | j        j        d d <   d S r  r  r1   s    r"   rP   zRectangle._update_color  r  r$   c                     | j         S z:The width of the rectangle.

        :type: float
        r  r1   s    r"   r  zRectangle.width       {r$   c                 <    || _         |                                  d S r0   r  rM   r]   s     r"   r  zRectangle.width  r   r$   c                     | j         S z;The height of the rectangle.

        :type: float
        r)  r1   s    r"   r*  zRectangle.height  r   r$   c                 <    || _         |                                  d S r0   r)  rM   r]   s     r"   r*  zRectangle.height  r   r$   c                     | j         S zClockwise rotation of the rectangle, in degrees.

        The Rectangle will be rotated about its (anchor_x, anchor_y)
        position.

        :type: float
        r   r1   s    r"   r   zRectangle.rotation  r   r$   c                 <    || _         |                                  d S r0   r   r   s     r"   r   zRectangle.rotation  r   r$   r   )r<   r=   r>   r)   rM   rP   r   r  r   r*  r   r   r$   r"   r'  r'  i  s        " " " "Ha a a$K K K   X \    \    X ]    ]    X _    _     r$   r'  c                       e Zd Z	 	 ddZd Zd Zed             Zej        d	             Zed
             Z	e	j        d             Z	ed             Z
e
j        d             Z
ed             Zej        d             ZdS )BorderedRectangler   rC   d   rA  rA  Nc
                    || _         || _        || _        || _        d| _        || _        || _        || _        |pt                      | _	        t          t          t          |	          | _        g d}
| j	                            dt          | j        |
dd          | _        |                                  |                                  dS )a<  Create a rectangle or square.

        The rectangle's anchor point defaults to the (x, y) coordinates,
        which are at the bottom left.

        :Parameters:
            `x` : float
                The X coordinate of the rectangle.
            `y` : float
                The Y coordinate of the rectangle.
            `width` : float
                The width of the rectangle.
            `height` : float
                The height of the rectangle.
            `border` : float
                The thickness of the border.
            `color` : (int, int, int)
                The RGB color of the rectangle, specified as
                a tuple of three ints in the range of 0-255.
            `border_color` : (int, int, int)
                The RGB color of the rectangle's border, specified as
                a tuple of three ints in the range of 0-255.
            `batch` : `~pyglet.graphics.Batch`
                Optional batch to add the rectangle to.
            `group` : `~pyglet.graphics.Group`
                Optional parent group of the rectangle.
        r   )r   r   r   r   r   r   r   r   r   r      r   r   r      r   rD  r   r   r   rD  rD  r   r   r   r   r   r   r   rC     r   r   N)rZ   rb   r  r)  r   _borderrw   _brgbr   r   r&   r   r   rS   add_indexedr   rG   rM   rP   )r,   r   r   r  r*  borderrx   border_colorr   r   indicess              r"   r)   zBorderedRectangle.__init__  s    : 	!
&uww!,0FNNlll K33A|T[RY[`bghhr$   c           	         | j         sd| j        _        d S | j        }| j        }| j        }|| j        z
  }|| j        z
  }|| j        z   }|| j	        z   }||z   }||z   }	||z
  }
||z
  }||	f|
|	f|
|f||f||f||f||f||fg}| j
        rt          || j
        ||          }t          d |D                       | j        j        d d <   d S )N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c              3   $   K   | ]}|D ]}|V  d S r0   r   r-  s      r"   r.  z5BorderedRectangle._update_position.<locals>.<genexpr>  s1      1c1cF\b1c1cSX%1c1c1c1c1c1c1cr$   )r   rG   r   rF  rZ   rb   rj   rp   r  r)  r   r#   rz   )r,   r   r   r   bx1by1bx2by2ix1iy1ix2iy2r   s                r"   rM   z"BorderedRectangle._update_position  s   } 	d)YD&&&AAAdn$Cdn$C#C$C'C'C'C'Cc
S#Jc
S#Jc
S#Jc
S#JHH ~ C"8T^QBB -21c1ch1c1c1c,c,cD&qqq)))r$   c                     t          | j                  }g | j        |dz  g | j        |dz  z   | j        j        d d <   d S )Nr   )r|   r~   rw   rG  rG   r   )r,   r   s     r"   rP   zBorderedRectangle._update_color  sU    dm$$&;	&;7&;a&?BXDJBXPWBX[\B\&\ ###r$   c                     | j         S r1  r2  r1   s    r"   r  zBorderedRectangle.width  r3  r$   c                 <    || _         |                                  d S r0   r5  r]   s     r"   r  zBorderedRectangle.width"  r   r$   c                     | j         S r7  r8  r1   s    r"   r*  zBorderedRectangle.height'  r   r$   c                 <    || _         |                                  d S r0   r:  r]   s     r"   r*  zBorderedRectangle.height/  r   r$   c                     | j         S r<  r   r1   s    r"   r   zBorderedRectangle.rotation4  r   r$   c                 <    || _         |                                  d S r0   r   r]   s     r"   r   zBorderedRectangle.rotation?  rn   r$   c                     | j         S )a4  The rectangle's border color.

        This property sets the color of the border of a bordered rectangle.

        The color is specified as an RGB tuple of integers '(red, green, blue)'.
        Each color component must be in the range 0 (dark) to 255 (saturated).

        :type: (int, int, int)
        )rG  r1   s    r"   rJ  zBorderedRectangle.border_colorD  s     zr$   c                 |    t          t          t          |                    | _        |                                  d S r0   )rz   r{   r|   rG  rP   rg   s     r"   rJ  zBorderedRectangle.border_colorQ  s3    3sF++,,
r$   )r   rC   r@  NN)r<   r=   r>   r)   rM   rP   r   r  r   r*  r   rJ  r   r$   r"   r?  r?    s5       <KAE+ + + +Zd d d4] ] ]   X \    \    X ]    ]    X _    _  
 
 X
     r$   r?  c                   0   e Zd ZddZd Zd Zed             Zej        d             Zed             Z	e	j        d	             Z	ed
             Z
e
j        d             Z
ed             Zej        d             Zed             Zej        d             ZdS )TrianglerC   Nc
                    || _         || _        || _        || _        || _        || _        d| _        || _        |pt                      | _	        t          t          t          |	          | _        | j	                            dt          | j        dd          | _        |                                  |                                  dS )a  Create a triangle.

        The triangle's anchor point defaults to the first vertex point.

        :Parameters:
            `x` : float
                The first X coordinate of the triangle.
            `y` : float
                The first Y coordinate of the triangle.
            `x2` : float
                The second X coordinate of the triangle.
            `y2` : float
                The second Y coordinate of the triangle.
            `x3` : float
                The third X coordinate of the triangle.
            `y3` : float
                The third Y coordinate of the triangle.
            `color` : (int, int, int)
                The RGB color of the triangle, specified as
                a tuple of three ints in the range of 0-255.
            `batch` : `~pyglet.graphics.Batch`
                Optional batch to add the triangle to.
            `group` : `~pyglet.graphics.Group`
                Optional parent group of the triangle.
        r   r   r   r   N)rZ   rb   r   r   _x3_y3r   rw   r   r   r&   r   r   rS   r   r   rG   rM   rP   )
r,   r   r   r  r  x3y3rx   r   r   s
             r"   r)   zTriangle.__init__X  s    4 	&uww!,0FNN KOOA|T[%QVWWr$   c                     | j         sd| j        _        d S | j        }| j        }| j        |z
  }| j        |z
  }| j        |z
  }| j        |z
  }| j	        |z
  }| j
        |z
  }||||||f| j        _        d S )N)r   r   r   r   r   r   )r   rG   r   rj   rp   rZ   rb   r   r   rb  rc  )	r,   rk   rq   r
  r  r  r  rd  re  s	            r"   rM   zTriangle._update_position  s    } 	B);D&&&~H~H8#B8#BH$BH$BH$BH$B*,b"b"b)AD&&&r$   c                 d    g | j         t          | j                  dz  | j        j        d d <   d S r   r  r1   s    r"   rP   zTriangle._update_color  r  r$   c                     | j         S r  r  r1   s    r"   r  zTriangle.x2  r  r$   c                 <    || _         |                                  d S r0   r  r]   s     r"   r  zTriangle.x2  r  r$   c                     | j         S r   r!  r1   s    r"   r  zTriangle.y2  r  r$   c                 <    || _         |                                  d S r0   r#  r]   s     r"   r  zTriangle.y2  r  r$   c                     | j         S )zFThird X coordinate of the shape.

        :type: int or float
        )rb  r1   s    r"   rd  zTriangle.x3  r  r$   c                 <    || _         |                                  d S r0   )rb  rM   r]   s     r"   rd  zTriangle.x3  r  r$   c                     | j         S )zFThird Y coordinate of the shape.

        :type: int or float
        )rc  r1   s    r"   re  zTriangle.y3  r  r$   c                 <    || _         |                                  d S r0   )rc  rM   r]   s     r"   re  zTriangle.y3  r  r$   c                 N    | j         | j        | j        | j        | j        | j        fS )a8  The (x, y, x2, y2, x3, y3) coordinates of the triangle, as a tuple.

        :Parameters:
            `x` : int or float
                X coordinate of the triangle.
            `y` : int or float
                Y coordinate of the triangle.
            `x2` : int or float
                X2 coordinate of the triangle.
            `y2` : int or float
                Y2 coordinate of the triangle.
            `x3` : int or float
                X3 coordinate of the triangle.
            `y3` : int or float
                Y3 coordinate of the triangle.
        )rZ   rb   r   r   rb  rc  r1   s    r"   re   zTriangle.position  s#    $ w48TXtxGGr$   c                 |    |\  | _         | _        | _        | _        | _        | _        |                                  d S r0   )rZ   rb   r   r   rb  rc  rM   rg   s     r"   re   zTriangle.position  s8    CI@$(DHdhr$   r   )r<   r=   r>   r)   rM   rP   r   r  r   r  rd  re  re   r   r$   r"   r`  r`  W  sh       ( ( ( (TB B BK K K   X Y    Y    X Y    Y    X Y    Y    X Y    Y  H H XH& _    _     r$   r`  c                      e Zd Z	 	 d	 ddZd Zd Zed             Zej        d	             Zed
             Z	e	j        d             Z	ed             Z
e
j        d             Z
ed             Zej        d             ZdS )Starr   rC   Nreturnc
                    || _         || _        || _        || _        || _        || _        || _        |pt                      | _        t          t          t          |	          | _        | j                            | j        dz  t          | j        dd          | _        |                                  |                                  dS )aG  Create a star.

        The star's anchor point (x, y) defaults to the center of the star.

        :Parameters:
            `x` : float
                The X coordinate of the star.
            `y` : float
                The Y coordinate of the star.
            `outer_radius` : float
                The desired outer radius of the star.
            `inner_radius` : float
                The desired inner radius of the star.
            `num_spikes` : float
                The desired number of spikes of the star.
            `rotation` : float
                The rotation of the star in degrees. A rotation of 0 degrees
                will result in one spike lining up with the X axis in
                positive direction.
            `color` : (int, int, int)
                The RGB color of the star, specified as
                a tuple of three ints in the range of 0-255.
            `batch` : `~pyglet.graphics.Batch`
                Optional batch to add the star to.
            `group` : `~pyglet.graphics.Group`
                Optional parent group of the star.
        r   r   r   N)rZ   rb   _outer_radius_inner_radius_num_spikesrw   r   r   r   r&   r   r   rS   r   r   rG   rM   rP   )
r,   r   r   outer_radiusinner_radius
num_spikesr   rx   r   r   s
             r"   r)   zStar.__init__  s    : ))%	!&uww!,0FNN KOOD,<Q,>,0KG Gr$   c           
          | j         sd| j        z  dz  }nf| j        | j        z   }| j        | j        z   }| j        }| j        }t          j	        | j        z  }| j
        dz  t          j	        z  }g }t          | j                  D ]}	|                    ||t          j        d|	z  |z  |z             z  z   ||t          j        d|	z  |z  |z             z  z   f           |                    ||t          j        d|	z  dz   |z  |z             z  z   ||t          j        d|	z  dz   |z  |z             z  z   f           g }t          |          D ],\  }	}
||g||	dz
           |
R }|                    |           -|| j        j        d d <   d S )N)r   r   r      r   r   )r   rx  rZ   rj   rb   rp   rw  rv  r   r   r   r   r   r   r   r   r   rG   r   )r,   r   r   r   r_ir_od_thetaphir   r   r   r   s               r"   rM   zStar._update_position  s   } 	* 0014HH$.(A$.(A$C$C g 00G .3&0C F4+,, O OqC$(1Q3=33F*G*G$GH C$(1Q3=33F*G*G$GHJ K K KqC$(AaCEW3Ds3J*K*K$KL C$(AaCEW3Ds3J*K*K$KLN O O O O H%f-- * *5a7&Q-7%77))))(0"111%%%r$   c                 t    g | j         t          | j                  | j        z  dz  | j        j        d d <   d S r  )rw   r|   r~   rx  rG   r   r1   s    r"   rP   zStar._update_color.  s@    &F	&F3t}3E3E&FIY&Y\]&] ###r$   c                     | j         S )zThe outer radius of the star.)rv  r1   s    r"   ry  zStar.outer_radius1       !!r$   c                 <    || _         |                                  d S r0   )rv  rM   r]   s     r"   ry  zStar.outer_radius6  "    "r$   c                     | j         S )zThe inner radius of the star.)rw  r1   s    r"   rz  zStar.inner_radius;  r  r$   c                 <    || _         |                                  d S r0   )rw  rM   r]   s     r"   rz  zStar.inner_radius@  r  r$   c                     | j         S )zNumber of spikes of the star.)rx  r1   s    r"   r{  zStar.num_spikesE  s     r$   c                 <    || _         |                                  d S r0   )rx  rM   r]   s     r"   r{  zStar.num_spikesJ  s"     r$   c                     | j         S )z*Rotation of the star, in degrees.
        r   r1   s    r"   r   zStar.rotationO  s     ~r$   c                 <    || _         |                                  d S r0   r   r   s     r"   r   zStar.rotationU  r   r$   )r   rC   NN)rt  N)r<   r=   r>   r)   rM   rP   r   ry  r   rz  r{  r   r   r$   r"   rs  rs    s>       NO:>+CG+ + + +Z1 1 1>^ ^ ^ " " X"       " " X"           X          X
 _    _     r$   rs  c                      e Zd ZdddddZd Zd Zed             Zej        d             Zed	             Z	e	j        d
             Z	ed             Z
e
j        d             Z
ed             Zej        d             ZdS )PolygonrC   N)rx   r   r   c                   t          |          | _        | j        d         \  | _        | _        d| _        || _        |pt                      | _        t          t          t          |          | _        | j                            t          | j                  dz
  dz  t          | j        dd          | _        |                                  |                                  dS )aS  Create a convex polygon.

        The polygon's anchor point defaults to the first vertex point.

        :Parameters:
            `coordinates` : List[[int, int]]
                The coordinates for each point in the polygon.
            `color` : (int, int, int)
                The RGB color of the polygon, specified as
                a tuple of three ints in the range of 0-255.
            `batch` : `~pyglet.graphics.Batch`
                Optional batch to add the polygon to.
            `group` : `~pyglet.graphics.Group`
                Optional parent group of the polygon.
        r   r   r   r   r   N)list_coordinatesrZ   rb   r   rw   r   r   r&   r   r   rS   r   r   r   rG   rM   rP   )r,   rx   r   r   coordinatess        r"   r)   zPolygon.__init__\  s    $ !--,Q/	&uww!,0FNN KOOS1B-C-Ca-G1,Ll\`\ginpuvvr$   c                    | j         s7t          dgt          | j                  dz
  dz  z            | j        _        d S | j        | j        fd| j        D             }| j        r'| j        d         \  }}t          || j        ||          }g }t          t          |          dz
            D ]"}||d         ||dz            ||dz            gz  }#t          d |D                       | j        _        d S )Nr   r   r   c                 *    g | ]\  }}|z
  |z
  gS r   r   )r   r   r   rk   rq   s      r"   r   z,Polygon._update_position.<locals>.<listcomp>  s*    QQQtq!q8|Q\2QQQr$   r   c              3   $   K   | ]}|D ]}|V  d S r0   r   )r   
coordinater^   s      r"   r.  z+Polygon._update_position.<locals>.<genexpr>  s1      .i.i^h.i.iUZu.i.i.i.i.i.i.ir$   )r   rz   r   r  rG   r   rj   rp   r   r#   r   )r,   coordsr   r   	trianglesnrk   rq   s         @@r"   rM   zPolygon._update_position{  s    } 	j).ss4;L7M7MPQ7QUV6V/W)X)XD&&& ~H~HQQQQQt?PQQQF~ ?(+1 A>> I3v;;?++ G GfQiAq1uFF		 */.i.iy.i.i.i)i)iD&&&r$   c                     g | j         t          | j                  t          | j                  dz
  dz  z  | j        j        d d <   d S )Nr   r   )rw   r|   r~   r   r  rG   r   r1   s    r"   rP   zPolygon._update_color  sN    &F	&F3t}3E3E&F3tO`KaKadeKeijJj&k ###r$   c                 (    | j         d         d         S )rY   r   r  r1   s    r"   r   z	Polygon.x        #A&&r$   c                 \    |x| _         | j        d         d<   |                                  d S )Nr   )rZ   r  rM   r]   s     r"   r   z	Polygon.x  3    ,11$#A&q)r$   c                 (    | j         d         d         S )ra   r   r   r  r1   s    r"   r   z	Polygon.y  r  r$   c                 \    |x| _         | j        d         d<   |                                  d S )Nr   r   )rb   r  rM   r]   s     r"   r   z	Polygon.y  r  r$   c                 N    | j         d         d         | j         d         d         fS )zThe (x, y) coordinates of the shape, as a tuple.

        :Parameters:
            `x` : int or float
                X coordinate of the shape.
            `y` : int or float
                Y coordinate of the shape.
        r   r   r  r1   s    r"   re   zPolygon.position  s)      #A&(9!(<Q(???r$   c                    | j         d         d         |d         z
  | j         d         d         |d         z
  fd| j         D             | _         | j         d         \  | _        | _        |                                  d S )Nr   r   c                 *    g | ]\  }}|z
  |z
  gS r   r   )r   r   r   r  r  s      r"   r   z$Polygon.position.<locals>.<listcomp>  s*    LLL$!Qa"fa"f-LLLr$   )r  rZ   rb   rM   )r,   rh   r  r  s     @@r"   re   zPolygon.position  s    q!!$vay0q!!$vay0LLLLL$:KLLL,Q/r$   c                     | j         S )zClockwise rotation of the polygon, in degrees.

        The Polygon will be rotated about its (anchor_x, anchor_y)
        position.

        :type: float
        r   r1   s    r"   r   zPolygon.rotation  r   r$   c                 <    || _         |                                  d S r0   r   r   s     r"   r   zPolygon.rotation  r   r$   )r<   r=   r>   r)   rM   rP   r   r   r   r   re   r   r   r$   r"   r  r  [  s;       +:$d     >j j j,l l l ' ' X' X    X  ' ' X' X    X  	@ 	@ X	@ _    _    X _    _     r$   r  )
r   r   r   r   r'  r?  r`  rs  r  r   )r?   r   	pyglet.glr   r   r   r   r   r   r	   r
   r   r   r   pyglet.graphicsr   r   r#   r&   rB   r   r   r   r   r   r'  r?  r`  rs  r  __all__r   r$   r"   <module>r     s  H' 'R  O O O O O O O O O O 6 6 6 6 6 6 6 6 6 6 Q Q Q Q Q Q Q Q Q Q Q Q Q Q ( ( ( ( ( ( ( (  4+H +H +H +H +H% +H +H +H\n  n  n  n  n  n  n  n bi) i) i) i) i)* i) i) i)XJ  J  J  J  J Z J  J  J Zq) q) q) q) q)j q) q) q)hw  w  w  w  w Z w  w  w tq  q  q  q  q : q  q  q hb  b  b  b  b 
 b  b  b JF F F F F
 F F FRG  G  G  G  G z G  G  G Tw  w  w  w  w : w  w  w tv  v  v  v  v j v  v  v r zr$   