[asciilib] All surface data
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package asciilib;
|
package asciilib;
|
||||||
|
|
||||||
import haxe.io.Bytes;
|
import haxe.io.Bytes;
|
||||||
import kiss.Prelude;
|
|
||||||
|
|
||||||
typedef Color = {
|
typedef Color = {
|
||||||
r:Int,
|
r:Int,
|
||||||
|
@@ -6,12 +6,12 @@
|
|||||||
:Bytes green (Bytes.alloc area)
|
:Bytes green (Bytes.alloc area)
|
||||||
:Bytes blue (Bytes.alloc area)]
|
:Bytes blue (Bytes.alloc area)]
|
||||||
|
|
||||||
(unless fillColor (set fillColor Black))
|
(fill (or fillColor Black)))
|
||||||
(fill fillColor))
|
|
||||||
|
|
||||||
(defmethod fill [:Color color]
|
(defmethod fill [:Color color]
|
||||||
(red.fill 0 area color.r)
|
(red.fill 0 area color.r)
|
||||||
(green.fill 0 area color.g)
|
(green.fill 0 area color.g)
|
||||||
(blue.fill 0 area color.b))
|
(blue.fill 0 area color.b))
|
||||||
|
|
||||||
(defvar Black (object r 0 g 0 b 0))
|
(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