textmode.export.js 1.2.0 → 1.2.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.
- package/README.md +15 -9
- package/dist/textmode.export.esm.js +962 -942
- package/dist/textmode.export.umd.js +2 -2
- package/dist/types/exporters/gif/GIFExporter.d.ts +2 -1
- package/dist/types/exporters/gif/GIFExporter.d.ts.map +1 -1
- package/dist/types/exporters/gif/GIFRecorder.d.ts +1 -1
- package/dist/types/exporters/gif/GIFRecorder.d.ts.map +1 -1
- package/dist/types/exporters/gif/types.d.ts +2 -2
- package/dist/types/exporters/gif/types.d.ts.map +1 -1
- package/dist/types/exporters/svg/SVGContentGenerator.d.ts +2 -1
- package/dist/types/exporters/svg/SVGContentGenerator.d.ts.map +1 -1
- package/dist/types/exporters/svg/SVGPathGenerator.d.ts +1 -1
- package/dist/types/exporters/svg/SVGPathGenerator.d.ts.map +1 -1
- package/dist/types/exporters/txt/TXTExporter.d.ts.map +1 -1
- package/dist/types/exporters/video/VideoExporter.d.ts +2 -1
- package/dist/types/exporters/video/VideoExporter.d.ts.map +1 -1
- package/dist/types/exporters/video/VideoRecorder.d.ts +1 -1
- package/dist/types/exporters/video/VideoRecorder.d.ts.map +1 -1
- package/dist/types/index.d.ts +76 -20
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/overlay/blades/GIFBlade.d.ts.map +1 -1
- package/dist/types/overlay/core/OverlayController.d.ts +4 -0
- package/dist/types/overlay/core/OverlayController.d.ts.map +1 -1
- package/dist/types/types.d.ts +31 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Besides exporting programatically, `textmode.export.js` also provides an overlay
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
21
21
|
### Prerequisites
|
|
22
|
-
- `textmode.export.js` requires `textmode.js` v0.
|
|
22
|
+
- The latest `textmode.export.js` version requires `textmode.js` v0.7.0 or later.
|
|
23
23
|
|
|
24
24
|
### UMD
|
|
25
25
|
|
|
@@ -52,9 +52,7 @@ const t = textmode.create({
|
|
|
52
52
|
fontSize: 16,
|
|
53
53
|
frameRate: 60,
|
|
54
54
|
plugins: [
|
|
55
|
-
|
|
56
|
-
overlay: false
|
|
57
|
-
})
|
|
55
|
+
ExportPlugin
|
|
58
56
|
]
|
|
59
57
|
});
|
|
60
58
|
|
|
@@ -79,6 +77,11 @@ t.draw(() => {
|
|
|
79
77
|
}
|
|
80
78
|
});
|
|
81
79
|
|
|
80
|
+
// Control the export overlay UI at runtime
|
|
81
|
+
// t.exportOverlay.hide(); // Hide the overlay
|
|
82
|
+
// t.exportOverlay.show(); // Show the overlay
|
|
83
|
+
// t.exportOverlay.toggle(); // Toggle visibility
|
|
84
|
+
|
|
82
85
|
t.windowResized(() => {
|
|
83
86
|
t.resizeCanvas(window.innerWidth, window.innerHeight);
|
|
84
87
|
});
|
|
@@ -111,7 +114,7 @@ Then, you can import it in your JavaScript or TypeScript files:
|
|
|
111
114
|
```javascript
|
|
112
115
|
// sketch.js
|
|
113
116
|
import { textmode } from 'textmode.js';
|
|
114
|
-
import {
|
|
117
|
+
import { ExportPlugin } from 'textmode.export.js';
|
|
115
118
|
|
|
116
119
|
const t = textmode.create({
|
|
117
120
|
width: window.innerWidth,
|
|
@@ -119,9 +122,7 @@ const t = textmode.create({
|
|
|
119
122
|
fontSize: 16,
|
|
120
123
|
frameRate: 60,
|
|
121
124
|
plugins: [
|
|
122
|
-
|
|
123
|
-
overlay: false
|
|
124
|
-
})
|
|
125
|
+
ExportPlugin
|
|
125
126
|
]
|
|
126
127
|
});
|
|
127
128
|
|
|
@@ -146,6 +147,11 @@ t.draw(() => {
|
|
|
146
147
|
}
|
|
147
148
|
});
|
|
148
149
|
|
|
150
|
+
// Control the export overlay UI at runtime
|
|
151
|
+
// t.exportOverlay.hide(); // Hide the overlay
|
|
152
|
+
// t.exportOverlay.show(); // Show the overlay
|
|
153
|
+
// t.exportOverlay.toggle(); // Toggle visibility
|
|
154
|
+
|
|
149
155
|
t.windowResized(() => {
|
|
150
156
|
t.resizeCanvas(window.innerWidth, window.innerHeight);
|
|
151
157
|
});
|
|
@@ -163,4 +169,4 @@ Now that you have `textmode.export.js` set up, you can explore the following res
|
|
|
163
169
|
|
|
164
170
|
`textmode.export.js` packages [`webm-writer-js`](https://github.com/thenickdude/webm-writer-js) by [**Nicholas Sherlock**](https://github.com/thenickdude) to provide WebM video export support. `webm-writer-js` is distributed under the [**WTFPL v2**](https://en.wikipedia.org/wiki/WTFPL) license.
|
|
165
171
|
|
|
166
|
-
Animated GIF export relies on [`gifenc`](https://github.com/mattdesl/gifenc) by [**Matt DesLauriers**](https://github.com/mattdesl), available under the [**MIT License**](https://opensource.org/licenses/MIT).
|
|
172
|
+
Animated GIF export relies on [`gifenc`](https://github.com/mattdesl/gifenc) by [**Matt DesLauriers**](https://github.com/mattdesl), available under the [**MIT License**](https://opensource.org/licenses/MIT).
|