• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TouchCoordSys类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetReleasedMultiEndPos

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


示例17: GetReleasedPinchExtremeDistDiff

	// -------------
	/// Get most extreme finger distance difference since start.
	// -------------
	public float GetReleasedPinchExtremeDistDiff(
		TouchCoordSys cs = 
			TouchCoordSys.SCREEN_PX	///< Coordinate system.
		)
		{
		return (this.TransformPos(this.endedPinchExtremeDistDelta, cs));
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:10,代码来源:TouchZone.cs


示例18: GetReleasedExtremeDist

	/// \endcond


#if CF_EXTREME_QUERY_FUNCTIONS

	// -----------------------
	/// Get the most extreme drag distance of last released touch.
	// ------------------------
	public float GetReleasedExtremeDist(
		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.endedExtremeDragDist, cs);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:17,代码来源:TouchZone.cs


示例19: GetReleasedPinchDistVelRaw

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


示例20: GetReleasedExtremeVec

	// -----------------------
	/// Get the most extreme drag along each axis of last released touch.
	// ------------------------
	public Vector2 GetReleasedExtremeVec(
		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.endedExtremeDragVec, cs, true);
		}
开发者ID:EunoiaGames,项目名称:MTW,代码行数:12,代码来源:TouchZone.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TouchEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# TouchCollection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap