x_ite-node 1.0.2 → 1.0.4
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 +12 -0
- package/package.json +3 -6
- package/src/index.js +6 -4
package/README.md
CHANGED
|
@@ -21,20 +21,32 @@ const
|
|
|
21
21
|
|
|
22
22
|
async function main ()
|
|
23
23
|
{
|
|
24
|
+
// Add and load required profile and components:
|
|
25
|
+
|
|
24
26
|
scene .setProfile (browser .getProfile ("Interchange"));
|
|
25
27
|
scene .addComponent (browser .getComponent ("Interpolation", 1));
|
|
26
28
|
|
|
27
29
|
await browser .loadComponents (scene);
|
|
28
30
|
|
|
31
|
+
// Create and add some nodes to scene:
|
|
32
|
+
|
|
29
33
|
scene .rootNodes .push (scene .createNode ("Transform"));
|
|
30
34
|
...
|
|
31
35
|
|
|
36
|
+
// Generate XML file:
|
|
37
|
+
|
|
32
38
|
console .log (scene .toXMLString ());
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
main ();
|
|
36
42
|
```
|
|
37
43
|
|
|
44
|
+
Useful information on how to access the external browser and documentation on all X_ITE functions can be found via the following links:
|
|
45
|
+
|
|
46
|
+
* [External Browser](https://create3000.github.io/x_ite/accessing-the-external-browser/)
|
|
47
|
+
* [Scripting Reference](https://create3000.github.io/x_ite/reference/ecmascript-object-and-function-definitions/)
|
|
48
|
+
* [Components](https://create3000.github.io/x_ite/components/overview/)
|
|
49
|
+
|
|
38
50
|
## See Also
|
|
39
51
|
|
|
40
52
|
* [X_ITE](https://create3000.github.io/x_ite/)
|
package/package.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x_ite-node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Pure Node.js wrapper of X_ITE",
|
|
5
5
|
"main": "src/index.js",
|
|
6
|
-
"engines": {
|
|
7
|
-
"node": ">=23.1.0"
|
|
8
|
-
},
|
|
9
6
|
"files": [
|
|
10
7
|
"src/*"
|
|
11
8
|
],
|
|
@@ -44,7 +41,7 @@
|
|
|
44
41
|
"bugs": {
|
|
45
42
|
"url": "https://github.com/create3000/x_ite-node/issues"
|
|
46
43
|
},
|
|
47
|
-
"homepage": "https://github.com/create3000/x_ite-node",
|
|
44
|
+
"homepage": "https://github.com/create3000/x_ite-node#readme",
|
|
48
45
|
"contributors": [
|
|
49
46
|
{
|
|
50
47
|
"name": "Holger Seelig",
|
|
@@ -61,7 +58,7 @@
|
|
|
61
58
|
"node-localstorage": "^3.0.5",
|
|
62
59
|
"nogl": "^1.1.0",
|
|
63
60
|
"skia-canvas": "^1.0.2",
|
|
64
|
-
"x_ite": "^10.5.
|
|
61
|
+
"x_ite": "^10.5.11"
|
|
65
62
|
},
|
|
66
63
|
"devDependencies": {
|
|
67
64
|
"jest": "^29.7.0",
|
package/src/index.js
CHANGED
|
@@ -291,11 +291,13 @@ const { Canvas } = require ("skia-canvas");
|
|
|
291
291
|
|
|
292
292
|
const getContext = HTMLCanvasElement .prototype .getContext;
|
|
293
293
|
|
|
294
|
-
HTMLCanvasElement .prototype .getContext = function (... args)
|
|
294
|
+
HTMLCanvasElement .prototype .getContext = function (contextType, ... args)
|
|
295
295
|
{
|
|
296
|
-
if (
|
|
296
|
+
if (contextType === "2d")
|
|
297
297
|
{
|
|
298
|
-
const canvas = new Canvas (
|
|
298
|
+
const canvas = new Canvas ();
|
|
299
|
+
|
|
300
|
+
canvas .toDataURL = canvas .toDataURLSync;
|
|
299
301
|
|
|
300
302
|
return Object .assign (canvas .getContext ("2d"),
|
|
301
303
|
{
|
|
@@ -304,7 +306,7 @@ HTMLCanvasElement .prototype .getContext = function (... args)
|
|
|
304
306
|
}
|
|
305
307
|
else
|
|
306
308
|
{
|
|
307
|
-
return getContext .call (this, ... args);
|
|
309
|
+
return getContext .call (this, contextType, ... args);
|
|
308
310
|
}
|
|
309
311
|
};
|
|
310
312
|
|