void CreateHeaders()
        {
            var playerNameLabel = new Label("NAME", "Fonts/DefaultFont")
            {
                Color = Color.Red,
                Position = new Point(Viewport.Width / 8, (int)textPosY)
            };
            _gui.Add(playerNameLabel);

            _gui.Add(new Label("HIGH SCORE", "Fonts/DefaultFont")
            {
                Color = Color.Red,
                HorizontalOrigin = HorizontalAlign.Center,
                Position = new Point((int)(Viewport.Width * 5 / 8.0f - 70 * _gui.Scale.X), (int)textPosY)
            });

            _gui.Add(new Label("TOTAL ZOMBIES", "Fonts/DefaultFont")
            {
                Color = Color.Red,
                HorizontalOrigin = HorizontalAlign.Right,
                Position = new Point((int)(Viewport.Width * 6 / 8.0f + 100 * _gui.Scale.X), (int)textPosY)
            });

            textPosY += playerNameLabel.MeasureSize().Y;
        }
示例#2
0
        void CreateCategory(string title, string text)
        {
            var textPosX = Game.GraphicsDevice.Viewport.Width / 2 - 80 * _gui.Scale.X;
            var cat1Title = new Label(title, "Fonts/DefaultFont")
            {
                //FontSize = 24,
                Color = Color.YellowGreen,
                Position = new Point((int)textPosX, (int)textPosY)
            };

            _gui.Add(cat1Title);

            textPosY += cat1Title.MeasureSize().Y;

            if (textPosX == 0)
                textPosX = cat1Title.Position.X;

            var cat1Text = new Label(text, "Fonts/DefaultFont")
            {
                Color = Color.White,
                Position = new Point((int)textPosX, (int)textPosY)
            };

            _gui.Add(cat1Text);
            textPosY += cat1Text.MeasureSize().Y;
        }