a LOT of minor stuff

This commit is contained in:
2022-03-05 02:41:30 +01:00
parent ce45bf2726
commit df77704d1c
12 changed files with 90 additions and 56 deletions

View File

@@ -1,7 +1,7 @@
package lib;
import util.Color;
import lib.TermWriteable;
import kernel.ui.TermWriteable;
/**
Helpfull class for writing onto a `TermWriteable`.

View File

@@ -1,44 +0,0 @@
package lib;
using tink.CoreApi;
import util.Color;
import util.Vec.Vec2;
/**
Interface describing a terminal. E.g. the main computer screen or a external screen.
**/
interface TermWriteable {
public var onResize(default, null):Signal<Vec2<Int>>;
public function write(text:String):Void;
public function scroll(y:Int):Void;
/**
Even though CC is 1 based we use a 0 based index.
**/
public function getCursorPos():Vec2<Int>;
/**
Even though CC is 1 based we use a 0 based index.
**/
public function setCursorPos(x:Int, y:Int):Void;
public function getCursorBlink():Bool;
public function setCursorBlink(blink:Bool):Void;
public function getSize():Vec2<Int>;
public function clear():Void;
public function clearLine():Void;
public function getTextColor():Color;
public function setTextColor(colour:Color):Void;
public function getBackgroundColor():Color;
public function setBackgroundColor(color:Color):Void;
public function isColor():Bool;
// setPaletteColor(...)
// getPaletteColor(colour)
/**
Clears the screen, resetes the courser to (0,0) and resetes the color to Black and White.
**/
public function reset():Void;
}