Beispiel #1
0
        /// <summary>
        /// Loads graphics content for this screen. This uses the shared ContentManager
        /// provided by the Game class, so the content will remain loaded forever.
        /// Whenever a subsequent MessageBoxScreen tries to load this same content,
        /// it will just get back another reference to the already loaded data.
        /// </summary>
        public override void LoadContent()
        {
            btn_ok_text   = "Log In";
            btn_ok_Cancel = "Offline";
            base.LoadContent();

            Textbox = new vxTextbox(vxEngine, IpAddressToConnectTo,
                                    textPosition + new Vector2(0, textSize.Y + vPad), 300);

            xGUIManager.Add(Textbox);

            //Reset the Button Positions
            //Set Gui Item Positions
            Btn_Ok.Position     = textPosition + new Vector2((int)Textbox.Textbox_Length - Btn_Ok.BoundingRectangle.Width - 125, textSize.Y + vPad * 2 + (int)Textbox.Textbox_height);
            Btn_Cancel.Position = textPosition + new Vector2((int)Textbox.Textbox_Length - Btn_Cancel.BoundingRectangle.Width, textSize.Y + vPad * 2 + (int)Textbox.Textbox_height);

            backgroundRectangle = new Rectangle((int)textPosition.X - hPad,
                                                (int)textPosition.Y - vPad,
                                                (int)Textbox.Textbox_Length + hPad * 2,
                                                (int)textSize.Y + vPad * 2 + (int)Textbox.Textbox_height + Btn_Cancel.BoundingRectangle.Height + vPad * 2);

            TitleRectangle = new Rectangle((int)textPosition.X - hPad,
                                           (int)textPosition.Y - (int)textTitleSize.Y - vPad * 2 - 5,
                                           (int)Textbox.Textbox_Length + hPad * 2,
                                           (int)textTitleSize.Y + vPad);
        }
Beispiel #2
0
        public virtual void GetProperties(vxScrollPanel owningItem)
        {
            owningItem.Clear();

            nameBox = new vxTextbox(vxEngine, this.name, Vector2.Zero);
            owningItem.AddItem(nameBox);

            indexProp = new vxTextbox(vxEngine, this.Index.ToString(), new Vector2(0, 20));
            owningItem.AddItem(indexProp);
        }
        /// <summary>
        /// Loads graphics content for this screen. This uses the shared ContentManager
        /// provided by the Game class, so the content will remain loaded forever.
        /// Whenever a subsequent MessageBoxScreen tries to load this same content,
        /// it will just get back another reference to the already loaded data.
        /// </summary>
        public override void LoadContent()
        {
            btn_ok_text = "Save As";
            base.LoadContent();

            //First Add Textbox
            Textbox = new vxTextbox(vxEngine, FileName,
                                    textPosition + new Vector2(0, textSize.Y + vPad), (int)textSize.X + 2 * hPad);

            Textbox.Textbox_Length = 350;

            xGUIManager.Add(Textbox);

            Vector2 viewportSize = new Vector2(vxEngine.GraphicsDevice.Viewport.Width, vxEngine.GraphicsDevice.Viewport.Height);


            // Center the message text in the viewport.
            viewport      = vxEngine.GraphicsDevice.Viewport;
            textTitleSize = font.MeasureString(Title);
            textSize      = font.MeasureString(message);

            //First Get Length of Text
            int textLength = (int)textSize.X;

            int totalBtnWidth = (int)(vxEngine.vxGUITheme.ArtProviderForButtons.DefaultWidth * 2 + vxEngine.vxGUITheme.Padding.X * 4);

            textSize = new Vector2(Math.Max(textLength, totalBtnWidth), textSize.Y);

            textPosition      = (viewportSize - textSize) / 2;
            textTitlePosition = textPosition - new Vector2(0, 2 * vPad + textTitleSize.Y);

            //Next Set Window Size as
            backgroundRectangle = new Rectangle(
                (int)textPosition.X - hPad,
                (int)textPosition.Y - vPad,
                (int)textSize.X + hPad * 2,
                (int)textSize.Y + vPad * 2 + (int)Textbox.Textbox_height + Btn_Cancel.BoundingRectangle.Height + vPad * 2);

            TitleRectangle = new Rectangle(
                (int)textPosition.X - hPad,
                (int)textPosition.Y - (int)textTitleSize.Y - vPad * 2 - 5,
                (int)textSize.X + hPad * 2,
                (int)textTitleSize.Y + vPad);

            //Reset the Button Positions
            //Set Gui Item Positions

            Btn_Ok.Position = new Vector2(backgroundRectangle.X, backgroundRectangle.Y) + new Vector2(
                backgroundRectangle.Width - vxEngine.vxGUITheme.ArtProviderForButtons.DefaultWidth * 2 - vxEngine.vxGUITheme.Padding.X * 2,
                backgroundRectangle.Height - vxEngine.vxGUITheme.ArtProviderForButtons.DefaultHeight - vxEngine.vxGUITheme.Padding.Y * 2);

            Btn_Cancel.Position = new Vector2(backgroundRectangle.X, backgroundRectangle.Y) + new Vector2(
                backgroundRectangle.Width - vxEngine.vxGUITheme.ArtProviderForButtons.DefaultWidth - vxEngine.vxGUITheme.Padding.X,
                backgroundRectangle.Height - vxEngine.vxGUITheme.ArtProviderForButtons.DefaultHeight - vxEngine.vxGUITheme.Padding.Y * 2);
        }