using System.Drawing;
using CC_Functions.Misc;
namespace CC_Functions.Commandline.TUI
{
///
/// A basic text control
///
public class Label : Control
{
///
/// The text inside this label
///
public string Content;
///
/// Creates a new label
///
/// The text inside this label
public Label(string content) => Content = content;
///
public override bool Selectable { get; } = false;
///
public override Pixel[,] Render()
{
char[,] inp = Content.ToNdArray2D();
int w = inp.GetLength(0);
int h = inp.GetLength(1);
Pixel[,] output = new Pixel[w, h];
for (int x = 0; x < w; x++)
for (int y = 0; y < h; y++)
output[x, y] = new Pixel(BackColor, ForeColor, inp[x, y]);
Size = new Size(w, h);
return output;
}
}
}