Esempio n. 1
0
        public override void Initialize()
        {
            Viewport viewport = MobileFortressClient.Game.GraphicsDevice.Viewport;
            Texture2D tex = Resources.Menus.Title.LoginButton;
            Rectangle rect = new Rectangle(0, 290, tex.Width, tex.Height);
            loginButton = new UIElement(this, tex, rect);
            loginButton.Clicked += LoginClick;
            loginButton.MouseOver += MouseOver;
            loginButton.MouseOff += MouseOff;
            loginButton.color = Color.Black;
            Manager.Elements.Add(loginButton);

            tex = Resources.Menus.Title.OptionsButton;
            rect = new Rectangle(0, 370, tex.Width, tex.Height);
            optionsButton = new UIElement(this, tex, rect);
            optionsButton.Clicked += OptionsClick;
            optionsButton.MouseOver += MouseOver;
            optionsButton.MouseOff += MouseOff;
            optionsButton.color = Color.Black;
            Manager.Elements.Add(optionsButton);

            tex = Resources.Menus.Title.ExitButton;
            rect = new Rectangle(0, 450, tex.Width, tex.Height);
            exitButton = new UIElement(this, tex, rect);
            exitButton.Clicked += ExitClick;
            exitButton.MouseOver += MouseOver;
            exitButton.MouseOff += MouseOff;
            exitButton.color = Color.Black;
            Manager.Elements.Add(exitButton);

            pointerTex = Resources.Menus.Title.Pointer;
            pointerDimensions = new Rectangle(0, 0, pointerTex.Width, pointerTex.Height);

            loginMenu = Resources.Menus.Title.LoginMenu;
            loginDimensions = new Rectangle(viewport.Width / 2 - loginMenu.Width / 2, viewport.Height, loginMenu.Width, loginMenu.Height);

            tex = Resources.Menus.Title.LoginConfirmButton;
            rect = new Rectangle(25, 9, tex.Width, tex.Height);
            rect.Offset(loginDimensions.Location);

            loginConfirmButton = new UIElement(this, tex, rect);
            loginConfirmButton.Clicked += ConfirmClick;

            Manager.Elements.Add(loginConfirmButton);

            tex = Resources.Menus.Title.TextBox;
            rect = new Rectangle(186, 6, tex.Width,tex.Height);
            rect.Offset(loginDimensions.Location);
            usernameBar = new UITextBox(this, tex, rect, false);
            rect = new Rectangle(186, 42, tex.Width, tex.Height);
            rect.Offset(loginDimensions.Location);
            passwordBar = new UITextBox(this, tex, rect, true);
            Manager.Elements.Add(usernameBar);
            Manager.Elements.Add(passwordBar);

            loginBackButton = new UIStandardButton(this, new Point(128, 128), "Back");
            loginBackButton.dimensions.Offset(loginDimensions.Location);
            loginBackButton.hasButton = true;
            loginBackButton.customFont = Resources.Menus.BaroqueScript16;
            loginBackButton.Clicked += LoginCancel;
            Manager.Elements.Add(loginBackButton);
        }
