Пример #1
0
        /// <summary>
        /// Loads the content.
        /// </summary>
        public override void LoadContent()
        {
            background = new GuiImage
            {
                ContentFile   = "Interface/Backgrounds/stone-bricks",
                TextureLayout = TextureLayout.Tile
            };

            factionImage = new GuiFactionFlag
            {
                Size = new Size2D(128, 128)
            };

            factionText = new GuiText
            {
                FontName          = "SideBarFont",
                Size              = new Size2D(Size.Width * 2 / 3, 48),
                VerticalAlignment = VerticalAlignment.Left
            };

            turnText = new GuiText
            {
                FontName          = "SideBarFont",
                Size              = new Size2D(Size.Width / 3, 48),
                VerticalAlignment = VerticalAlignment.Right
            };

            StatsButton = new GuiButton
            {
                Text             = "Stats",
                ForegroundColour = ForegroundColour,
                Size             = new Size2D(GameDefines.GUI_TILE_SIZE * 3, GameDefines.GUI_TILE_SIZE)
            };
            RecruitButton = new GuiButton
            {
                Text             = "Recruit",
                ForegroundColour = ForegroundColour,
                Size             = new Size2D(GameDefines.GUI_TILE_SIZE * 3, GameDefines.GUI_TILE_SIZE)
            };
            BuildButton = new GuiButton
            {
                Text             = "Build",
                ForegroundColour = ForegroundColour,
                Size             = new Size2D(GameDefines.GUI_TILE_SIZE * 3, GameDefines.GUI_TILE_SIZE)
            };
            TurnButton = new GuiButton
            {
                Text             = "End Turn",
                ForegroundColour = ForegroundColour,
                Size             = new Size2D(GameDefines.GUI_TILE_SIZE * 7, GameDefines.GUI_TILE_SIZE),
                Style            = ButtonStyle.Narivian
            };

            Children.Add(background);
            Children.Add(factionImage);

            Children.Add(factionText);
            Children.Add(turnText);

            Children.Add(StatsButton);
            Children.Add(RecruitButton);
            Children.Add(BuildButton);
            Children.Add(TurnButton);

            base.LoadContent();
        }
Пример #2
0
        /// <summary>
        /// Loads the content.
        /// </summary>
        public override void LoadContent()
        {
            holdingImages = new List <GuiImage>();
            holdingTexts  = new List <GuiText>();

            background = new GuiImage
            {
                ContentFile   = "Interface/Backgrounds/wool",
                TextureLayout = TextureLayout.Tile
            };

            provinceNameBackground = new GuiImage
            {
                Size            = new Size2D(256, 48),
                ContentFile     = "Interface/province-panel-label",
                SourceRectangle = new Rectangle2D(0, 0, 256, 48)
            };
            provinceNameBackgroundDecor = new GuiImage
            {
                Size            = provinceNameBackground.Size,
                ContentFile     = provinceNameBackground.ContentFile,
                SourceRectangle = new Rectangle2D(0, 48, 256, 48)
            };
            provinceNameText = new GuiText
            {
                FontName = "SideBarFont", // TODO: Consider providing a dedicated font
                Size     = new Size2D(provinceNameBackground.SourceRectangle.Width,
                                      provinceNameBackground.SourceRectangle.Height),
                TextOutline = true
            };
            factionFlag = new GuiFactionFlag
            {
                Size = new Size2D(provinceNameBackground.Size.Height,
                                  provinceNameBackground.Size.Height)
            };

            resourceImage = new GuiImage
            {
                SourceRectangle = new Rectangle2D(0, 0, 64, 64)
            };
            resourceText = new GuiText
            {
                FontName            = "ProvinceBarHoldingFont",
                ForegroundColour    = Colour.Black,
                HorizontalAlignment = HorizontalAlignment.Top
            };

            ProvinceId = game.GetFactionProvinces(game.PlayerFactionId).First().Id;

            Children.Add(background);

            Children.Add(provinceNameBackground);
            Children.Add(provinceNameBackgroundDecor);
            Children.Add(provinceNameText);
            Children.Add(factionFlag);

            Children.Add(resourceImage);
            Children.Add(resourceText);

            base.LoadContent();
        }