Exemple #1
0
 void CreateChooseLevelOverlay()
 {
     chooseLevelOverlay = new MapOverlay();
     levelItems         = new Dictionary <MapOverlayImageItem, MapOverlayTextItem>();
     levelSelectorItems = new Dictionary <MapOverlayTextItem, MapOverlayTextItem>();
     foreach (string levelName in this.levelNames)
     {
         string levelIconName         = levelName.ToLower().Replace(' ', '_');
         MapOverlayImageItem iconItem = new MapOverlayImageItem()
         {
             Image = CommonExtension.GetResourceImage("FlagsGame", levelIconName + ".png"), JoiningOrientation = Orientation.Horizontal, Padding = new Padding(37, 20, 37, 20)
         };
         MapOverlayTextItem nameItem = new MapOverlayTextItem()
         {
             Text = levelName.ToUpper(), Size = new Size(80, 0), Padding = new Padding(0, 20, 0, 20), TextAlignment = ContentAlignment.BottomCenter
         };
         nameItem.TextStyle.Font       = FontsCollection["level"];
         nameItem.HotTrackedStyle.Fill = ChooseLevelBackgroundColor;
         MapOverlayTextItem selectorItem = new MapOverlayTextItem();
         selectorItem.HotTrackedStyle.Fill = ChooseLevelBackgroundColor;
         this.levelItems.Add(iconItem, nameItem);
         this.levelSelectorItems.Add(nameItem, selectorItem);
     }
     chooseLevelOverlay.Items.AddRange(this.levelItems.Keys);
     chooseLevelOverlay.Items.AddRange(this.levelItems.Values);
     chooseLevelOverlay.Items.AddRange(this.levelSelectorItems.Values);
 }
Exemple #2
0
        Image GetCountryFlag(string countryName)
        {
            string flagPath = countryName.Replace(' ', '_') + FlagExtension;

            if (!this.countriesFlags.ContainsKey(countryName))
            {
                Image flagImage = CommonExtension.GetResourceImage("Flags.Big", flagPath);
                this.countriesFlags.Add(countryName, flagImage);
            }
            return(this.countriesFlags[countryName]);
        }
Exemple #3
0
        void CreateOperationGameOverlay()
        {
            restartGameOverlay = new MapOverlay()
            {
                Alignment = ContentAlignment.TopRight, JoiningOrientation = Orientation.Vertical, Margin = new Padding(0, 12, 12, 0)
            };
            MapOverlayImageItem restartIcon = new MapOverlayImageItem()
            {
                Image = CommonExtension.GetResourceImage("FlagsGame", "restart.png"), Margin = new Padding(10, 6, 7, 6)
            };

            restartGameItem = new MapOverlayTextItem()
            {
                Text = "RESTART GAME", Alignment = ContentAlignment.TopLeft, Margin = new Padding(1), Padding = new Padding(6), Size = new Size(110, 0)
            };
            restartGameItem.TextStyle.Font       = FontsCollection["nav_button"];
            restartGameItem.HotTrackedStyle.Fill = HotTrackedColor;
            restartGameOverlay.Items.AddRange(new MapOverlayItemBase[] { restartIcon, restartGameItem });

            finishGameOverlay = new MapOverlay()
            {
                Alignment = ContentAlignment.TopRight, JoiningOrientation = Orientation.Vertical, Margin = new Padding(0, 0, 12, 0)
            };
            MapOverlayImageItem finishIcon = new MapOverlayImageItem()
            {
                Image = CommonExtension.GetResourceImage("FlagsGame", "finish.png"), Margin = new Padding(10, 6, 7, 6)
            };

            finishGameItem = new MapOverlayTextItem()
            {
                Text = "FINISH GAME", Alignment = ContentAlignment.TopLeft, Margin = new Padding(1), Padding = new Padding(6), Size = new Size(110, 0)
            };
            finishGameItem.TextStyle.Font       = FontsCollection["nav_button"];
            finishGameItem.HotTrackedStyle.Fill = HotTrackedColor;
            finishGameOverlay.Items.AddRange(new MapOverlayItemBase[] { finishIcon, finishGameItem });

            skipCountryOverlay = new MapOverlay()
            {
                Alignment = ContentAlignment.TopRight, JoiningOrientation = Orientation.Vertical, Margin = new Padding(0, 12, 12, 0)
            };
            MapOverlayImageItem skipIcon = new MapOverlayImageItem()
            {
                Image = CommonExtension.GetResourceImage("FlagsGame", "skip.png"), Margin = new Padding(10, 6, 7, 6)
            };

            skipCountryItem = new MapOverlayTextItem()
            {
                Text = "SKIP COUNTRY", Alignment = ContentAlignment.TopLeft, Margin = new Padding(1), Padding = new Padding(6), Size = new Size(110, 0)
            };
            skipCountryItem.TextStyle.Font       = FontsCollection["nav_button"];
            skipCountryItem.HotTrackedStyle.Fill = HotTrackedColor;
            skipCountryOverlay.Items.AddRange(new MapOverlayItemBase[] { skipIcon, skipCountryItem });

            showCountryOverlay = new MapOverlay()
            {
                Alignment = ContentAlignment.TopRight, JoiningOrientation = Orientation.Vertical, Margin = new Padding(0, 0, 12, 0)
            };
            MapOverlayImageItem showIcon = new MapOverlayImageItem()
            {
                Image = CommonExtension.GetResourceImage("FlagsGame", "show.png"), Margin = new Padding(10, 6, 7, 6)
            };

            showCountryItem = new MapOverlayTextItem()
            {
                Text = "SHOW COUNTRY", Alignment = ContentAlignment.TopLeft, Margin = new Padding(1), Padding = new Padding(6), Size = new Size(110, 0)
            };
            showCountryItem.TextStyle.Font       = FontsCollection["nav_button"];
            showCountryItem.HotTrackedStyle.Fill = HotTrackedColor;
            showCountryOverlay.Items.AddRange(new MapOverlayItemBase[] { showIcon, showCountryItem });
        }
