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

C# CocosSharp.CCEvent类代码示例

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

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



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


示例16: onTouchesBegan

		void onTouchesBegan(List<CCTouch> touches, CCEvent touchEvent)
        {
			foreach (var it in touches)
            {
                CCTouch touch = it;
                var m_tBeginPos = touch.LocationOnScreen;
            }

        }
开发者ID:h7ing,项目名称:CocosSharp,代码行数:9,代码来源:BugsTestMainLayer.cs


示例17: OnTouchesMoved

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


示例18: onTouchBegan

		bool onTouchBegan(CCTouch touch, CCEvent touchEvent)
        {
            CCPoint touchLocation = touch.LocationOnScreen;

            CCPoint nodePosition = Layer.ScreenToWorldspace(touchLocation);
            //    NSLog(@"pos: %f,%f -> %f,%f", touchLocation.x, touchLocation.y, nodePosition.x, nodePosition.y);
            CCLog.Log("OnTouchBegan: " + nodePosition);
			return m_test.MouseDown(new b2Vec2(nodePosition.X, nodePosition.Y));

        }
开发者ID:KevinHeyer,项目名称:CocosSharp,代码行数:10,代码来源:Box2DView.cs


示例19: handleEndTouches

 //Handle all touches for this scene
 void handleEndTouches(System.Collections.Generic.List<CCTouch> touches, CCEvent touchEvent)
 {
     var touchLocation = touches[0].Location;
     //If play is hit
     if (play.BoundingBoxTransformedToWorld.ContainsPoint(touchLocation))
         GameLayer.getNewMap(GameView);
     //If quit is hit
     else if (quit.BoundingBoxTransformedToWorld.ContainsPoint(touchLocation))
         Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
 }
开发者ID:jacobmcrandall,项目名称:POOPCrawler,代码行数:11,代码来源:GameStart.cs


示例20: HandleTouchesBegan

		private void HandleTouchesBegan(List<CCTouch> touches, CCEvent touchEvent)
		{
			foreach (var item in touches)
			{
				if (item.Location.X > owner.ContentSize.Center.X)
				{
					touchedOnRightSide = true;
				}
			}
		}
开发者ID:PCChallas,项目名称:mobile-samples,代码行数:10,代码来源:TouchScreenInput.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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