added simple list renderer

This commit is contained in:
Djeeberjr 2023-01-30 16:06:27 +01:00
parent 881aad743d
commit 9e128eaad2

View File

@ -0,0 +1,20 @@
package lib.ui.rendere;
class List {
public function new() {}
public function render(list:Array<String>): Canvas {
var canvas = new Canvas();
for (line in 0...list.length) {
for (char in 0...list[line].length) {
var c = list[line].charAt(char);
canvas.set({x: char, y: line}, {
char: c,
textColor: Color.White,
bg: Color.Black,
});
}
}
return canvas;
}
}