Example #1
0
 void Refresh()
 {//Problemy z kolorami w alignmencie, bo pastel itd... zrobić align lokalny albo w stringerze z pastelem
     if (IsVIsable && Text.Length > 0)
     {
         Renderer.Write(Stringer.AlighnString(Text, size.x, alignment).Replace(Text, Text.Pastel(textColor).PastelBg(backgroundColor)), position);
     }
 }
Example #2
0
 void UpdateText(string newText)
 {
     previousText = Text;
     Text         = newText;
     if (IsVIsable)
     {
         Renderer.Write(emptyLine, Position);
     }
     emptyLine = Stringer.GetFilledString(newText.Length, ' ');
     Size      = new Int2(Text.Length, 1);
     Refresh();
 }
Example #3
0
        static void DrawShips()
        {
            Int2 startPos = new Int2(36 + prepareMap.Size.x * 2, 1);

            for (int i = 0; i < ships.Length; i++)
            {
                if (ships[i] > 0)
                {
                    Renderer.Write(Stringer.GetFilledString(i * 2 + 2, "░░▒▒").PastelBg(Color.DarkGray).Pastel(Color.LightGray) + $" x{ships[i]}", startPos);
                    startPos.y += 2;
                }
            }
        }
Example #4
0
        static void EraseShips()
        {
            Int2   startPos = new Int2(36 + prepareMap.Size.x * 2, 1);
            string shipStr;

            for (int i = 0; i < ships.Length; i++)
            {
                if (ships[i] > 0)
                {
                    shipStr = Stringer.GetFilledString(i * 2 + 2, ' ');
                    Renderer.Write($"{shipStr}     ", startPos);
                    startPos.y += 2;
                }
            }
        }
Example #5
0
 void SetupLines()
 {
     waterLine      = Stringer.GetFilledString(contentSize.x * 2, Bars.transparent[1]).Pastel(wavesColor).PastelBg(waterColor);
     emptyBoardLine = Stringer.GetFilledString(contentSize.x * 2, ' ');
     upBorder       = "██".Pastel(Color.Gold);
     for (int i = 0; i < contentSize.x; i++)
     {
         upBorder += "██".Pastel((i % 2 == 1 ? Color.Gray : Color.LightGray));
     }
     upBorder     += "██".Pastel(Color.Gold);
     midBorder     = new string[2];
     midBorder[0]  = "██".Pastel(Color.Gray) + emptyBoardLine + "██".Pastel(Color.Gray);
     midBorder[1]  = "██".Pastel(Color.LightGray) + emptyBoardLine + "██".Pastel(Color.LightGray);
     emptyLine     = Stringer.GetFilledString(size.x * 2, ' ');
     downBorder    = (string)upBorder.Clone();
     redrawBorders = true;
 }