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

C# TouchPoint类代码示例

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

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



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


示例16: processTouch

 protected override bool processTouch(TouchPoint touch, float dt)
 {
     _button.update(dt);
     if (_button.isTouchOn(Utils.touchPointToV2(touch)))
     {
         Hide();
     }
     return false;
 }
开发者ID:fordream,项目名称:Conquistador,代码行数:9,代码来源:TargetedDialogBox.cs


示例17: ShouldReceiveTouch

        public bool ShouldReceiveTouch(TouchLayer layer, TouchPoint touch)
        {
            if (layer == RenderTextureLayer)
#pragma warning disable 252,253
                return touch.InputSource == Source;
#pragma warning restore 252,253
#pragma warning disable 252,253
            return touch.InputSource != Source;
#pragma warning restore 252,253
        }
开发者ID:flatlineteam,项目名称:CartoonNetworkJam-Zer0,代码行数:10,代码来源:LayerDelegate.cs


示例18: BeginTouch

 internal bool BeginTouch(TouchPoint touch)
 {
     var result = beginTouch(touch);
     if (result == LayerHitResult.Hit)
     {
         touch.Layer = this;
         return true;
     }
     return false;
 }
开发者ID:keangame,项目名称:TouchScript,代码行数:10,代码来源:TouchLayer.cs


示例19: AddPoint

        {
            get; private set;
        }

        #endregion Properties

        #region Methods

        /// <summary>
        /// Adds the point.
        /// </summary>
        /// <param name="point">The point.</param>
        /// <returns></returns>
        public OperationResult AddPoint(TouchPoint point)
        {
开发者ID:gijs,项目名称:TouchScript,代码行数:15,代码来源:Cluster.cs


示例20: touchBegan

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

            if (NumTouches == 1) setState(GestureState.Began); 

            var data = getPointerData(touch);
            ExecuteEvents.Execute(gameObject, data.Data, ExecuteEvents.pointerEnterHandler);
            ExecuteEvents.Execute(gameObject, data.Data, ExecuteEvents.pointerDownHandler);
        }
开发者ID:guozanhua,项目名称:TouchScript,代码行数:11,代码来源:UIGesture.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Tower类代码示例发布时间:2022-05-24
下一篇:
C# TouchEventArgs类代码示例发布时间: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