Esempio n. 1
0
        public CCFadeToState (CCFadeTo action, CCNode target)
            : base (action, target)
        {              
            ToOpacity = action.ToOpacity;

            var pRGBAProtocol = target;
            if (pRGBAProtocol != null)
            {
                FromOpacity = pRGBAProtocol.Opacity;
            }
        }
Esempio n. 2
0
        public CCFadeToState(CCFadeTo action, CCNode target)
            : base(action, target)
        {
            ToOpacity = action.ToOpacity;

            var pRGBAProtocol = target;

            if (pRGBAProtocol != null)
            {
                FromOpacity = pRGBAProtocol.Opacity;
            }
        }
Esempio n. 3
0
        public override void OnEnter()
        {
            base.OnEnter();

            var s = Layer.VisibleBoundsWorldspace.Size;
            var layer1 = new CCLayer();


			var sister1 = new CCSprite("Images/grossinis_sister1.png");
			var sister2 = new CCSprite("Images/grossinis_sister2.png");
            var label = new CCLabelBMFont("Test", "fonts/bitmapFontTest.fnt");
			// by default a CCLabelBMFont has IsColorModifiedByOpacity on by default if the 
			// texture atlas is PreMultipliedAlpha.  Label as used by Cocos2d-x by default has
			// this set to false.  Maybe this is a bug in Cocos2d-x?
			label.IsColorModifiedByOpacity = false;
    
            layer1.AddChild(sister1);
            layer1.AddChild(sister2);
            layer1.AddChild(label);
            this.AddChild( layer1, 0, kTagLayer);
    
            sister1.Position= new CCPoint( s.Width*1/3, s.Height/2);
            sister2.Position = new CCPoint( s.Width*2/3, s.Height/2);
            label.Position = new CCPoint(s.Width / 2, s.Height / 2);

			// Define our delay time
			var delay = new CCDelayTime (1);

			layer1.RepeatForever(
                        new CCFadeTo(4, 0),
                        new CCFadeTo(4, 255),
						delay
                );

			// We only have to define them once.
			var fadeTo11 = new CCFadeTo (2, 0);
			var fadeTo12 = new CCFadeTo (2, 255);

			sister1.RepeatForever(
						fadeTo11,
						fadeTo12,
						fadeTo11,
						fadeTo12,
						delay
                );
    
    
            // Enable cascading in scene
            SetEnableRecursiveCascading(this, true);
        }
Esempio n. 4
0
        public override void OnEnter()
        {
            base.OnEnter();

            var s = Layer.VisibleBoundsWorldspace.Size;

            var layer1 = new CCLayerColor(new CCColor4B(192, 0, 0, 255));
            layer1.IsColorCascaded = false;

            layer1.Position = new CCPoint(0, s.Height / 2);

            var sister1 = new CCSprite("Images/grossinis_sister1.png");
            var sister2 = new CCSprite("Images/grossinis_sister2.png");
            var label = new CCLabelBMFont("Test", "fonts/bitmapFontTest.fnt");

            layer1.AddChild(sister1);
            layer1.AddChild(sister2);
            layer1.AddChild(label);
            this.AddChild(layer1, 0, kTagLayer);

            sister1.Position = new CCPoint(s.Width * 1 / 3, 0);
            sister2.Position = new CCPoint(s.Width * 2 / 3, 0);
            label.Position = new CCPoint(s.Width / 2, 0);

			// Define our delay time
			var delay = new CCDelayTime (1);

			layer1.RepeatForever(
				new CCFadeTo(4, 0),
				new CCFadeTo(4, 255),
				delay
			);

			// We only have to define them once.
			var fadeTo11 = new CCFadeTo (2, 0);
			var fadeTo12 = new CCFadeTo (2, 255);

			sister1.RepeatForever(
				fadeTo11,
				fadeTo12,
				fadeTo11,
				fadeTo12,
				delay
			);
        }