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


C# cocos2d.CCNode类代码示例

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


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

示例1: showCurrentTest

        public override void showCurrentTest()
        {
            CCNode ccnode = new CCNode();
            ParticleMainScene pScene = (ParticleMainScene)ccnode.parent;
            int subTest = pScene.getSubTestNum();
            int parNum = pScene.getParticlesNum();

            ParticleMainScene pNewScene = null;

            switch (m_nCurCase)
            {
                case 0:
                    pNewScene = new ParticlePerformTest1();
                    break;
                case 1:
                    pNewScene = new ParticlePerformTest2();
                    break;
                case 2:
                    pNewScene = new ParticlePerformTest3();
                    break;
                case 3:
                    pNewScene = new ParticlePerformTest4();
                    break;
            }

            PerformanceParticleTest.s_nParCurIdx = m_nCurCase;
            if (pNewScene != null)
            {
                pNewScene.initWithSubTest(subTest, parNum);

                CCDirector.sharedDirector().replaceScene(pNewScene);
            }
        }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:33,代码来源:ParticleMenuLayer.cs

示例2: OnHandlePropTypeSpriteFrame

 protected override void OnHandlePropTypeSpriteFrame(CCNode node, CCNode parent, string propertyName, CCSpriteFrame spriteFrame,
                                                     CCBReader reader)
 {
     if (propertyName == PROPERTY_NORMALDISPLAYFRAME)
     {
         if (spriteFrame != null)
         {
             ((CCMenuItemImage) node).SetNormalSpriteFrame(spriteFrame);
         }
     }
     else if (propertyName == PROPERTY_SELECTEDDISPLAYFRAME)
     {
         if (spriteFrame != null)
         {
             ((CCMenuItemImage) node).SetSelectedSpriteFrame(spriteFrame);
         }
     }
     else if (propertyName == PROPERTY_DISABLEDDISPLAYFRAME)
     {
         if (spriteFrame != null)
         {
             ((CCMenuItemImage) node).SetDisabledSpriteFrame(spriteFrame);
         }
     }
     else
     {
         base.OnHandlePropTypeSpriteFrame(node, parent, propertyName, spriteFrame, reader);
     }
 }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:29,代码来源:CCMenuItemImageLoader.cs

示例3: startWithTarget

        public override void startWithTarget(CCNode pTarget)
        {
            base.startWithTarget(pTarget);

            CCGridBase newgrid = this.getGrid();

            CCNode t = m_pTarget;
            CCGridBase targetGrid = t.Grid;

            if (targetGrid != null && targetGrid.ReuseGrid > 0)
            {
                if (targetGrid.Active && targetGrid.GridSize.x == m_sGridSize.x
                    && targetGrid.GridSize.y == m_sGridSize.y)
                {
                    targetGrid.reuse();
                }
            }
            else
            {
                if (targetGrid != null && targetGrid.Active)
                {
                    targetGrid.Active = false;
                }

                t.Grid = newgrid;
                t.Grid.Active = true;
            }
        }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:28,代码来源:CCGridAction.cs

示例4: showCurrentTest

        public override void showCurrentTest()
        {
            CCNode ccnode = new CCNode();
            int nNodes = ((NodeChildrenMainScene)ccnode.parent).getQuantityOfNodes();
            NodeChildrenMainScene pScene = null;

            switch (PerformBasicLayer.m_nCurCase)
            {
                //     case 0:
                //         pScene = new IterateSpriteSheetFastEnum();
                //         break;
                case 0:
                    pScene = new IterateSpriteSheetCArray();
                    break;
                case 1:
                    pScene = new AddSpriteSheet();
                    break;
                case 2:
                    pScene = new RemoveSpriteSheet();
                    break;
                case 3:
                    pScene = new ReorderSpriteSheet();
                    break;
            }

            PerformanceNodeChildrenTest.s_nCurCase = PerformBasicLayer.m_nCurCase;

            if (pScene != null)
            {
                pScene.initWithQuantityOfNodes(nNodes);

                CCDirector.sharedDirector().replaceScene(pScene);
            }
        }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:34,代码来源:NodeChildrenMenuLayer.cs

示例5: addAction

        // actions

        /// <summary>
        /// Adds an action with a target. 
        ///  If the target is already present, then the action will be added to the existing target.
        ///  If the target is not present, a new instance of this target will be created either paused or not, and the action will be added to the newly created target.
        ///  When the target is paused, the queued actions won't be 'ticked'.
        /// </summary>
        public void addAction(CCAction action, CCNode target, bool paused)
        {
            Debug.Assert(action != null);
            Debug.Assert(target != null);

            tHashElement element = null;
            if (!m_pTargets.ContainsKey(target))
            {
                element = new tHashElement();
                element.paused = paused;
                element.target = target;
                m_pTargets.Add(target, element);
            }
            else
            {
                element = m_pTargets[target];
            }

            actionAllocWithHashElement(element);

            Debug.Assert(!element.actions.Contains(action));
            element.actions.Add(action);

            action.startWithTarget(target);
        }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:33,代码来源:CCActionManager.cs

示例6: GetActionByTag

        public CCAction GetActionByTag(int tag, CCNode target)
        {
            Debug.Assert(tag != (int) ActionTag.kCCActionTagInvalid);

            HashElement element;
            if (m_pTargets.TryGetValue(target, out element))
            {
                if (element.Actions != null)
                {
                    int limit = element.Actions.Count;
                    for (int i = 0; i < limit; i++)
                    {
                        CCAction action = element.Actions[i];

                        if (action.Tag == tag)
                        {
                            return action;
                        }
                    }
                    CCLog.Log("cocos2d : getActionByTag: Tag " + tag + " not found");
                }
            }
            else
            {
                CCLog.Log("cocos2d : getActionByTag: Target not found");
            }
            return null;
        }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:28,代码来源:CCActionManager.cs

