示例#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;
        }
示例#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;
        }
示例#3
0
文件: SceneT9.cs 项目: Otto404/wp-xna
        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;
        }
示例#4
0
文件: Label.cs 项目: Otto404/wp-xna
        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 );
        }
示例#5
0
文件: Label.cs 项目: Otto404/wp-xna
 internal static void InitSize( Label label )
 {
     InitSize ( label, false );
 }
示例#6
0
文件: Label.cs 项目: Otto404/wp-xna
        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 );
        }