Exemple #4
0
        void CreateStatisticGameOverlay()
        {
            statisticGameOverlay = new MapOverlay()
            {
                JoiningOrientation = Orientation.Vertical, Padding = new Padding(15, 3, 10, 3), Margin = new Padding(0, 0, 0, 7)
            };
            scoreImage = new MapOverlayImageItem()
            {
                Image = CommonExtension.GetResourceImage("FlagsGame", "score.png"), Margin = new Padding(8, 12, 10, 12)
            };
            scoreLabel = new MapOverlayTextItem()
            {
                Text = "Score:", Padding = new Padding(0, 10, 5, 10)
            };
            scoreLabel.TextStyle.Font = FontsCollection["default"];
            scoreItem = new MapOverlayTextItem()
            {
                Padding = new Padding(0, 10, 10, 10)
            };
            scoreItem.TextStyle.Font = FontsCollection["default"];

            MapOverlayImageItem winsImage = new MapOverlayImageItem()
            {
                Image = CommonExtension.GetResourceImage("FlagsGame", "wins.png"), Margin = new Padding(8, 12, 10, 12)
            };
            MapOverlayTextItem winsLabel = new MapOverlayTextItem()
            {
                Text = "Wins:", Padding = new Padding(0, 10, 5, 10)
            };

            winsLabel.TextStyle.Font = FontsCollection["default"];
            winsItem = new MapOverlayTextItem()
            {
                Padding = new Padding(0, 10, 10, 10)
            };
            winsItem.TextStyle.Font = FontsCollection["default"];

            MapOverlayImageItem lossesImage = new MapOverlayImageItem()
            {
                Image = CommonExtension.GetResourceImage("FlagsGame", "loses.png"), Margin = new Padding(8, 12, 10, 12)
            };
            MapOverlayTextItem lossesLabel = new MapOverlayTextItem()
            {
                Text = "Losses:", Padding = new Padding(0, 10, 5, 10)
            };

            lossesLabel.TextStyle.Font = FontsCollection["default"];
            lossesItem = new MapOverlayTextItem()
            {
                Padding = new Padding(0, 10, 10, 10)
            };
            lossesItem.TextStyle.Font = FontsCollection["default"];

            timeImage = new MapOverlayImageItem()
            {
                Image = CommonExtension.GetResourceImage("FlagsGame", "time.png"), Margin = new Padding(8, 12, 10, 12)
            };
            timeLabel = new MapOverlayTextItem()
            {
                Text = "Time:", Padding = new Padding(0, 10, 5, 10)
            };
            timeLabel.TextStyle.Font = FontsCollection["default"];
            timeItem = new MapOverlayTextItem()
            {
                Padding = new Padding(0, 10, 10, 10)
            };
            timeItem.TextStyle.Font = FontsCollection["default"];
            statisticGameOverlay.Items.AddRange(new MapOverlayItemBase[] { scoreImage, scoreLabel, scoreItem, winsImage, winsLabel, winsItem, lossesImage, lossesLabel, lossesItem, timeImage, timeLabel, timeItem });
        }