예제 #1
0
	/// <summary>
	/// Creates a swipe detector with no related UI
	/// </summary>
	public static UISwipeDetector create( UIToolkit manager, Rect frame, int depth )
	{
		// create the swipe detector
		var detector = new UISwipeDetector( frame, depth, UIUVRect.zero );
		manager.addTouchableSprite( detector );
		
		return detector;
	}
예제 #2
0
    /// <summary>
    /// Creates a swipe detector with no related UI
    /// </summary>
    public static UISwipeDetector create(UIToolkit manager, Rect frame, int depth)
    {
        // create the swipe detector
        var detector = new UISwipeDetector(frame, depth, UIUVRect.zero);

        manager.addTouchableSprite(detector);

        return(detector);
    }
예제 #3
0
	/// <summary>
	/// Creates a swipe detector with a texture backing the hit area
	/// </summary>
	public static UISwipeDetector create( UIToolkit manager, string filename, int xPos, int yPos, int depth )
	{
		// grab the texture details
		var normalTI = manager.textureInfoForFilename( filename );
		var frame = new Rect( xPos, yPos, normalTI.frame.width, normalTI.frame.height );

		// create the swipe detector
		var detector = new UISwipeDetector( frame, depth, normalTI.uvRect );
		manager.addTouchableSprite( detector );
		
		return detector;
	}
예제 #4
0
    /// <summary>
    /// Creates a swipe detector with a texture backing the hit area
    /// </summary>
    public static UISwipeDetector create(UIToolkit manager, string filename, int xPos, int yPos, int depth)
    {
        // grab the texture details
        var normalTI = manager.textureInfoForFilename(filename);
        var frame    = new Rect(xPos, yPos, normalTI.frame.width, normalTI.frame.height);

        // create the swipe detector
        var detector = new UISwipeDetector(frame, depth, normalTI.uvRect);

        manager.addTouchableSprite(detector);

        return(detector);
    }
예제 #5
0
 // Swipe callback
 public void onSwipe( UISwipeDetector sender, SwipeDirection direction )
 {
     swipeText.text = direction.ToString();
 }
예제 #6
0
    void Start()
    {
        var swipeDetector = UISwipeDetector.create(new Rect(0, 0, Screen.width, Screen.height), 1);

        swipeDetector.onSwipe += detectedSwipe;
    }
예제 #7
0
 void detectedSwipe(UISwipeDetector sender, SwipeDirection direction)
 {
     Debug.Log("swipe direction: " + direction);
 }
예제 #8
0
	void detectedSwipe( UISwipeDetector sender, SwipeDirection direction )
	{
		Debug.Log( "swipe direction: " + direction );
	}
예제 #9
0
 // Swipe callback
 public void onSwipe(UISwipeDetector sender, SwipeDirection direction)
 {
     swipeText.text = direction.ToString();
 }