public RenderTextureCompositeTest()
        {
            var winSize = CCDirector.SharedDirector.WinSize;
            var characterSpriteFactory = new CharacterSpriteFactory();

            _testSprite  = new CCSprite(@"Images\grossini_dance_01");
            _testSprite2 = new CCSprite(@"Images\grossini_dance_02");

            _swingAnimate    = characterSpriteFactory.CreateAnimateAction();
            _thrustAnimate   = characterSpriteFactory.CreateAnimateAction();
            _dodgeAnimate    = characterSpriteFactory.CreateAnimateAction();
            _collapseAnimate = characterSpriteFactory.CreateAnimateAction();

            _swingAnimate2    = characterSpriteFactory.CreateAnimateAction();
            _thrustAnimate2   = characterSpriteFactory.CreateAnimateAction();
            _dodgeAnimate2    = characterSpriteFactory.CreateAnimateAction();
            _collapseAnimate2 = characterSpriteFactory.CreateAnimateAction();

            _testSprite.Position = new CCPoint(winSize.Width / 2 - 200, winSize.Height / 2 + 100);
            AddChild(_testSprite);

            _testSprite2.Position = new CCPoint(winSize.Width / 2 + 200, winSize.Height / 2 + 100);
            _testSprite2.FlipX    = true;
            AddChild(_testSprite2);

            AnimationLoop();
            AnimationLoop2();
        }
        public RenderTextureCompositeTest()
        {
            var winSize = CCDirector.SharedDirector.WinSize;
            var characterSpriteFactory = new CharacterSpriteFactory();

            _testSprite = new CCSprite(@"Images\grossini_dance_01");
            _testSprite2 = new CCSprite(@"Images\grossini_dance_02");

            _swingAnimate = characterSpriteFactory.CreateAnimateAction();
            _thrustAnimate = characterSpriteFactory.CreateAnimateAction();
            _dodgeAnimate = characterSpriteFactory.CreateAnimateAction();
            _collapseAnimate = characterSpriteFactory.CreateAnimateAction();

            _swingAnimate2 = characterSpriteFactory.CreateAnimateAction();
            _thrustAnimate2 = characterSpriteFactory.CreateAnimateAction();
            _dodgeAnimate2 = characterSpriteFactory.CreateAnimateAction();
            _collapseAnimate2 = characterSpriteFactory.CreateAnimateAction();

            _testSprite.Position = new CCPoint(winSize.Width / 2 -200, winSize.Height / 2 + 100);
            AddChild(_testSprite);

            _testSprite2.Position = new CCPoint(winSize.Width / 2 + 200, winSize.Height / 2 + 100);
            _testSprite2.FlipX = true;
            AddChild(_testSprite2);

            AnimationLoop();
            AnimationLoop2();
        }
예제 #3
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

            var characterSpriteFactory = new CharacterSpriteFactory();

            swingAnimate    = characterSpriteFactory.CreateAnimateAction(Director);
            thrustAnimate   = characterSpriteFactory.CreateAnimateAction(Director);
            dodgeAnimate    = characterSpriteFactory.CreateAnimateAction(Director);
            collapseAnimate = characterSpriteFactory.CreateAnimateAction(Director);

            swingAnimate2    = characterSpriteFactory.CreateAnimateAction(Director);
            thrustAnimate2   = characterSpriteFactory.CreateAnimateAction(Director);
            dodgeAnimate2    = characterSpriteFactory.CreateAnimateAction(Director);
            collapseAnimate2 = characterSpriteFactory.CreateAnimateAction(Director);

            testSprite.Position  = new CCPoint(windowSize.Width / 2 - 200, windowSize.Height / 2 + 100);
            testSprite2.Position = new CCPoint(windowSize.Width / 2 + 200, windowSize.Height / 2 + 100);
            testSprite2.FlipX    = true;

            AnimationLoop();
            AnimationLoop2();
        }
        public override void OnEnter()
        {

            base.OnEnter(); 

            CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

            var characterSpriteFactory = new CharacterSpriteFactory();

            swingAnimate = characterSpriteFactory.CreateAnimateAction(Director);
            thrustAnimate = characterSpriteFactory.CreateAnimateAction(Director);
            dodgeAnimate = characterSpriteFactory.CreateAnimateAction(Director);
            collapseAnimate = characterSpriteFactory.CreateAnimateAction(Director);

            swingAnimate2 = characterSpriteFactory.CreateAnimateAction(Director);
            thrustAnimate2 = characterSpriteFactory.CreateAnimateAction(Director);
            dodgeAnimate2 = characterSpriteFactory.CreateAnimateAction(Director);
            collapseAnimate2 = characterSpriteFactory.CreateAnimateAction(Director);

            testSprite.Position = new CCPoint(windowSize.Width / 2 -200, windowSize.Height / 2 + 100);
            testSprite2.Position = new CCPoint(windowSize.Width / 2 + 200, windowSize.Height / 2 + 100);
            testSprite2.FlipX = true;

            AnimationLoop();
            AnimationLoop2();
        }