public SpriteBatchNodeOffsetAnchorSkew() { CCSpriteFrameCache cache = CCSpriteFrameCache.SharedSpriteFrameCache; cache.AddSpriteFrames("animations/grossini.plist"); cache.AddSpriteFrames("animations/grossini_gray.plist", "animations/grossini_gray"); // Create animations and actions var animFrames = new List<CCSpriteFrame>(); string tmp = ""; for (int j = 0; j < 14; j++) { string temp = ""; if (j+1<10) { temp = "0" + (j + 1); } else { temp = (j + 1).ToString(); } tmp = string.Format("grossini_dance_{0}.png", temp); CCSpriteFrame frame = cache[tmp]; animFrames.Add(frame); } animation = new CCAnimation(animFrames, 0.3f); // skew CCSkewBy skewX = new CCSkewBy (2, 45, 0); CCFiniteTimeAction skewX_back = (CCFiniteTimeAction)skewX.Reverse(); CCSkewBy skewY = new CCSkewBy (2, 0, 45); CCFiniteTimeAction skewY_back = (CCFiniteTimeAction)skewY.Reverse(); // scale CCScaleBy scale = new CCScaleBy(2, 2); CCFiniteTimeAction scale_back = (CCFiniteTimeAction)scale.Reverse(); seq_scale = new CCSequence(scale, scale_back); seq_skew = new CCSequence(skewX, skewX_back, skewY, skewY_back); sprites = new CCSprite[numOfSprites]; pointSprites = new CCSprite[numOfSprites]; for (int i = 0; i < numOfSprites; i++) { // Animation using Sprite batch sprites[i] = new CCSprite("grossini_dance_01.png"); pointSprites[i] = new CCSprite("Images/r1"); CCSpriteBatchNode spritebatch = new CCSpriteBatchNode("animations/grossini"); AddChild(spritebatch); AddChild(pointSprites[i], 200); spritebatch.AddChild(sprites[i], i); } }
public SpriteOffsetAnchorSkewScale() { sprites = new CCSprite[numOfSprites]; pointSprites = new CCSprite[numOfSprites]; // Create actions CCSpriteFrameCache cache = CCSpriteFrameCache.SharedSpriteFrameCache; cache.AddSpriteFrames("animations/grossini.plist"); cache.AddSpriteFrames("animations/grossini_gray.plist", "animations/grossini_gray"); var animFrames = new List<CCSpriteFrame>(); string tmp = ""; for (int j = 0; j < 14; j++) { tmp = string.Format("grossini_dance_{0:00}.png", j + 1); CCSpriteFrame frame = cache[tmp]; animFrames.Add(frame); } animation = new CCAnimation(animFrames, 0.3f); // Skew CCSkewBy skewX = new CCSkewBy (2, 45, 0); CCFiniteTimeAction skewX_back = (CCFiniteTimeAction)skewX.Reverse(); CCSkewBy skewY = new CCSkewBy (2, 0, 45); CCFiniteTimeAction skewY_back = (CCFiniteTimeAction)skewY.Reverse(); seq_skew = new CCSequence(skewX, skewX_back, skewY, skewY_back); // Scale CCScaleBy scale = new CCScaleBy(2, 2); CCFiniteTimeAction scale_back = (CCFiniteTimeAction)scale.Reverse(); seq_scale = new CCSequence(scale, scale_back); for (int i = 0; i < numOfSprites; i++) { // Animation using Sprite batch sprites[i] = new CCSprite("grossini_dance_01.png"); AddChild(sprites[i], 0); pointSprites[i] = new CCSprite("Images/r1"); AddChild(pointSprites[i], 1); } }
public override void OnEnter() { base.OnEnter(); CenterSprites(3); var actionTo = new CCSkewTo (2, 37.2f, -37.2f); var actionToBack = new CCSkewTo (2, 0, 0); var actionBy = new CCSkewBy (2, 0.0f, -90.0f); var actionBy2 = new CCSkewBy (2, 45.0f, 45.0f); var actionByBack = actionBy.Reverse(); Tamara.RunActions(actionTo, actionToBack); Grossini.RunActions(actionBy, actionByBack); Kathia.RunActions(actionBy2, actionBy2.Reverse()); }