示例#1
0
        internal SceneT10( )
            : base(Vector2.Zero, GestureType.None,
			new Resource[] {
				new Resource ( "play.image", ResourceType.Image, @"image\button1" ),
				new Resource ( "click.s", ResourceType.Sound, @"sound\click" ),
			},
			new Making[] {
				new Button ( "b.play", "play.image", "PLAY", new Vector2 ( 100, 100 ), 100, 50, new Point ( 1, 1 ) )
			})
        {
            this.buttonPlay = this.makings[ "b.play" ] as Button;
            //this.buttonPlay.IsEnabled = false;

            this.buttonPlay.Pressing += this.buttonPlayPressing;
            this.buttonPlay.Pressed += this.buttonPlayPressed;
        }
示例#2
0
        internal SceneT14( )
            : base(Vector2.Zero, GestureType.None, "background1",
			new Resource[] {
				new Resource ( "bird2.image", ResourceType.Image, @"image\bird2" ),
				new Resource ( "go.image", ResourceType.Image, @"image\button1" ),
				new Resource ( "stop.image", ResourceType.Image, @"image\button2" ),
			},
			new Making[] {
				new Movie ( "bird", "bird2.image", 80, 80, 5, "stop",
					new MovieSequence ( "go", true, new Point ( 1, 1 ), new Point ( 2, 1 ) ),
					new MovieSequence ( "stop", true, new Point ( 3, 1 ) )
					),
				new Button ( "b.go", "go.image", "GO", new Vector2 ( 100, 100 ), 100, 50, new Point ( 1, 1 ) ),
				new Button ( "b.play", "stop.image", "STOP", new Vector2 ( 100, 300 ), 100, 50, new Point ( 1, 1 ) )
			})
        {
            this.goButton = this.makings[ "b.go" ] as Button;
            this.stopButton = this.makings[ "b.play" ] as Button;

            this.goButton.Selected += this.goButtonSelected;
            this.stopButton.Selected += this.stopButtonSelected;
        }
示例#3
0
文件: Button.cs 项目: Otto404/wp-xna
        internal static void Unpress( Button button )
        {
            if ( !button.IsPressing )
                return;

            button.IsPressing = false;

            button.unpress ( );

            if ( null != button.Pressed )
                button.Pressed ( button, new ButtonEventArgs ( button.command ) );
        }
示例#4
0
文件: Button.cs 项目: Otto404/wp-xna
        internal static void Select( Button button )
        {
            if ( !button.isEnabled )
                return;

            button.select ( );

            if ( null != button.Selected )
                button.Selected ( button, new ButtonEventArgs ( button.command ) );
        }
示例#5
0
文件: Button.cs 项目: Otto404/wp-xna
        internal static bool PressTest( Button button, IList<Motion> motions )
        {
            if ( !button.isEnabled || !button.isVisible )
                return false;

            foreach ( Motion motion in motions )
                if ( motion.Type == MotionType.Down || motion.Type == MotionType.Press )
                {
                    Point location = new Point ( ( int ) motion.Position.X, ( int ) motion.Position.Y );

                    if ( button.bound.Contains ( location ) )
                    {
                        Press ( button );
                        return true;
                    }

                }

            Unpress ( button );
            return false;
        }
示例#6
0
文件: Button.cs 项目: Otto404/wp-xna
        internal static void Press( Button button )
        {
            button.IsPressing = true;

            button.press ( );

            if ( null != button.Pressing )
                button.Pressing ( button, new ButtonEventArgs ( button.command ) );
        }
示例#7
0
文件: Button.cs 项目: Otto404/wp-xna
        internal static bool ClickTest( Button button, IList<Motion> motions )
        {
            if ( !button.isEnabled || !button.isVisible )
                return false;

            foreach ( Motion motion in motions )
                if ( motion.Type == MotionType.Up )
                {
                    Point location = new Point ( ( int ) motion.Position.X, ( int ) motion.Position.Y );

                    if ( button.bound.Contains ( location ) )
                    {
                        Select ( button );
                        return true;
                    }

                }

            return false;
        }