o
    tVg                     @   s   d Z ddlZddlZejZejZejZ	e
dZed ejdeZejejed ZejeddZejeZeje d e d feZd	Zejjd
dgejjeddddR  ZejjZ dd Z!dd Z"e#dkrye"  dS dS )z pygame.examples.cursors
Click a button and the cursor will change.
This example will show you:
*The different types of cursors that exist
*How to create a cursor
*How to set a cursor
*How to make a simple button
    N)(   r   )x   2   r   )   r   dataz
cursor.png   )zXX                      zXXX                     zXXXX                    zXX.XX                   zXX..XX                  zXX...XX                 zXX....XX                zXX.....XX               zXX......XX              zXX.......XX             zXX........XX            zXX........XXX           zXX......XXXXX           zXX.XXX..XX              zXXXX XX..XX             zXX   XX..XX             z     XX..XX                   XX..XX            r   z       XXXX             z       XX                                       r	   r	   )   r
   )r   r   X.o)blackwhitexorc                 C   s    | | d || d  |d k S )Nr    )mouse_pos_xmouse_pos_ycenter_xcenter_yradiusr   r   K/home/ubuntu/.local/lib/python3.10/site-packages/pygame/examples/cursors.pycheck_circleR   s    r   c            +   	   C   s  t   t jd t j  t jd d} t jd d}t jd}|d d}d}d}d}d}d}d}	d}
d}d	}d
}d}d}d}d}d}d}d}d}d}d}t j	|d|
|f|}t j	|d||f|}t j	|d||f|}t j	|d||f|}t j	|d||f|}t j	|d||f|}t j	|d||f|	}|
ddd}t j|ddd| d | d f} |j| jd}!|||! t j  tttttttg}"d}#t j|"|#  d}$t j }%	 |%d t j \}&}'t|&|'|j |j!|r
t j	|d|
|f|}nt j	|d|
|f|}t|&|'|j |j!|r,t j	|d||f|}nt j	|d||f|}t|&|'|j |j!|rNt j	|d||f|}nt j	|d||f|}t|&|'|j |j!|rpt j	|d||f|}nt j	|d||f|}t|&|'|j |j!|rt j	|d ||f|}nt j	|d||f|}t|&|'|j |j!|rt j	|d!||f|}nt j	|d||f|}t|&|'|j |j!|	rt j	|d"||f|	}nt j	|d||f|	}|ddd#| df | 
d$t j" j# d%dd}(|(j| d& dfd})||(|) t j|d'dd| d | d f} |||! | $|&|'rt j|d(dd| d | d f} |||! t j% d d)kr|$du rt j|d*dd| d | d f} |||! |#d)7 }#|#t&|"; }#t j|"|#  t j  t j'd t j% d d)krd}$nt j% d dkrd}$t j() D ]}*|*j#t j*krt +  t,qt j  q)+NzCursors Example   r
   )i  i  )         r   R            i2  ij  i        )   r#   r#   zClick here to change cursorT)r   r   r   )   r$   r$      i,     r   )centerr   F)r#   r   r   )r#      r   )r#   r#   r   )r   r#   r   )r   r   r#   )K   r      )   r         z
This is a z cursorr   )d         )<   r.   r#      )r   r   r%   )-pginitdisplayset_captionfontFontset_modefilldrawcirclerenderrect	get_width
get_heightget_rectr'   blitupdatesystem_cursor1color_cursorsystem_cursor2image_cursorsystem_cursor3bitmap_cursor1bitmap_cursor2mouse
set_cursortimeClocktickget_posr   centerxcentery
get_cursortypecollidepointget_pressedlendelayeventgetQUITquit
SystemExit)+r7   font1bgradius1radius2radius3radius4radius5radius6radius7pos_x1pos_x2pos_x3pos_x4pos_x5pos_x6pos_x7pos_y1pos_y2pos_y3pos_y4pos_y5pos_y6pos_y7circle1circle2circle3circle4circle5circle6circle7button_textbuttonbutton_text_rectcursorsindexpressedclockmouse_xmouse_ytext1
text_rect1rY   r   r   r   mainV   s  













r   __main__)$__doc__pygamer3   osSYSTEM_CURSOR_CROSSHAIRrD   SYSTEM_CURSOR_HANDrF   SYSTEM_CURSOR_IBEAMrH   Surfacesurfr:   r   CursorrE   pathsplitabspath__file__main_dirjoin
image_nameimageloadr?   r@   rG   thickarrow_stringscompilerI   diamondrJ   r   r   __name__r   r   r   r   <module>   s:   	

	 -
