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); }
public override void onEnter() { base.onEnter(); CCLayerColor cCLayerColor = CCLayerColor.layerWithColor(this.m_tColor); this.m_pInScene.visible = false; this.addChild(cCLayerColor, 2, 2147483647); CCNode childByTag = base.getChildByTag(2147483647); CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { CCFadeIn.actionWithDuration(this.m_fDuration / 2f), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.hideOutShowIn)), CCFadeOut.actionWithDuration(this.m_fDuration / 2f), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)) }; childByTag.runAction((CCActionInterval)CCSequence.actions(cCFiniteTimeActionArray)); }
public override void onEnter() { base.onEnter(); CCLayerColor l = CCLayerColor.layerWithColor(m_tColor); m_pInScene.visible = false; addChild(l, 2, kSceneFade); CCNode f = getChildByTag(kSceneFade); CCActionInterval a = (CCActionInterval)CCSequence.actions ( CCFadeIn.actionWithDuration(m_fDuration / 2), CCCallFunc.actionWithTarget(this, (base.hideOutShowIn)), CCFadeOut.actionWithDuration(m_fDuration / 2), CCCallFunc.actionWithTarget(this, (base.finish)) ); f.runAction(a); }
public void repeatForever(CCNode pSender) { CCRepeatForever repeat = CCRepeatForever.actionWithAction(CCRotateBy.actionWithDuration(1.0f, 360) ); pSender.runAction(repeat); }
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)); }