Esempio n. 1
0
        public override void UpdateLayout(GuiManager guiManager, Rectangle availableSize)
        {
            var bounds = Font.MeasureString(Text);

            Width = bounds.X;
            Height = bounds.Y;

            guiManager.Arrange(this, availableSize);
        }
Esempio n. 2
0
        public override void UpdateLayout(GuiManager guiManager, Rectangle availableSize)
        {
            if (Width == 0f)
            {
                Width = Source.Width;
            }

            if (Height == 0f)
            {
                Height = Source.Height;
            }

            guiManager.Arrange(this, availableSize);
        }
Esempio n. 3
0
        public override void UpdateLayout(GuiManager guiManager, Rectangle availableSize)
        {
            HorizontalAlignment = HorizontalAlignment.Left;
            VerticalAlignment = VerticalAlignment.Bottom;
            Margin = new Thickness(16, 0, 0, 16);
            Width = 204;
            Height = 38;

            guiManager.Arrange(this, availableSize);

            positionAmount = new Vector2(Position.X + 7, Position.Y);
            positionTitle = new Vector2(Position.X + 83, Position.Y + 4);
            positionProgressBar = new Vector2(Position.X + 83, Position.Y + 17);

            UpdateProgressBar();
        }
Esempio n. 4
0
        public override void UpdateLayout(GuiManager guiManager, Rectangle availableSize)
        {
            HorizontalAlignment = HorizontalAlignment.Right;
            VerticalAlignment = VerticalAlignment.Bottom;
            Margin = new Thickness(0, 0, 16, 16);
            Width = 204;
            Height = 38;

            guiManager.Arrange(this, availableSize);

            int titleWidth = (int)context.Resources.Fonts["Hud.Small"].MeasureString("Health").X;

            positionAmount = new Vector2(Position.X + 128, Position.Y);
            positionTitle = new Vector2(Position.X + 123 - titleWidth, Position.Y + 4);
            positionProgressBar = new Vector2(Position.X + 5, Position.Y + 17);

            UpdateProgressBar();
        }
Esempio n. 5
0
        public override void UpdateLayout(GuiManager guiManager, Rectangle availableSize)
        {
            Width = Default.Width;
            Height = Default.Height;

            guiManager.Arrange(this, availableSize);

            textBlock.HorizontalAlignment = this.HorizontalAlignment;
            textBlock.VerticalAlignment = this.VerticalAlignment;
            textBlock.Margin = this.Margin;
            textBlock.UpdateLayout(guiManager, availableSize);
        }
Esempio n. 6
0
        public override void UpdateLayout(GuiManager guiManager, Rectangle availableSize)
        {
            Width = buttonStates.Default.Width;
            Height = buttonStates.Default.Height;

            guiManager.Arrange(this, availableSize);
        }
Esempio n. 7
0
        public override void UpdateLayout(GuiManager guiManager, Rectangle availableSize)
        {
            HorizontalAlignment = HorizontalAlignment.Right;
            VerticalAlignment = VerticalAlignment.Top;
            Margin = new Thickness(0, 15, 15, 0);
            Width = radarBaseImage.Width;
            Height = radarBaseImage.Height;

            guiManager.Arrange(this, availableSize);

            uiCenter = new Vector2(Position.X + (Width / 2), Position.Y + (Height / 2));
            uiCenterForRadarCompass = uiCenter;

            uiCenter -= new Vector2((radarEntityImage.Width / 2.0f), (radarEntityImage.Height / 2.0f));

            radarCompassOrigin = new Vector2((radarCompass.Width / 2), (radarCompass.Height / 2));
        }
Esempio n. 8
0
        public override void UpdateLayout(GuiManager guiManager, Rectangle availableSize)
        {
            guiManager.Arrange(this, availableSize);

            textBox.Width = Width;
            textBox.Height = 20;

            textBox.VerticalAlignment = VerticalAlignment.Bottom;
            textBox.HorizontalAlignment = HorizontalAlignment.Left;
            textBox.Margin = new Thickness(0, 0, 0, 0);

            var chatBoxBounds = new Rectangle((int)Position.X, (int)Position.Y, (int)Width, (int)Height);
            textBox.UpdateLayout(guiManager, chatBoxBounds);

            for (int i = 0; i < numberOfLines; i++)
            {
                textBlocks[i].Width = Width;
                textBlocks[i].Height = Height;
                textBlocks[i].VerticalAlignment = VerticalAlignment.Bottom;
                textBlocks[i].HorizontalAlignment = HorizontalAlignment.Left;
                textBlocks[i].Margin = new Thickness(5, 0, 0, 37 + (20 * i));
                textBlocks[i].UpdateLayout(guiManager, chatBoxBounds);
            }
        }
Esempio n. 9
0
        public override void UpdateLayout(GuiManager guiManager, Rectangle availableSize)
        {
            HorizontalAlignment = HorizontalAlignment.Left;
            VerticalAlignment = VerticalAlignment.Center;
            Margin = new Thickness(4, 0, 0, 0);
            Width = 300;
            Height = 40;

            guiManager.Arrange(this, availableSize);

            positionTitle = new Vector2(Position.X, Position.Y);
        }