diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6f90a3f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# 1.0.0 (2021-05-18) + + +### Features + +* initial implementation ([536fa68](https://github.com/seleb/draw-1-bit/commit/536fa685fd7e5b6bd10f1cbe58d4742ea53f46f4)) diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..704f5d6 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,141 @@ + + +
+ + +draw-1-bit
simple 1-bit 2D canvas drawing interface
+npm i draw-1-bit
+
+ example:
+import Draw1Bit from 'draw-1-bit';
+
+const draw = new Draw1Bit({ width: 16, height: 16 });
+document.body.appendChild(draw.canvas);
+
+// set a pixel value
+draw.fill(1, 2, true);
+
+// lock a pixel
+draw.lock(1, 2, true);
+
+// retrieve a pixel value
+draw.fill(1, 2);
+
+// retrieve a locked value
+draw.lock(1, 2);
+
+// resize drawing grid
+draw.resize(32, 32);
+
+// setup listeners
+draw.addEventListener('drawstart', (event) => {
+ console.log('Drawing started', event.detail.x, event.detail.y);
+});
+draw.addEventListener('draw', (event) => {
+ console.log('Pixel changed during drawing', event.detail.x, event.detail.y, event.detail.value);
+});
+draw.addEventListener('drawend', (event) => {
+ console.log('Drawing stopped', event.detail.x, event.detail.y);
+});
+
+ Generated using TypeDoc
+Generated using TypeDoc
+