コード例 #1
0
ファイル: Notifications.cs プロジェクト: JohanGl/Outworld-XNA
        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);
        }
コード例 #2
0
ファイル: WeaponBar.cs プロジェクト: JohanGl/Outworld-XNA
        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();
        }
コード例 #3
0
ファイル: HealthBar.cs プロジェクト: JohanGl/Outworld-XNA
        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();
        }
コード例 #4
0
ファイル: Radar.cs プロジェクト: JohanGl/Outworld-XNA
        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));
        }