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


C# TouchPoint类代码示例

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


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

示例1: checkHitUI

 public UIComponent checkHitUI(TouchPoint p) {
     foreach (UIComponent c in componentList)
     {
         return c.processTouchPoint(p);
     }
     return null;
 }
开发者ID:jdddog,项目名称:jengasimulatorp4p,代码行数:7,代码来源:Overlay.cs

示例2: processTouchPoint

        public override UIComponent processTouchPoint(TouchPoint p)
        {
            if (p != null)
            {
                if (componentArea.Contains(new Point((int)p.X, (int)p.Y)))
                {
                    if (verticalScroller)
                    {
                        float dFromTop;
                        dFromTop = (float)(p.Y - componentArea.Y);
                        slideRatio = dFromTop / componentArea.Height;

                        indicatorArea = new Rectangle(componentArea.X, (int)(slideRatio * componentArea.Height) + componentArea.Y - (defaultTexture.Width /2) , defaultTexture.Width, defaultTexture.Width);
                    }
                    else {
                        float dFromLeft;
                        dFromLeft = (float)(p.X - componentArea.X);
                        slideRatio = dFromLeft / componentArea.Width;
                        
                        indicatorArea = new Rectangle((int)(slideRatio * componentArea.Width) + componentArea.X - (defaultTexture.Height / 2), componentArea.Y, defaultTexture.Height, defaultTexture.Height);                    
                    }
                    updateListeners();
                    return this;
                }
            }
            return null;
        }
开发者ID:jdddog,项目名称:jengasimulatorp4p,代码行数:27,代码来源:SliderBar.cs

示例3: processDrag

        public bool processDrag(TouchPoint touch, float dt)
        {
            //If the window is touch or a previous touch is still going on
            if (_area.Contains((int)touch.X, (int)touch.Y) || _touchId == touch.Id)
            {

                Vector2 newPos = new Vector2(touch.X, touch.Y);

                Vector2 bckUpPos = _position;
                _position = newPos;
                Rectangle newArea = computeUIArea(this);
                _position = bckUpPos;

                if (!MyGame.ScreenArea.Contains(newArea) || MyGame.MapArea.Intersects(newArea))
                {
                    newPos = _position;
                }

                _velocity = (_velocity * NB_MOVE_RECORDED + (newPos - _position) / dt * SPEED_COEF) / (NB_MOVE_RECORDED + 1f);

                _position = newPos;
                _area = computeUIArea(this);
                _touchId = touch.Id;
                _touchReleased = false;

                //A touch should only move one UI window
                return true;
            }
            else
            {
                _touchReleased = true;
                return false;
            }
        }
开发者ID:fordream,项目名称:Conquistador,代码行数:34,代码来源:SmallPlayerUI.cs

示例4: TouchZone

		protected TouchZone(string name, TouchConfiguration touchConfiguration, int[,] mask)
		{
			Name = name;
			_touchConfiguration = touchConfiguration;
			Mask = mask;
			_current = new TouchPoint();
		}
开发者ID:ababilone,项目名称:touchmousemate,代码行数:7,代码来源:TouchZone.cs

示例5: UpdateTouches

    public static List<TouchPoint> UpdateTouches()
    {
        _Touches.Clear();
        _TouchIDs.Clear();
        LastCheck = Time.time;

        if (Input.touchCount > 0) {
            for (int i = 0; i < Input.touchCount; i++) {
                Touch touch = Input.GetTouch(i);
                Vector3 pos = Camera.main.ScreenToWorldPoint(touch.position);
                var touchPoint = new TouchPoint {
                    ID = touch.fingerId,
                    Position = pos,
                    Phase = touch.phase
                };

                _Touches.Add(touchPoint);
                _TouchIDs.Add(touchPoint.ID, touchPoint);
            }
        }
        else if (Input.GetMouseButton(0) || Input.GetMouseButtonUp(0)) {
            Vector3 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            TouchPhase phase = Input.GetMouseButtonDown(0) ? TouchPhase.Began : Input.GetMouseButtonUp(0) ? TouchPhase.Ended : TouchPhase.Moved;
            var touchPoint = new TouchPoint {
                ID = 1,
                Position = pos,
                Phase = phase
            };

            _Touches.Add(touchPoint);
            _TouchIDs.Add(touchPoint.ID, touchPoint);
        }

        return _Touches;
    }
开发者ID:Mykaelos,项目名称:MykaelosUnityLibrary,代码行数:35,代码来源:TouchManager.cs

示例6: TouchMove

        public void TouchMove(object sdr, Type t, TouchDevice touchDevice, TouchPoint touchPoint)
        {
            My_Point point = Point_List.UpdatePoint(sdr, t, touchDevice.Id, touchPoint);
            if (point != null && (t == typeof(Card_Layer)))
            {
                ///Show gesture indicator

                //if (point.Life > STATICS.MIN_GESTURE_LIFE)
                //{
                //    FrameworkElement sender = point.Sender as FrameworkElement;

                //    lock (Point_List.TouchPointList)
                //    {
                //        if (!mainWindow.GestureIndicatorLayer.Contain(touchDevice.Id))
                //        {
                //            mainWindow.GestureIndicatorLayer.Add(touchDevice.Id, touchPoint.Position);
                //        }
                //        else
                //        {
                //            mainWindow.GestureIndicatorLayer.Move(touchDevice.Id, touchPoint.Position);
                //        }
                //    }
                //}
            }
        }
