BBGamelib.CCScrollLayer.ccTouchEnded C# (CSharp) Method

ccTouchEnded() public method

public ccTouchEnded ( UITouch touch ) : void
touch UITouch
return void
		public override void ccTouchEnded (UITouch touch)
		{
			if( scrollTouch_ != touch ) 
				return;
			scrollTouch_ = null;

			Vector2 touchPoint = this.convertTouchToNodeSpace (touch);
			touchPoint = this.convertToWorldSpace (touchPoint);
			
			int selectedPage = currentScreen_;
			float delta = touchPoint.x - startSwipe_;
			if (Mathf.Abs(delta) >= this.minimumTouchLengthToChangePage)
			{
				selectedPage = this.pageNumberForPosition(this.position);
				if (selectedPage == currentScreen_)
				{
					if (delta < 0.0f && selectedPage < layers_.Count - 1)
						selectedPage++;
					else if (delta > 0.0f && selectedPage > 0)
						selectedPage--;
				}
			}
			this.moveToPage(selectedPage);
		}
	}