textmode.js 0.7.1-beta.5 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -36,7 +36,7 @@ export interface ILayerManager {
|
|
|
36
36
|
/**
|
|
37
37
|
* Remove all user-created layers from the manager.
|
|
38
38
|
* The base layer is not affected by this operation.
|
|
39
|
-
* This is useful for live-coding environments where code is re-evaluated
|
|
39
|
+
* This is useful for integration into live-coding environments where code is re-evaluated
|
|
40
40
|
* and layers need to be recreated from scratch.
|
|
41
41
|
*/
|
|
42
42
|
clear(): void;
|
|
@@ -279,26 +279,32 @@ export interface ITextmodeLayer {
|
|
|
279
279
|
* @param z The rotation angle in degrees. Positive values rotate clockwise.
|
|
280
280
|
* @returns The current rotation in degrees if no parameter is provided.
|
|
281
281
|
*
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* import { textmode } from 'textmode.js';
|
|
285
|
+
*
|
|
286
|
+
* const t = textmode.create();
|
|
287
|
+
*
|
|
288
|
+
* const rotatingLayer = t.layers.add({ blendMode: 'difference', opacity: 1.0 });
|
|
289
|
+
*
|
|
290
|
+
* rotatingLayer.draw(() => {
|
|
291
|
+
* t.clear();
|
|
292
|
+
* t.charColor(255, 200, 100);
|
|
293
|
+
* t.char('#');
|
|
294
|
+
* t.rect(10, 5);
|
|
295
|
+
* });
|
|
296
|
+
*
|
|
297
|
+
* t.draw(() => {
|
|
298
|
+
* t.background(20, 20, 40);
|
|
299
|
+
*
|
|
300
|
+
* // Rotate the layer over time
|
|
301
|
+
* rotatingLayer.rotateZ(t.frameCount * 2);
|
|
302
|
+
*
|
|
303
|
+
* t.charColor(100, 200, 255);
|
|
304
|
+
* t.char('-');
|
|
305
|
+
* t.rect(t.grid.cols, t.grid.rows);
|
|
306
|
+
* });
|
|
307
|
+
* ```
|
|
302
308
|
*/
|
|
303
309
|
rotateZ(z?: number): number | void;
|
|
304
310
|
/**
|
package/package.json
CHANGED