开发者ID:nius1989,项目名称:CardDesign_TechSnack,代码行数:25,代码来源:Touch_Controler.cs

示例7: updateOnce

        /// <inheritdoc />
        protected override void updateOnce(TouchPoint touch)
        {
            base.updateOnce(touch);

            stringBuilder.Length = 0;
            stringBuilder.Append("Touch id: ");
            stringBuilder.Append(touch.Id);
            gameObject.name = stringBuilder.ToString();

            if (Text == null) return;
            if (!ShowTouchId && !ShowTags) return;

            stringBuilder.Length = 0;
            if (ShowTouchId)
            {
                stringBuilder.Append("Id: ");
                stringBuilder.Append(touch.Id);
            }
            if (ShowTags)
            {
                if (stringBuilder.Length > 0) stringBuilder.Append("\n");
                stringBuilder.Append("Tags: ");
                stringBuilder.Append(touch.Tags.ToString());
            }
            Text.text = stringBuilder.ToString();
        }
开发者ID:oafkad,项目名称:TouchScript,代码行数:27,代码来源:TouchProxy.cs

示例8: Awake

    void Awake()
    {
        //ステート
        state.setState(GameState.NotPlaying);
        //デブ
        GameObject g = (GameObject)Resources.Load("Debu");
        debu = (GameObject)Instantiate(g, g.transform.position, g.transform.rotation);

        //プレイヤー
        target = GameObject.Find("PlayerSibo");

        //ポジション
        defaultPosition = transform.position;
        defaultAngles = transform.eulerAngles;
        rotate = new Vector3(0, 10f, 0);
        approachPoint = target.transform.position - transform.position;

        //フォグ
        g = (GameObject)Resources.Load("TransformFog");
        transformFog =
        (GameObject)Instantiate(g, g.transform.position, g.transform.rotation);
        transformFog.SetActive(false);

        //スキップ
        skip = false;

        //タッチパッド
        touchPoint = FindObjectOfType<TouchPoint>();
    }
开发者ID:saihe,项目名称:July_Unity_TeamMJ,代码行数:29,代码来源:RotateCamera.cs

示例9: GetDelta

        private double GetDelta(TouchPoint tpOne, TouchPoint tpTwo)
        {
            double tpOneYPos = tpOne.Position.Y;
            double tpTwoYPos = tpTwo.Position.Y;

            return tpOneYPos > tpTwoYPos ? tpOneYPos - tpTwoYPos : tpTwoYPos - tpOneYPos;
        }
开发者ID:jjchiw,项目名称:WP7-ClearStyle,代码行数:7,代码来源:PinchAddNewInteraction.cs

示例10: IsUnderneath

        public bool IsUnderneath(TouchPoint t)
        {
            var tx = t.CenterX;
            var ty = t.CenterY;

            return (tx > x && tx < x + w && ty > y && ty < y + h);
        }
开发者ID:Fojar,项目名称:VizFountainSurface,代码行数:7,代码来源:Sketchy.cs

示例11: Tap

 public void Tap(TouchPoint tp)
 {
     if (hasActiveId && activeId == tp.Id)
     {
         tapedPoint = new Point((int)tp.CenterX, (int)tp.CenterY);
         taped = true;
     }
 }
开发者ID:poksme,项目名称:TetriClimber,代码行数:8,代码来源:TouchRec.cs

示例12: ShouldReceiveTouch

        /// <inheritdoc />
        public override bool ShouldReceiveTouch(TouchPoint touch)
        {
            if (!IgnoreChildren) return base.ShouldReceiveTouch(touch);
            if (!base.ShouldReceiveTouch(touch)) return false;

            if (touch.Target != cachedTransform) return false;
            return true;
        }
开发者ID:guozanhua,项目名称:TouchScript,代码行数:9,代码来源:ReleaseGesture.cs

示例13: Down

 public void Down(TouchPoint tp)
 {
     if (hasActiveId)
         return;
     hasActiveId = true;
     activeId = tp.Id;
     startingPos = new Vector2(tp.CenterX, tp.CenterY);
     actualPos = new Vector2(tp.CenterX, tp.CenterY);
 }
开发者ID:poksme,项目名称:TetriClimber,代码行数:9,代码来源:TouchRec.cs

示例14: IsTouchOnTarget

 /// <summary>
 /// Determines whether the touch is over a specific GameObject.
 /// </summary>
 /// <param name="touch"> The touch. </param>
 /// <param name="target"> The target. </param>
 /// <returns> <c>true</c> if the touch is over the GameObject; <c>false</c> otherwise.</returns>
 public static bool IsTouchOnTarget(TouchPoint touch, Transform target)
 {
     if (touch == null || touch.Layer == null || target == null) return false;
     TouchHit hit;
     if ((touch.Layer.Hit(touch.Position, out hit) == TouchLayer.LayerHitResult.Hit) &&
         (target == hit.Transform || hit.Transform.IsChildOf(target)))
         return true;
     return false;
 }
开发者ID:RabitBox,项目名称:FlickBattler,代码行数:15,代码来源:TouchUtils.cs

示例15: CheckAndHandleTap

 public virtual bool CheckAndHandleTap(TouchPoint t)
 {
     if (IsUnderneath(t))
     {
         action();
         return true;
     }
     else return false;
 }
开发者ID:Fojar,项目名称:VizFountainSurface,代码行数:9,代码来源:Sketchy.cs


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