Example #1
0
        public TowerInfoBox(Tower target, bool isBuildInfo)
            : base(target.ScreenLocation)
        {
            Target = target;
            GenerateText();

            IsBuildInfo = isBuildInfo;
            if (isBuildInfo)
            {
                string enters = string.Concat(Enumerable.Repeat <string>(Environment.NewLine, Lines.Count));
                Lines.Add(enters + " Cost: " + target.Cost);
                Height += CurrentGame.font.LineSpacing;
                float costStringWidth = CurrentGame.font.MeasureString(" Cost: " + target.Cost).X;
                if (costStringWidth + TowerInfoBox.Padding * 2 > Width)
                {
                    Width = (int)costStringWidth + TowerInfoBox.Padding * 2;
                }
                LineColors.Add(Color.White);
            }
        }
Example #2
0
 /// <summary>
 /// Modification the line color (<see cref="PlotFormat.LineColor"/>).
 /// </summary>
 public void ModLineColor(string SubKey, LineColors LineColor)
 {
     this.ModLineColor(new[] { SubKey }, new[] { LineColor });
 }
Example #3
0
        static public Brush GetBrush(int index)
        {
            int i = index % LineColors.Count;

            return(LineColors.ElementAt(i).Key);
        }
Example #4
0
 public PlotFormat WithLineColor(LineColors color)
 {
     return(new PlotFormat(baseLineFormat: this, lineColor: color));
 }