示例#1
0
        public static new CCSkewBy actionWithDuration(float t, float deltaSkewX, float deltaSkewY)
        {
            CCSkewBy cCSkewBy = new CCSkewBy();

            if (cCSkewBy != null)
            {
                cCSkewBy.initWithDuration(t, deltaSkewX, deltaSkewY);
            }
            return(cCSkewBy);
        }
示例#2
0
        public new static CCSkewBy actionWithDuration(float t, float deltaSkewX, float deltaSkewY)
        {
            CCSkewBy pSkewBy = new CCSkewBy();
            if (pSkewBy != null)
            {
                if (pSkewBy.initWithDuration(t, deltaSkewX, deltaSkewY))
                {
                    //pSkewBy->autorelease();
                }
                else
                {
                    //CC_SAFE_DELETE(pSkewBy);
                }
            }

            return pSkewBy;
        }
示例#3
0
        public new static CCSkewBy actionWithDuration(float t, float deltaSkewX, float deltaSkewY)
        {
            CCSkewBy pSkewBy = new CCSkewBy();

            if (pSkewBy != null)
            {
                if (pSkewBy.initWithDuration(t, deltaSkewX, deltaSkewY))
                {
                    //pSkewBy->autorelease();
                }
                else
                {
                    //CC_SAFE_DELETE(pSkewBy);
                }
            }

            return(pSkewBy);
        }
        public SpriteOffsetAnchorSkew()
        {
            CCSize s = CCDirector.SharedDirector.WinSize;

            for (int i = 0; i < 3; i++)
            {
                CCSpriteFrameCache cache = CCSpriteFrameCache.SharedSpriteFrameCache;
                cache.AddSpriteFramesWithFile("animations/grossini.plist");
                cache.AddSpriteFramesWithFile("animations/grossini_gray.plist", "animations/grossini_gray");

                //
                // Animation using Sprite batch
                //
                CCSprite sprite = new CCSprite("grossini_dance_01.png");
                sprite.Position = (new CCPoint(s.Width / 4 * (i + 1), s.Height / 2));

                CCSprite point = new CCSprite("Images/r1");
                point.Scale = 0.25f;
                point.Position = sprite.Position;
                AddChild(point, 1);

                switch (i)
                {
                    case 0:
                        sprite.AnchorPoint = new CCPoint(0, 0);
                        break;
                    case 1:
                        sprite.AnchorPoint = new CCPoint(0.5f, 0.5f);
                        break;
                    case 2:
                        sprite.AnchorPoint = new CCPoint(1, 1);
                        break;
                }

                point.Position = sprite.Position;

                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.SpriteFrameByName(tmp);
                    animFrames.Add(frame);
                }

                CCAnimation animation = CCAnimation.Create(animFrames, 0.3f);
                sprite.RunAction(new CCRepeatForever (new CCAnimate (animation)));

                animFrames = null;

                CCSkewBy skewX = new CCSkewBy (2, 45, 0);
                CCActionInterval skewX_back = (CCActionInterval)skewX.Reverse();
                CCSkewBy skewY = new CCSkewBy (2, 0, 45);
                CCActionInterval skewY_back = (CCActionInterval)skewY.Reverse();

                CCFiniteTimeAction seq_skew = CCSequence.FromActions(skewX, skewX_back, skewY, skewY_back);
                sprite.RunAction(new CCRepeatForever ((CCActionInterval)seq_skew));

                AddChild(sprite, 0);
            }
        }
示例#5
0
        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();

            m_tamara.RunAction(CCSequence.FromActions(actionTo, actionToBack));
            m_grossini.RunAction(CCSequence.FromActions(actionBy, actionByBack));

            m_kathia.RunAction(CCSequence.FromActions(actionBy2, actionBy2.Reverse()));
        }
示例#6
0
 public override CCFiniteTimeAction reverse()
 {
     return(CCSkewBy.actionWithDuration(this.m_fDuration, -this.m_fSkewX, -this.m_fSkewY));
 }