コード例 #1
0
 public override void TouchesEnded(List <CCTouch> touches)
 {
     foreach (var item in touches)
     {
         CCTouch    touch = item;
         TouchPoint pTP   = s_dic[touch.Id];
         RemoveChild(pTP, true);
         s_dic.Remove(touch.Id);
     }
 }
コード例 #2
0
 public override void TouchesMoved(List <CCTouch> touches)
 {
     foreach (var item in touches)
     {
         CCTouch    touch    = item;
         TouchPoint pTP      = s_dic[touch.Id];
         CCPoint    location = touch.Location;
         pTP.SetTouchPos(location);
     }
 }
コード例 #3
0
 void onTouchesMoved(List <CCTouch> touches, CCEvent touchEvent)
 {
     foreach (var item in touches)
     {
         CCTouch    touch    = item;
         TouchPoint pTP      = s_dic[touch.Id];
         CCPoint    location = touch.LocationOnScreen;
         location = Layer.ScreenToWorldspace(location);
         pTP.SetTouchPos(location);
     }
 }
コード例 #4
0
        void onTouchesBegan(List <CCTouch> touches, CCEvent touchEvent)
        {
            foreach (var item in touches)
            {
                CCTouch    touch      = (item);
                TouchPoint touchPoint = TouchPoint.TouchPointWithParent(this);
                CCPoint    location   = touch.Location;
                touchPoint.SetTouchPos(location);
                touchPoint.SetTouchColor(s_TouchColors[touch.Id % 5]);

                AddChild(touchPoint);
                s_dic.Add(touch.Id, touchPoint);
            }
        }
コード例 #5
0
        public override void TouchesBegan(List <CCTouch> touches)
        {
            foreach (var item in touches)
            {
                CCTouch    touch      = (item);
                TouchPoint touchPoint = TouchPoint.TouchPointWithParent(this);
                CCPoint    location   = touch.Location;

                touchPoint.SetTouchPos(location);
                touchPoint.SetTouchColor(s_TouchColors[touch.Id % s_TouchColors.Length]);

                AddChild(touchPoint);
                s_dic.Add(touch.Id, touchPoint);
            }
        }
コード例 #6
0
ファイル: MultiTouchTest.cs プロジェクト: netonjm/CocosSharp
        public static TouchPoint TouchPointWithParent(CCNode pParent)
        {
            TouchPoint pRet = new TouchPoint();
            pRet.ContentSize = pParent.ContentSize;
			pRet.AnchorPoint = CCPoint.AnchorLowerLeft;
            return pRet;
        }
コード例 #7
0
ファイル: MultiTouchTest.cs プロジェクト: Karunp/cocos2d-xna
 public static TouchPoint TouchPointWithParent(CCNode pParent)
 {
     TouchPoint pRet = new TouchPoint();
     pRet.ContentSize = pParent.ContentSize;
     pRet.AnchorPoint = new CCPoint(0.0f, 0.0f);
     return pRet;
 }