Esempio n. 2
0
        public override void Initialize()
        {
            Viewport  viewport = MobileFortressClient.Game.GraphicsDevice.Viewport;
            Texture2D tex      = Resources.Menus.Title.LoginButton;
            Rectangle rect     = new Rectangle(0, 290, tex.Width, tex.Height);

            loginButton            = new UIElement(this, tex, rect);
            loginButton.Clicked   += LoginClick;
            loginButton.MouseOver += MouseOver;
            loginButton.MouseOff  += MouseOff;
            loginButton.color      = Color.Black;
            Manager.Elements.Add(loginButton);

            tex                      = Resources.Menus.Title.OptionsButton;
            rect                     = new Rectangle(0, 370, tex.Width, tex.Height);
            optionsButton            = new UIElement(this, tex, rect);
            optionsButton.Clicked   += OptionsClick;
            optionsButton.MouseOver += MouseOver;
            optionsButton.MouseOff  += MouseOff;
            optionsButton.color      = Color.Black;
            Manager.Elements.Add(optionsButton);

            tex                   = Resources.Menus.Title.ExitButton;
            rect                  = new Rectangle(0, 450, tex.Width, tex.Height);
            exitButton            = new UIElement(this, tex, rect);
            exitButton.Clicked   += ExitClick;
            exitButton.MouseOver += MouseOver;
            exitButton.MouseOff  += MouseOff;
            exitButton.color      = Color.Black;
            Manager.Elements.Add(exitButton);



            pointerTex        = Resources.Menus.Title.Pointer;
            pointerDimensions = new Rectangle(0, 0, pointerTex.Width, pointerTex.Height);

            loginMenu       = Resources.Menus.Title.LoginMenu;
            loginDimensions = new Rectangle(viewport.Width / 2 - loginMenu.Width / 2, viewport.Height, loginMenu.Width, loginMenu.Height);

            tex  = Resources.Menus.Title.LoginConfirmButton;
            rect = new Rectangle(25, 9, tex.Width, tex.Height);
            rect.Offset(loginDimensions.Location);

            loginConfirmButton          = new UIElement(this, tex, rect);
            loginConfirmButton.Clicked += ConfirmClick;

            Manager.Elements.Add(loginConfirmButton);

            tex  = Resources.Menus.Title.TextBox;
            rect = new Rectangle(186, 6, tex.Width, tex.Height);
            rect.Offset(loginDimensions.Location);
            usernameBar = new UITextBox(this, tex, rect, false);
            rect        = new Rectangle(186, 42, tex.Width, tex.Height);
            rect.Offset(loginDimensions.Location);
            passwordBar = new UITextBox(this, tex, rect, true);
            Manager.Elements.Add(usernameBar);
            Manager.Elements.Add(passwordBar);

            loginBackButton = new UIStandardButton(this, new Point(128, 128), "Back");
            loginBackButton.dimensions.Offset(loginDimensions.Location);
            loginBackButton.hasButton  = true;
            loginBackButton.customFont = Resources.Menus.BaroqueScript16;
            loginBackButton.Clicked   += LoginCancel;
            Manager.Elements.Add(loginBackButton);
        }
Esempio n. 3
0
        public override void Initialize()
        {
            Viewport viewport = MobileFortressClient.Game.GraphicsDevice.Viewport;

            Weapon1 = new UIWeaponSelector(this, new Point(12, viewport.Height- 256 - 48));
            Weapon2 = new UIWeaponSelector(this, new Point(12, viewport.Height - 192 - 36));
            Weapon3 = new UIWeaponSelector(this, new Point(12, viewport.Height - 128 - 24));
            Weapon4 = new UIWeaponSelector(this, new Point(12, viewport.Height - 64 - 12));
            Weapon1.NameBar.Clicked += SelectPart;
            Weapon2.NameBar.Clicked += SelectPart;
            Weapon3.NameBar.Clicked += SelectPart;
            Weapon4.NameBar.Clicked += SelectPart;
            Weapon1.graphicBox.Clicked += IncrementWeaponGroup;
            Weapon2.graphicBox.Clicked += IncrementWeaponGroup;
            Weapon3.graphicBox.Clicked += IncrementWeaponGroup;
            Weapon4.graphicBox.Clicked += IncrementWeaponGroup;
            Weapon1.UpArrow.Clicked += PreviousWeapon;
            Weapon1.DownArrow.Clicked += NextWeapon;
            Weapon2.UpArrow.Clicked += PreviousWeapon;
            Weapon2.DownArrow.Clicked += NextWeapon;
            Weapon3.UpArrow.Clicked += PreviousWeapon;
            Weapon3.DownArrow.Clicked += NextWeapon;
            Weapon4.UpArrow.Clicked += PreviousWeapon;
            Weapon4.DownArrow.Clicked += NextWeapon;

            Ship = new ShipData(1, 1, 1);

            Nose = new UIPartSelector(this, new Point(375 + 12, viewport.Height - 192 - 36 + 8));
            Nose.Part = Ship.Nose;
            Nose.UpArrow.Clicked += PreviousNose;
            Nose.DownArrow.Clicked += NextNose;
            Nose.NameBar.Clicked += SelectPart;
            Core = new UIPartSelector(this, new Point(375 + 12, viewport.Height - 128 - 24 + 8));
            Core.PartType = "Core";
            Core.Part = Ship.Core;
            Core.UpArrow.Clicked += PreviousCore;
            Core.DownArrow.Clicked += NextCore;
            Core.NameBar.Clicked += SelectPart;
            Engine = new UIPartSelector(this, new Point(375 + 12, viewport.Height - 64 - 12 + 8));
            Engine.PartType = "Engine";
            Engine.Part = Ship.Engine;
            Engine.UpArrow.Clicked += PreviousEngine;
            Engine.DownArrow.Clicked += NextEngine;
            Engine.NameBar.Clicked += SelectPart;

            ConfirmButton = new UIStandardButton(this, new Point(viewport.Width - 198 - 16, 8), "Launch");
            ConfirmButton.hasButton = true;
            ConfirmButton.Clicked += Confirm;
            Manager.Elements.Add(ConfirmButton);

            Texture2D tex = Resources.Menus.Customization.DescriptionScreen;
            DescriptionBox = new UIElement(this, tex,
                new Rectangle(5, 5, tex.Width, tex.Height));

            Manager.ClickAway += SelectPart;

            pointerTex = Resources.Menus.Title.Pointer;
            pointerDimensions = new Rectangle(0, 0, pointerTex.Width, pointerTex.Height);

            Camera.CustomizationSetup(MobileFortressClient.Game,new Vector3(0,1.5f,6));
        }
