Esempio n. 1
0
        public override void LoadContent()
        {
            button_messagebox = new button(game)
            {
                label = "button_messagebox",
                rect  = new Rectangle(300, 300, 200, 50)
            };
            button_messagebox.LoadContent();

            button_yesno = new button(game)
            {
                label = "button_yesno",
                rect  = new Rectangle(500, 300, 200, 50)
            };
            button_yesno.LoadContent();

            messagebox = new DialogueBox()
            {
                Type         = DialogueBox.type.message,
                message      = "this is a dialoguebox",
                title        = "facts",
                font         = game.Content.Load <SpriteFont>("font"),
                TitleAlign   = DialogueBox.Align.Middle,
                MessageAlign = DialogueBox.Align.Left,
                window       = new Pane()
                {
                    buttonLeft   = game.Content.Load <Texture2D>("button/left"),
                    buttonMiddle = game.Content.Load <Texture2D>("button/middle"),
                    buttonRight  = game.Content.Load <Texture2D>("button/right"),
                    rect         = new Rectangle((int)Sh.Framework.Graphics.ShWindow.getWidth() / 2 - 400 / 2, (int)Sh.Framework.Graphics.ShWindow.getHeight() / 2 - 100 / 2, 400, 100),
                    color        = Color.White
                },
                selectionButton = new Button()
                {
                    buttonLeft   = game.Content.Load <Texture2D>("button/left"),
                    buttonMiddle = game.Content.Load <Texture2D>("button/middle"),
                    buttonRight  = game.Content.Load <Texture2D>("button/right"),
                    labelFont    = game.Content.Load <SpriteFont>("font"),
                    rect         = new Rectangle(0, 0, 120, 20)
                },
            };
            messagebox.visible = false;

            yesno = new DialogueBox()
            {
                Type         = DialogueBox.type.yesno,
                message      = "would you like to throw an exception?",
                title        = "yes no",
                font         = game.Content.Load <SpriteFont>("font"),
                TitleAlign   = DialogueBox.Align.Middle,
                MessageAlign = DialogueBox.Align.Left,
                window       = new Pane()
                {
                    buttonLeft   = game.Content.Load <Texture2D>("button/left"),
                    buttonMiddle = game.Content.Load <Texture2D>("button/middle"),
                    buttonRight  = game.Content.Load <Texture2D>("button/right"),
                    rect         = new Rectangle((int)Sh.Framework.Graphics.ShWindow.getWidth() / 2 - 400 / 2, (int)Sh.Framework.Graphics.ShWindow.getHeight() / 2 - 100 / 2, 400, 100),
                    color        = Color.White
                },
                selectionButton = new Button()
                {
                    buttonLeft   = game.Content.Load <Texture2D>("button/left"),
                    buttonMiddle = game.Content.Load <Texture2D>("button/middle"),
                    buttonRight  = game.Content.Load <Texture2D>("button/right"),
                    labelFont    = game.Content.Load <SpriteFont>("font"),
                    rect         = new Rectangle(0, 0, 120, 20)
                },
            };
            yesno.visible = false;

            base.LoadContent();
        }