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


C# CocosSharp.CCEvent类代码示例

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


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

示例1: OnTouchesEnded

        void OnTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
        {
            if (touches.Count > 0)
            {

            }
        }
开发者ID:coroner4817,项目名称:MyBouncingGame,代码行数:7,代码来源:TouchScreenInput.cs

示例2: OnTouchesEnded

 void OnTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
 {
     if (touches.Count > 0)
     {
         // Perform touch handling here
     }
 }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:7,代码来源:Arcs2.cs

示例3: onTouchMoved

		void onTouchMoved(CCTouch touch, CCEvent touchEvent)
        {
            CCPoint touchLocation = touch.Location;
            CCPoint nodePosition = ConvertToNodeSpace(touchLocation);

            m_test.MouseMove(new Vector2(nodePosition.X, nodePosition.Y));
        }
开发者ID:h7ing,项目名称:CocosSharp,代码行数:7,代码来源:Box2DView.cs

示例4: OnTouchesBegan

        public void OnTouchesBegan(List<CCTouch> touches, CCEvent touchEvent)
        {
            CCTouch touch = touches.FirstOrDefault();
            CCPoint location = touch.Location;

            List<CCPhysicsShape> shapes = Scene.PhysicsWorld.GetShapes(location);

            CCPhysicsBody body = null;

            foreach (var obj in shapes)
            {
                if ((obj.Body.Tag & DRAG_BODYS_TAG) != 0)
                {
                    body = obj.Body;
                    break;
                }
            }

            if (body != null)
            {
                CCNode mouse = new CCNode();

                mouse.PhysicsBody = new CCPhysicsBody();
                mouse.PhysicsBody.IsDynamic = false;
                mouse.Position = location;
                AddChild(mouse);

                CCPhysicsJointPin join = CCPhysicsJointPin.Construct(mouse.PhysicsBody, body, location);
                join.SetMaxForce(5000 * body.GetMass());
                Scene.PhysicsWorld.AddJoint(join);
                mouses.Add(touch.Id, mouse);

            }
        }
开发者ID:netonjm,项目名称:RubeLoader,代码行数:34,代码来源:IntroLayer.cs

示例5: OnTouchesEnded

 public void OnTouchesEnded(List<CCTouch> touches, CCEvent e)
 {
     if (!win)
     {
         foreach (CCTouch touch in touches)
         {
             for (int i = 0; i < botones.Length; i++)
             {
                 if (GameData.CheckIfSpriteTouched(touch, botones[i]))
                 {
                     if (llamando == i + 1  && jugadoresActivos[i])
                     {
                         debug.Text = "Correcto!";
                         debug.Color = GetColorJugador(i + 1);
                         contesto = true;
                         CCSimpleAudioEngine.SharedEngine.PlayEffect("sounds/coin");
                     }
                     else
                     {
                         DerrotaJugador(i + 1);
                     }
                 }
             }
         }
     }
     else {
         ReturnToMenu();
     }
 }
开发者ID:sanslash332,项目名称:codename-the-great-and-powerful-phone-party,代码行数:29,代码来源:DictadoLayercs.cs

示例6: onTouchesEnded

		void onTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
        {
            //base.ccTouchesEnded(touches, event_);
            object it = touches.First();
            CCTouch touch = (CCTouch)(it);

            var convertedLocation = touch.Location;

            CCNode s = this[ClickAndMoveTest.kTagSprite];
            s.StopAllActions();
            s.RunAction(new CCMoveTo (1, new CCPoint(convertedLocation.X, convertedLocation.Y)));
            float o = convertedLocation.X - s.Position.X;
            float a = convertedLocation.Y - s.Position.Y;
            float at = (float)(Math.Atan(o / a) * 57.29577951f);

            if (a < 0)
            {
                if (o < 0)
                    at = 180 + Math.Abs(at);
                else
                    at = 180 - Math.Abs(at);
            }

            s.RunAction(new CCRotateTo (1, at));
        }
