当前位置: 首页>>代码示例>>C#>>正文


C# TouchCoordSys类代码示例

本文整理汇总了C#中TouchCoordSys的典型用法代码示例。如果您正苦于以下问题:C# TouchCoordSys类的具体用法?C# TouchCoordSys怎么用?C# TouchCoordSys使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TouchCoordSys类属于命名空间,在下文中一共展示了TouchCoordSys类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetMultiDragVel

	// -----------------------
	/// Get multi-touch drag velocity vector.
	// ------------------------
	public Vector2 GetMultiDragVel(
		TouchCoordSys	cs 			/* = TouchCoordSys.SCREEN_PX */	///< Coordinate system.	
		)
		{
		return TransformPos(this.multiDragVel, cs, true);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:9,代码来源:TouchZone.cs

示例2: GetStartPos

	// --------------------------
	/// Get touch start position
	// --------------------------- 
	public Vector2 GetStartPos(
		int 			fingerId, 							///< Finger ID (0 or 1)
		TouchCoordSys 	cs /* = TouchCoordSys.SCREEN_PX */	///< Coordinate system
		)
		{		
		Finger finger = ((fingerId == 1) ? this.fingerB : this.fingerA); 
		return this.TransformPos(finger.startPos, cs, false);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:11,代码来源:TouchZone.cs

示例3: GetDragVec

	/// \}

	

	// ---------------------------
	/// \name Touch Drag State 
	/// \{
	// ---------------------------


	// --------------------------
	/// Get touch total drag vector of specified finger.
	// --------------------------- 
	public Vector2 GetDragVec(
		int 			fingerId, 									///< Finger ID (0 or 1)
		TouchCoordSys 	cs 		/* = TouchCoordSys.SCREEN_PX */,	///< Coordinate system
		bool			raw 	/* = false */						///< When not in raw mode and drag didn't passed the threshold, zero vector will be returned. 
		)
		{		
		Finger finger = ((fingerId == 1) ? this.fingerB : this.fingerA);
		if (!raw && !finger.moved)
			return Vector2.zero;
 
		return this.TransformPos((finger.posCur - finger.startPos), cs, true);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:25,代码来源:TouchZone.cs

示例4: TransformPos

	// ---------------
	private Vector2 TransformPos(
		Vector2 					screenPosPx, 
		TouchCoordSys 	posType,
		bool						deltaMode)
		{
		Vector2 v = screenPosPx;
		
		if (!deltaMode && (
			(posType == TouchCoordSys.LOCAL_CM) || 
			(posType == TouchCoordSys.LOCAL_INCH) || 
			(posType == TouchCoordSys.LOCAL_NORMALIZED) || 
			(posType == TouchCoordSys.LOCAL_PX)) )
			{
			v.x -= this.screenRectPx.xMin;
			v.y -= this.screenRectPx.yMin;
			} 
		

		switch (posType)
			{
			case TouchCoordSys.SCREEN_PX :
			case TouchCoordSys.LOCAL_PX :
				return v;


			case TouchCoordSys.LOCAL_CM :
			case TouchCoordSys.SCREEN_CM :
				return (v / this.joy.GetDPCM());

			case TouchCoordSys.LOCAL_INCH :
			case TouchCoordSys.SCREEN_INCH :
				return (v / this.joy.GetDPI());

			case TouchCoordSys.SCREEN_NORMALIZED :
				v.x /= this.joy.GetScreenWidth();
				v.y /= this.joy.GetScreenHeight();
				return v;

			case TouchCoordSys.LOCAL_NORMALIZED :
				v.x /= this.screenRectPx.width;
				v.y /= this.screenRectPx.height;
				return v;
			}

		return v;
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:47,代码来源:TouchZone.cs

示例5: GetTapPos

		// ---------------
		public Vector2 GetTapPos(TouchCoordSys	cs)
			{
			//return TransformPos(this.lastTapPos, cs, false);
			return this.zone.TransformPos(this.lastTapPos, cs, false);
			}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:6,代码来源:TouchZone.cs

示例6: GetReleasedPinchEndDist

	// ---------------
	/// Get released multi-finger touch final finger distance.  
	// ---------------
	public float GetReleasedPinchEndDist(
		TouchCoordSys cs	/* = TouchCoordSys.SCREEN_PX */		///< Coordinate system.
		)
		{
		return (this.TransformPos(this.endedPinchDistEnd, cs));
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:9,代码来源:TouchZone.cs

示例7: GetReleasedPinchDistVel

	// ---------------
	/// Get released multi-finger pinch distance velocity.
	// ---------------
	public float GetReleasedPinchDistVel(
		TouchCoordSys 	cs 	/* = TouchCoordSys.SCREEN_PX */,	///< Coordinate system.
		bool			raw /* = false */						///< When not in raw mode, zero will be returned if released pinch didn't passed the threshold.
		)
		{
		if (!raw && !this.endedPinchMoved)
			return 0;

		return (this.TransformPos(this.endedPinchDistVel, cs));
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:13,代码来源:TouchZone.cs

示例8: GetMultiTapPos

	// ---------------
	/// Get last two-finger tap's position.
	// ------------------ 
	public Vector2 GetMultiTapPos(
		TouchCoordSys	cs	/* = TouchCoordSys.SCREEN_PX */	///< Coordinate system
		)
		{
		return TransformPos(this.lastMultiTapPos, cs, false);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:9,代码来源:TouchZone.cs

示例9: GetReleasedUniStartPos

	// ---------------------
	/// Get released unified-touch start position.
	// ---------------------
	public Vector2 GetReleasedUniStartPos(	
		TouchCoordSys	cs 	/* = TouchCoordSys.SCREEN_PX */	///< Coordinate system	
		)
		{
		return TransformPos(this.endedUniPosStart, cs, false);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:9,代码来源:TouchZone.cs

示例10: GetPinchDistDeltaRaw

	// --------------
	/// Shortcut for GetPinchDistDelta(cs, true)	
	// --------------
	public float GetPinchDistDeltaRaw(
		TouchCoordSys 	cs		///< Coordinate system. 	
		)
		{
		return this.GetPinchDistDelta(cs, true);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:9,代码来源:TouchZone.cs

示例11: GetPinchDistDelta

	// --------------
	/// Get finger distance delta relative to last update.	
	// --------------
	public float GetPinchDistDelta(
		TouchCoordSys 	cs	/* = TouchCoordSys.SCREEN_PX */,	///< Coordinate system. 	
		bool 			raw /* = false */						///< When not in raw mode, value of 0 will be returned until pinch moves.
		)
		{
		if (!this.multiCur || (!raw && !this.pinchMoved))
			return 0;
		
		return this.TransformPos(
			(this.pinchCurDist - (!raw && this.pinchJustMoved ? this.pinchDistStart : 
			this.pinchPrevDist)), cs);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:15,代码来源:TouchZone.cs

示例12: GetPinchDist

	// --------------
	/// Shortcut for GetPinchDist(cs, false)	
	// --------------
	public float GetPinchDist(
		TouchCoordSys 	cs 			///< Coordinate system. 	
		)
		{
		return this.GetPinchDist(cs, false);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:9,代码来源:TouchZone.cs

示例13: GetReleasedMultiDragVel

	// -----------------------
	/// Get released multi-touch drag velocity vector.
	// ------------------------
	public Vector2 GetReleasedMultiDragVel(
		TouchCoordSys	cs 	/* = TouchCoordSys.SCREEN_PX */	,	///< Coordinate system	
		bool			raw	/* = false */						///< When not in raw mode, zero-vector will be returned if released drag didn't passed the threshold.

		)
		{
		if (!raw && !this.endedMultiMoved)
			return Vector2.zero;
 
		return TransformPos(this.endedMultiDragVel, cs, true);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:14,代码来源:TouchZone.cs

示例14: GetReleasedEndPos

	// ---------------------
	/// Get released touch end position.
	// ---------------------
	public Vector2 GetReleasedEndPos(	
		int				fingerId, 									///< Finger ID (0 or 1)
		TouchCoordSys	cs 			/* = TouchCoordSys.SCREEN_PX */	///< Coordinate system	
		)
		{
		Finger finger = ((fingerId == 1) ? this.fingerB : this.fingerA); 
		return TransformPos(finger.endedPosEnd, cs, false);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:11,代码来源:TouchZone.cs

示例15: GetReleasedMultiDragVelRaw

	// -----------------------
	/// Shortcut for GetReleasedMultiDragVel(cs, true)
	// ------------------------
	public Vector2 GetReleasedMultiDragVelRaw(
		TouchCoordSys	cs			///< Coordinate system	
		)
		{
		return this.GetReleasedMultiDragVel(cs, true);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:9,代码来源:TouchZone.cs


注:本文中的TouchCoordSys类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。