Exemplo n.º 1
0
        internal SceneT11( )
            : base(Vector2.Zero, GestureType.None,
			new Resource[] {
				new Resource ( "peg", ResourceType.Font, @"font\myfont" ),
				new Resource ( "scene.sound", ResourceType.Music, @"sound\music1" ),
			},
			new Making[] {
				new Label ( "l1", "I'm SceneT11!!!!!!", 2f, Color.White, 0f )
			})
        {
            this.l1 = this.makings[ "l1" ] as Label;
        }
Exemplo n.º 2
0
        internal LoadingScene( SceneLoader loader, Label loadingLabel )
            : base(Vector2.Zero, GestureType.None,
			new Resource[] {
				new Resource ( "peg", ResourceType.Font, @"font\peg" )
			},
			new Making[] {
				loadingLabel
			})
        {
            if ( null == loader )
                throw new ArgumentNullException ( "loader", "loader can't be null" );

            this.loader = loader;
            this.loadingLabel = loadingLabel;
        }
Exemplo n.º 3
0
        internal SceneT9( )
            : base(Vector2.Zero, GestureType.Tap | GestureType.DoubleTap,
			new Resource[] {
				new Resource ( "bird2.image", ResourceType.Image, @"image\bird2" ),
				new Resource ( "click.s", ResourceType.Sound, @"sound\click" ),
				new Resource ( "peg", ResourceType.Font, @"font\myfont" ),
			},
			new Making[] {
				new Movie ( "bird2.m", "bird2.image", new Vector2 ( 200, 200 ), 80, 80, 3, 0, "live",
					new MovieSequence ( "live", true, new Point ( 1, 1 ), new Point ( 2, 1 ) ),
					new MovieSequence ( "dead", 30, false, new Point ( 3, 1 ), new Point ( 4, 1 ) )
				),
				new Label ( "l1", "Hello windows phone!", 2f, Color.LightGreen, 0f )
			})
        {
            this.l1 = this.makings[ "l1" ] as Label;
            this.bird2 = this.makings[ "bird2.m" ] as Movie;
        }
Exemplo n.º 4
0
        internal static void InitSize( Label label, bool isForce )
        {
            if ( null == label )
                return;

            if ( label.Width == 0 || isForce )
                label.Width = ( int ) ( label.font.MeasureString ( label.Text ).X * label.FontScale );

            if ( label.Height == 0 || isForce )
                label.Height = ( int ) ( label.font.LineSpacing * label.FontScale );
        }
Exemplo n.º 5
0
 internal static void InitSize( Label label )
 {
     InitSize ( label, false );
 }
Exemplo n.º 6
0
        internal static void Draw( Label label, SpriteBatch batch )
        {
            if ( !label.isVisible )
                return;

            Color color = label.color;

            if ( label.blink != 0 )
            {
                label.Alpha += label.blink;

                if ( label.Alpha <= 0.5 || label.Alpha >= 1 )
                    label.blink = -label.blink;

            }

            if ( label.Alpha != 1 )
                color = color * label.Alpha;

            batch.DrawString ( label.font, label.Text, label.location * World.Scale, color, label.Rotation, Vector2.Zero, label.FontScale * ( label.Rotation == 0 ? World.Scale : World.FlipScale ), SpriteEffects.None, 0 );
        }