public override CCObject copyWithZone(CCZone zone) { CCZone tmpZone = zone; CCTintTo ret = null; if (tmpZone != null && tmpZone.m_pCopyObject != null) { ret = tmpZone.m_pCopyObject as CCTintTo; if (ret == null) { return(null); } } else { ret = new CCTintTo(); tmpZone = new CCZone(ret); } base.copyWithZone(tmpZone); ret.initWithDuration(m_fDuration, m_to.r, m_to.g, m_to.b); return(ret); }
public override CCObject copyWithZone(CCZone zone) { CCZone tmpZone = zone; CCTintTo ret = null; if (tmpZone != null && tmpZone.m_pCopyObject != null) { ret = tmpZone.m_pCopyObject as CCTintTo; if (ret == null) { return null; } } else { ret = new CCTintTo(); tmpZone = new CCZone(ret); } base.copyWithZone(tmpZone); ret.initWithDuration(m_fDuration, m_to.r, m_to.g, m_to.b); return ret; }
public static CCTintTo actionWithDuration(float duration, byte red, byte green, byte blue) { CCTintTo ret = new CCTintTo(); ret.initWithDuration(duration, red, green, blue); return ret; }
public static CCTintTo actionWithDuration(float duration, float red, float green, float blue) { CCTintTo ret = new CCTintTo(); ret.initWithDuration(duration, red, green, blue); return(ret); }
public CCTintToState (CCTintTo action, CCNode target) : base (action, target) { ColorTo = action.ColorTo; var protocol = Target; if (protocol != null) { ColorFrom = protocol.Color; } }
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(2f, 3f, 32f, new ccColor3B(0, 255, 0), s_streak); 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); CCActionInterval colorAction = CCRepeatForever.actionWithAction((CCActionInterval)CCSequence.actions( CCTintTo.actionWithDuration(0.2f, 255, 0, 0), CCTintTo.actionWithDuration(0.2f, 0, 255, 0), CCTintTo.actionWithDuration(0.2f, 0, 0, 255), CCTintTo.actionWithDuration(0.2f, 0, 255, 255), CCTintTo.actionWithDuration(0.2f, 255, 255, 0), CCTintTo.actionWithDuration(0.2f, 255, 0, 255), CCTintTo.actionWithDuration(0.2f, 255, 255, 255) )); m_streak.runAction(colorAction); /* * CCActionInterval *colorAction = CCRepeatForever::create((CCActionInterval *)CCSequence::create( * CCTintTo::create(0.2f, 255, 0, 0), * CCTintTo::create(0.2f, 0, 255, 0), * CCTintTo::create(0.2f, 0, 0, 255), * CCTintTo::create(0.2f, 0, 255, 255), * CCTintTo::create(0.2f, 255, 255, 0), * CCTintTo::create(0.2f, 255, 0, 255), * CCTintTo::create(0.2f, 255, 255, 255), * NULL)); * * streak->runAction(colorAction); */ }
public CCTintToState(CCTintTo action, CCNode target) : base(action, target) { ColorTo = action.ColorTo; var protocol = Target; if (protocol != null) { ColorFrom = protocol.Color; } }
public override void OnEnter() { base.OnEnter(); centerSprites(2); var action1 = new CCTintTo(2, 255, 0, 255); var action2 = new CCTintBy(2, -127, -255, -127); var action2Back = action2.Reverse(); m_tamara.RunAction(action1); m_kathia.RunAction(CCSequence.FromActions(action2, action2Back)); }
public override void onEnter() { base.onEnter(); centerSprites(2); CCActionInterval action1 = CCTintTo.actionWithDuration(2, 255, 0, 255); CCActionInterval action2 = CCTintBy.actionWithDuration(2, -127, -255, -127); CCFiniteTimeAction action2Back = action2.reverse(); m_tamara.runAction(action1); m_kathia.runAction(CCSequence.actions(action2, action2Back)); }
protected CCTintTo(CCTintTo tintTo) : base(tintTo) { InitWithDuration(tintTo.m_fDuration, tintTo.m_to.R, tintTo.m_to.G, tintTo.m_to.B); }
protected CCTintTo(CCTintTo tintTo) : base(tintTo) { InitWithDuration(tintTo.m_fDuration, tintTo.m_to.R, tintTo.m_to.G, tintTo.m_to.B); }