public static void ReplaceLine(string text, Text.Align alignment = Text.Align.Left) { int width = Config.ConsoleWidth - 1; switch (alignment) { default: case Text.Align.Left: Console.Write($"\r{text.PadRight(width)}"); break; case Text.Align.Right: Console.Write($"\r{text.PadLeft(width)}"); break; case Text.Align.Center: Console.Write($"\r{Text.Center(width, text)}"); break; } }
internal void SetText(string text, Text.Align align, int xOffset = 0, int yOffset = 0) { TextValue = text; if (TextHandle == null) { if (TextDictionary.ContainsKey(CurrentButtonType)) { TextHandle = TextDictionary[CurrentButtonType](CurrentButtonType == ButtonType.Addon ? text.ToUpper() : text); TextHandle.Color = CurrentColorModificationValue.Combine(DefaultColorValues[CurrentButtonType]); TextObjects.Add(TextHandle); } else { return; } } else { TextHandle.TextValue = CurrentButtonType == ButtonType.Addon ? text.ToUpper() : text; } TextHandle.TextAlign = align; TextHandle.Padding = new Vector2(xOffset, yOffset); TextHandle.ApplyToControlPosition(this); }