added simple list renderer
This commit is contained in:
parent
881aad743d
commit
9e128eaad2
20
src/lib/ui/rendere/List.hx
Normal file
20
src/lib/ui/rendere/List.hx
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user