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


C# CCNode.runAction方法代码示例

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


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

示例1: onEnter

        public override void onEnter()
        {
            base.onEnter();

            CCSize s = CCDirector.sharedDirector().getWinSize();

            // the root object just rotates around
            m_root = CCSprite.spriteWithFile(s_pPathR1);
            addChild(m_root, 1);
            m_root.position = (new CCPoint(s.width / 2, s.height / 2));

            // the target object is offset from root, and the streak is moved to follow it
            m_target = CCSprite.spriteWithFile(s_pPathR1);
            m_root.addChild(m_target);
            m_target.position = (new CCPoint(100, 0));

            // create the streak object and add it to the scene
            //m_streak = CCMotionStreak.streakWithFade(2, 3, s_streak, 32, 32, new ccColor4B(0,255,0,255) );
            addChild(m_streak);
            // schedule an update on each frame so we can syncronize the streak with the target
            schedule(onUpdate);

            CCActionInterval a1 = CCRotateBy.actionWithDuration(2, 360);

            CCAction action1 = CCRepeatForever.actionWithAction(a1);
            CCActionInterval motion = CCMoveBy.actionWithDuration(2, new CCPoint(100, 0));
            m_root.runAction(CCRepeatForever.actionWithAction((CCActionInterval)(CCSequence.actions(motion, motion.reverse()))));
            m_root.runAction(action1);
        }
开发者ID:hiceka,项目名称:cocos2d-x-for-xna,代码行数:29,代码来源:MotionStreakTest1.cs

示例2: repeatForever

        public void repeatForever(CCNode pSender)
        {
            CCRepeatForever repeat = CCRepeatForever.actionWithAction(CCRotateBy.actionWithDuration(1.0f, 360) );

            pSender.runAction(repeat);
        }
开发者ID:Openxlive,项目名称:cocos2d-x-for-xna,代码行数:6,代码来源:ActionsTest.cs

示例3: bugMe

 public void bugMe(CCNode node)
 {
     node.stopAllActions(); //After this stop next action not working, if remove this stop everything is working
     node.runAction(CCScaleTo.actionWithDuration(2, 2));
 }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:5,代码来源:LogicTest.cs


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