コード例 #1
0
ファイル: SceneT10.cs プロジェクト: Otto404/wp-xna
        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
ファイル: SceneT14.cs プロジェクト: Otto404/wp-xna
        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;
        }