[asciilib] All surface data
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package asciilib;
|
||||
|
||||
import haxe.io.Bytes;
|
||||
import kiss.Prelude;
|
||||
|
||||
typedef Color = {
|
||||
r:Int,
|
||||
|
@@ -6,8 +6,7 @@
|
||||
:Bytes green (Bytes.alloc area)
|
||||
:Bytes blue (Bytes.alloc area)]
|
||||
|
||||
(unless fillColor (set fillColor Black))
|
||||
(fill fillColor))
|
||||
(fill (or fillColor Black)))
|
||||
|
||||
(defmethod fill [:Color color]
|
||||
(red.fill 0 area color.r)
|
||||
@@ -15,3 +14,4 @@
|
||||
(blue.fill 0 area color.b))
|
||||
|
||||
(defvar Black (object r 0 g 0 b 0))
|
||||
(defvar White (object r 255 g 255 b 255))
|
4
projects/asciilib2/src/asciilib/Grid.hx
Normal file
4
projects/asciilib2/src/asciilib/Grid.hx
Normal file
@@ -0,0 +1,4 @@
|
||||
package asciilib;
|
||||
|
||||
@:build(kiss.Kiss.build("src/asciilib/Grid.kiss"))
|
||||
class Grid<T> {}
|
4
projects/asciilib2/src/asciilib/Grid.kiss
Normal file
4
projects/asciilib2/src/asciilib/Grid.kiss
Normal file
@@ -0,0 +1,4 @@
|
||||
(defnew [_width _height :T defaultValue]
|
||||
[:Int width _width
|
||||
:Int height _height
|
||||
:Array<Array<T>> rows (for _ (range height) (for _ (range width) defaultValue))])
|
4
projects/asciilib2/src/asciilib/Letters.hx
Normal file
4
projects/asciilib2/src/asciilib/Letters.hx
Normal file
@@ -0,0 +1,4 @@
|
||||
package asciilib;
|
||||
|
||||
@:build(kiss.Kiss.build("src/asciilib/Letters.kiss"))
|
||||
class Letters {}
|
4
projects/asciilib2/src/asciilib/Letters.kiss
Normal file
4
projects/asciilib2/src/asciilib/Letters.kiss
Normal file
@@ -0,0 +1,4 @@
|
||||
(defnew [_width _height &opt :String letter]
|
||||
[:Int width _width
|
||||
:Int height _height
|
||||
:Array<String> rows (for _ (range height) (* (or letter " ") width))])
|
@@ -0,0 +1,8 @@
|
||||
(defnew [_width _height &opt :Color backgroundColor :String letter :Color letterColor]
|
||||
[:Int width _width
|
||||
:Int height _height
|
||||
:Colors backgroundColors (new Colors width height (or backgroundColor Colors.Black))
|
||||
:Letters letters (new Letters width height (or letter " "))
|
||||
:Colors letterColors (new Colors width height (or letterColor Colors.White))
|
||||
:Grid<Bool> opacity (new Grid width height true)
|
||||
:Grid<String> specialInfo (new Grid width height "")])
|
1
projects/asciilib2/src/asciilib/import.hx
Normal file
1
projects/asciilib2/src/asciilib/import.hx
Normal file
@@ -0,0 +1 @@
|
||||
import kiss.Prelude;
|
Reference in New Issue
Block a user