Esempio n. 4
0
        public override void Initialize()
        {
            Viewport viewport = MobileFortressClient.Game.GraphicsDevice.Viewport;

            Weapon1 = new UIWeaponSelector(this, new Point(12, viewport.Height - 256 - 48));
            Weapon2 = new UIWeaponSelector(this, new Point(12, viewport.Height - 192 - 36));
            Weapon3 = new UIWeaponSelector(this, new Point(12, viewport.Height - 128 - 24));
            Weapon4 = new UIWeaponSelector(this, new Point(12, viewport.Height - 64 - 12));
            Weapon1.NameBar.Clicked    += SelectPart;
            Weapon2.NameBar.Clicked    += SelectPart;
            Weapon3.NameBar.Clicked    += SelectPart;
            Weapon4.NameBar.Clicked    += SelectPart;
            Weapon1.graphicBox.Clicked += IncrementWeaponGroup;
            Weapon2.graphicBox.Clicked += IncrementWeaponGroup;
            Weapon3.graphicBox.Clicked += IncrementWeaponGroup;
            Weapon4.graphicBox.Clicked += IncrementWeaponGroup;
            Weapon1.UpArrow.Clicked    += PreviousWeapon;
            Weapon1.DownArrow.Clicked  += NextWeapon;
            Weapon2.UpArrow.Clicked    += PreviousWeapon;
            Weapon2.DownArrow.Clicked  += NextWeapon;
            Weapon3.UpArrow.Clicked    += PreviousWeapon;
            Weapon3.DownArrow.Clicked  += NextWeapon;
            Weapon4.UpArrow.Clicked    += PreviousWeapon;
            Weapon4.DownArrow.Clicked  += NextWeapon;

            Ship = new ShipData(1, 1, 1);

            Nose                      = new UIPartSelector(this, new Point(375 + 12, viewport.Height - 192 - 36 + 8));
            Nose.Part                 = Ship.Nose;
            Nose.UpArrow.Clicked     += PreviousNose;
            Nose.DownArrow.Clicked   += NextNose;
            Nose.NameBar.Clicked     += SelectPart;
            Core                      = new UIPartSelector(this, new Point(375 + 12, viewport.Height - 128 - 24 + 8));
            Core.PartType             = "Core";
            Core.Part                 = Ship.Core;
            Core.UpArrow.Clicked     += PreviousCore;
            Core.DownArrow.Clicked   += NextCore;
            Core.NameBar.Clicked     += SelectPart;
            Engine                    = new UIPartSelector(this, new Point(375 + 12, viewport.Height - 64 - 12 + 8));
            Engine.PartType           = "Engine";
            Engine.Part               = Ship.Engine;
            Engine.UpArrow.Clicked   += PreviousEngine;
            Engine.DownArrow.Clicked += NextEngine;
            Engine.NameBar.Clicked   += SelectPart;

            ConfirmButton           = new UIStandardButton(this, new Point(viewport.Width - 198 - 16, 8), "Launch");
            ConfirmButton.hasButton = true;
            ConfirmButton.Clicked  += Confirm;
            Manager.Elements.Add(ConfirmButton);

            Texture2D tex = Resources.Menus.Customization.DescriptionScreen;

            DescriptionBox = new UIElement(this, tex,
                                           new Rectangle(5, 5, tex.Width, tex.Height));

            Manager.ClickAway += SelectPart;

            pointerTex        = Resources.Menus.Title.Pointer;
            pointerDimensions = new Rectangle(0, 0, pointerTex.Width, pointerTex.Height);

            Camera.CustomizationSetup(MobileFortressClient.Game, new Vector3(0, 1.5f, 6));
        }