开发者ID:h7ing,项目名称:CocosSharp,代码行数:25,代码来源:ClickAndMoveTest.cs

示例7: OnTouchEnded

 void OnTouchEnded(CCTouch  touch, CCEvent  touchEvent)
 {
     bool hits = touchHits(touch);
     if (hits && Triggered != null)
         Triggered(this, EventArgs.Empty);
     scaleButtonTo(1);
 }
开发者ID:haithemaraissia,项目名称:CocosSharp,代码行数:7,代码来源:CocosDenshionTest.cs

示例8: HandleTouchesMoved

        void HandleTouchesMoved(System.Collections.Generic.List<CCTouch> touches, CCEvent touchEvent)
        {
            // we only care about the first touch:
            var locationOnScreen = touches [0].Location;

            paddleSprite.PositionX = locationOnScreen.X;
        }
开发者ID:jonathanzuniga,项目名称:BouncingGame,代码行数:7,代码来源:GameLayer.cs

示例9: onTouchesEnded

		void onTouchesEnded(List<CCTouch> pTouches, CCEvent touchEvent)
        {
            drag = false;
            snapArrowsToEdge();

            arrowsBar.Visible = false;
            UpdateLineHeight();
        }
开发者ID:KevinHeyer,项目名称:CocosSharp,代码行数:8,代码来源:LabelFNTLineHeightTest.cs

示例10: OnTouchBegan

            bool OnTouchBegan(CCTouch touch, CCEvent touchEvent)
            {
                bool hits = touchHits(touch);
                if (hits)
                    scaleButtonTo(0.9f);

                return hits;
            }
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:8,代码来源:GameLayer.cs

示例11: HandleTouchesEnded

 private void HandleTouchesEnded(System.Collections.Generic.List<CCTouch> touches, CCEvent touchEvent)
 {
     foreach (CCTouch Touch in touches) {
         if (startGame != null) {
             startGame ();
         }
     }
 }
开发者ID:Nuckal777,项目名称:mapKnight,代码行数:8,代码来源:StartScene.cs

示例12: onTouchBegan

		bool onTouchBegan(CCTouch touch, CCEvent touchEvent)
        {
            if (m_state != PaddleState.kPaddleStateUngrabbed) return false;
            if (!containsTouchLocation(touch)) return false;

            m_state = PaddleState.kPaddleStateGrabbed;
            return true;
        }
开发者ID:netonjm,项目名称:CocosSharp,代码行数:8,代码来源:Paddle.cs

示例13: OnTouchesEnded

 public void OnTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
 {
     foreach (CCTouch touch in touches) {
         if (touch == Touch) {
             Touch = null;
             return;
         }
     }
 }
开发者ID:AndyDentFree,项目名称:xfcs-play,代码行数:9,代码来源:DragSprite.cs

示例14: onTouchesMoved

		void onTouchesMoved(List<CCTouch> touches, CCEvent touchEvent)
        {

			var diff = touches[0].Delta;

			var node = GetChildByTag((int)KTag.kTagNode);
			var currentPos = node.Position;
			node.Position = currentPos + diff;
        }
开发者ID:KevinHeyer,项目名称:CocosSharp,代码行数:9,代码来源:Parallax2.cs

示例15: OnTouchesEnded

 /// <summary>
 /// If the touch is ended return the visbility of this layer and reverse it.
 /// </summary>
 /// <returns><c>true</c> if this layer is visible; otherwise, <c>false</c>.</returns>
 /// <param name="touches">The touches list.</param>
 /// <param name="touchEvent">The touch event.</param>
 public bool OnTouchesEnded(List<CCTouch> touches, CCEvent touchEvent)
 {
     if (Visible)
     {
         Visible = !Visible;
         return true;
     }
     return false;
 }
开发者ID:Lopt,项目名称:ascendancy,代码行数:15,代码来源:DebugLayer.cs


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