ó
Ä‚Œ\c           @  s~   d  d l  m Z d  d l Z d  d l Z d  d l Z d d d d d d d	 d
 g Z d „  Z d e f d „  ƒ  YZ	 e	 ƒ  Z
 d S(   iÿÿÿÿ(   t   print_functionNt   nt   net   et   set   st   swt   wt   nwc         C  sM   t  j j j |  d ƒ } | d k	 rI t  j j | ƒ t  j j j	 ƒ  ‚ n  d S(   sC   
    This is called with a gesture to dispatch it as an event.
    N(
   t   renpyt   configt   gesturest   gett   Nonet   exportst   queue_eventt   displayt   coret   IgnoreEvent(   t   gesturet   event(    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\gesture.pyt   dispatch_gesture   s    t   GestureRecognizerc           B  s>   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C  s)   t  t |  ƒ j ƒ  d  |  _ d  |  _ d  S(   N(   t   superR   t   __init__R   t   xt   y(   t   self(    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\gesture.pyR   ,   s    	c         C  sc   | |  _  | |  _ t j j t j j |  _ t j j t j j |  _ d  |  _
 d |  _ g  |  _ d  S(   Ni    (   R   R   R	   R
   t   screen_widtht   gesture_component_sizet   min_componentt   gesture_stroke_sizet
   min_strokeR   t   current_stroket   stroke_lengtht   strokes(   R   R   R   (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\gesture.pyt   start2   s    				c         C  s/  |  j  d  k r d  S| |  j  } | |  j } t j | | ƒ } | |  j k  rR d  S| |  _  | |  _ t j | | ƒ d t j d } | d k  rŸ | d 7} n  t t	 | d ƒ } | |  j
 k rÔ |  j | 7_ n | |  _
 | |  _ |  j |  j k r+|  j s|  j d | k r+|  j j | ƒ q+n  d  S(   Ni´   g     €6@i    ih  i-   iÿÿÿÿ(   R   R   R   t   matht   hypotR   t   atan2t   pit
   DIRECTIONSt   intR!   R"   R    R#   t   append(   R   R   R   t   dxt   dyt   lengtht   anglet   stroke(    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\gesture.pyt
   take_pointE   s(    		"		c         C  st   d  } |  j d  k r d  S|  j r^ t j j } | d  k rC t } n  | d j |  j ƒ ƒ } n  d  |  _ d  |  _ | S(   Nt   _(   R   R   R#   R	   R
   R   t   joinR   (   R   t   rvt   func(    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\gesture.pyt   finishe   s    				c         C  s   d  |  _ d  |  _ d  S(   N(   R   R   R   (   R   (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\gesture.pyt   cancelx   s    	c         C  sœ   | j  t j k r% |  j | | ƒ ns | j  t j k rZ | j d r˜ |  j | | ƒ q˜ n> | j  t j k r˜ |  j | | ƒ | j d k r˜ |  j	 ƒ  Sn  d  S(   Ni    i   (
   t   typet   pygamet   MOUSEBUTTONDOWNR$   t   MOUSEMOTIONt   buttonsR1   t   MOUSEBUTTONUPt   buttonR6   (   R   t   evR   R   (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\gesture.pyR   |   s    (   t   __name__t
   __module__R   R$   R1   R6   R7   R   (    (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\gesture.pyR   *   s   			 		(   t
   __future__R    R9   R%   t   renpy.displayR	   R)   R   t   objectR   t
   recognizer(    (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\gesture.pyt   <module>   s   	a