示例7: StartWithTarget

        public override void StartWithTarget(CCNode target)
        {
            base.StartWithTarget(target);

            CCNode t = m_pTarget;
            CCGridBase targetGrid = t.Grid;

            if (targetGrid != null && targetGrid.ReuseGrid > 0)
            {
                Grid = targetGrid;

                if (targetGrid.Active && targetGrid.GridSize.X == m_sGridSize.X
                    && targetGrid.GridSize.Y == m_sGridSize.Y /*&& dynamic_cast<CCGridBase*>(targetGrid) != NULL*/)
                {
                    targetGrid.Reuse();
                }
                else
                {
                    Debug.Assert(false);
                }
            }
            else
            {
                if (targetGrid != null && targetGrid.Active)
                {
                    targetGrid.Active = false;
                }

                CCGridBase newgrid = Grid;

                t.Grid = newgrid;
                t.Grid.Active = true;
            }
        }
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:34,代码来源:CCGridAction.cs

示例8: addChild

 // super methods
 public virtual void addChild(CCNode child, UInt32 zOrder, int tag)
 {
     //    CC_UNUSED_PARAM(zOrder);
     //    CC_UNUSED_PARAM(child);
     //    CC_UNUSED_PARAM(tag);
     Debug.Assert(false, "ParallaxNode: use addChild:z:parallaxRatio:positionOffset instead");
 }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:8,代码来源:CCParallaxNode.cs

示例9: startWithTarget

 public override void startWithTarget(CCNode pTarget)
 {
     base.startWithTarget(pTarget);
     m_fDeltaX = m_fSkewX;
     m_fDeltaY = m_fSkewY;
     m_fEndSkewX = m_fStartSkewX + m_fDeltaX;
     m_fEndSkewY = m_fStartSkewY + m_fDeltaY;
 }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:8,代码来源:CCSkewBy.cs

示例10: itemFromNormalSprite

 /// <summary>
 /// creates a menu item with a normal,selected  and disabled image with target/selector
 /// </summary>
 /// <param name="normalSprite"></param>
 /// <param name="selectedSprite"></param>
 /// <param name="disabledSprite"></param>
 /// <param name="target"></param>
 /// <param name="selector"></param>
 /// <returns></returns>
 public static CCMenuItemSprite itemFromNormalSprite(CCNode normalSprite, CCNode selectedSprite, CCNode disabledSprite,
                                                 SelectorProtocol target, SEL_MenuHandler selector)
 {
     CCMenuItemSprite pRet = new CCMenuItemSprite();
     pRet.initFromNormalSprite(normalSprite, selectedSprite, disabledSprite, target, selector);
     //pRet->autorelease();
     return pRet;
 }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:17,代码来源:CCMenuItemSprite.cs

示例11: getRect

 public static CCRect getRect(CCNode node)
 {
     CCRect rc = new CCRect();
     rc.Origin = node.Position;
     rc.Size = node.ContentSize;
     rc.Origin.X -= rc.Size.Width / 2;
     rc.Origin.Y -= rc.Size.Height / 2;
     return rc;
 }
开发者ID:eickegao,项目名称:cocos2d-xna,代码行数:9,代码来源:TextInputTestScene.cs

示例12: startWithTarget

        public override void startWithTarget(CCNode pTarget)
        {
            base.startWithTarget(pTarget);

            CCCamera camera = pTarget.Camera;
            camera.getCenterXYZ(out m_fCenterXOrig, out m_fCenterYOrig, out m_fCenterZOrig);
            camera.getEyeXYZ(out m_fEyeXOrig, out m_fEyeYOrig, out m_fEyeZOrig);
            camera.getUpXYZ(out m_fUpXOrig, out m_fUpYOrig, out m_fUpZOrig);
        }
开发者ID:ChowZenki,项目名称:cocos2d-x-for-xna,代码行数:9,代码来源:CCActionCamera.cs

示例13: getRect

 public static CCRect getRect(CCNode pNode)
 {
     CCRect rc = new CCRect();
     rc.origin = pNode.position;
     rc.size = pNode.contentSize;
     rc.origin.x -= rc.size.width / 2;
     rc.origin.y -= rc.size.height / 2;
     return rc;
 }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:9,代码来源:TextInputTestScene.cs

示例14: startWithTarget

        public virtual void startWithTarget(CCNode pTarget)
        {
            base.startWithTarget(pTarget);

            if (m_pTarget.Grid != null && m_pTarget.Grid.Active != null)
            {
                m_pTarget.Grid.ReuseGrid = m_pTarget.Grid.ReuseGrid + m_nTimes;
            }
        }
开发者ID:liwq-net,项目名称:cocos2d-for-xna-windows,代码行数:9,代码来源:CCReuseGrid.cs

示例15: NumberOfRunningActionsInTarget

 public int NumberOfRunningActionsInTarget(CCNode target)
 {
     HashElement element;
     if (m_pTargets.TryGetValue(target, out element))
     {
         return (element.Actions != null) ? element.Actions.Count : 0;
     }
     return 0;
 }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:9,代码来源:CCActionManager.cs


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