pixi-solid 0.0.1 → 0.0.2

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.
Files changed (73) hide show
  1. package/dist/index.js +8 -7
  2. package/dist/pixi-application.js +86 -0
  3. package/dist/pixi-application.js.map +1 -0
  4. package/dist/pixi-canvas.js +79 -0
  5. package/dist/pixi-canvas.js.map +1 -0
  6. package/dist/pixi-components.js +197 -0
  7. package/dist/pixi-components.js.map +1 -0
  8. package/dist/pixi-events.js +40 -38
  9. package/dist/pixi-events.js.map +1 -1
  10. package/dist/pixi-stage.js +36 -0
  11. package/dist/pixi-stage.js.map +1 -0
  12. package/dist/renderer.js +59 -0
  13. package/dist/renderer.js.map +1 -0
  14. package/dist/universal.js +204 -0
  15. package/dist/universal.js.map +1 -0
  16. package/dist/use-ticker.js +44 -0
  17. package/dist/use-ticker.js.map +1 -0
  18. package/package.json +3 -2
  19. package/dist/examples/AnimatedSprite.example.jsx +0 -17
  20. package/dist/examples/AnimatedSprite.example.jsx.map +0 -1
  21. package/dist/examples/BitmapText.example.jsx +0 -8
  22. package/dist/examples/BitmapText.example.jsx.map +0 -1
  23. package/dist/examples/Container.example.jsx +0 -8
  24. package/dist/examples/Container.example.jsx.map +0 -1
  25. package/dist/examples/Graphics.example.jsx +0 -7
  26. package/dist/examples/Graphics.example.jsx.map +0 -1
  27. package/dist/examples/HTMLText.example.jsx +0 -5
  28. package/dist/examples/HTMLText.example.jsx.map +0 -1
  29. package/dist/examples/MeshPlane.example.jsx +0 -6
  30. package/dist/examples/MeshPlane.example.jsx.map +0 -1
  31. package/dist/examples/MeshRope.example.jsx +0 -10
  32. package/dist/examples/MeshRope.example.jsx.map +0 -1
  33. package/dist/examples/MeshSimple.example.jsx +0 -9
  34. package/dist/examples/MeshSimple.example.jsx.map +0 -1
  35. package/dist/examples/NineSliceSprite.example.jsx +0 -7
  36. package/dist/examples/NineSliceSprite.example.jsx.map +0 -1
  37. package/dist/examples/ParticleContainer.example.jsx +0 -30
  38. package/dist/examples/ParticleContainer.example.jsx.map +0 -1
  39. package/dist/examples/PerspectiveMesh.example.jsx +0 -6
  40. package/dist/examples/PerspectiveMesh.example.jsx.map +0 -1
  41. package/dist/examples/PixiApplication.example.jsx +0 -12
  42. package/dist/examples/PixiApplication.example.jsx.map +0 -1
  43. package/dist/examples/PixiCanvas.example.jsx +0 -12
  44. package/dist/examples/PixiCanvas.example.jsx.map +0 -1
  45. package/dist/examples/PixiStage.example.jsx +0 -12
  46. package/dist/examples/PixiStage.example.jsx.map +0 -1
  47. package/dist/examples/RenderContainer.example.jsx +0 -8
  48. package/dist/examples/RenderContainer.example.jsx.map +0 -1
  49. package/dist/examples/RenderLayer.example.jsx +0 -10
  50. package/dist/examples/RenderLayer.example.jsx.map +0 -1
  51. package/dist/examples/Sprite.example.jsx +0 -6
  52. package/dist/examples/Sprite.example.jsx.map +0 -1
  53. package/dist/examples/Text.example.jsx +0 -9
  54. package/dist/examples/Text.example.jsx.map +0 -1
  55. package/dist/examples/TilingSprite.example.jsx +0 -6
  56. package/dist/examples/TilingSprite.example.jsx.map +0 -1
  57. package/dist/examples/useTick.example.jsx +0 -12
  58. package/dist/examples/useTick.example.jsx.map +0 -1
  59. package/dist/examples/useTicker.example.jsx +0 -8
  60. package/dist/examples/useTicker.example.jsx.map +0 -1
  61. package/dist/index.js.map +0 -1
  62. package/dist/pixi-application.jsx +0 -86
  63. package/dist/pixi-application.jsx.map +0 -1
  64. package/dist/pixi-canvas.jsx +0 -65
  65. package/dist/pixi-canvas.jsx.map +0 -1
  66. package/dist/pixi-components.jsx +0 -214
  67. package/dist/pixi-components.jsx.map +0 -1
  68. package/dist/pixi-stage.jsx +0 -30
  69. package/dist/pixi-stage.jsx.map +0 -1
  70. package/dist/renderer.jsx +0 -74
  71. package/dist/renderer.jsx.map +0 -1
  72. package/dist/use-ticker.jsx +0 -39
  73. package/dist/use-ticker.jsx.map +0 -1
@@ -0,0 +1,204 @@
1
+ import { createComponent, createMemo, createRenderEffect, createRoot, mergeProps, untrack } from "solid-js";
2
+
3
+ //#region node_modules/solid-js/universal/dist/universal.js
4
+ var memo = (fn) => createMemo(() => fn());
5
+ function createRenderer$1({ createElement, createTextNode, isTextNode, replaceText, insertNode, removeNode, setProperty, getParentNode, getFirstChild, getNextSibling }) {
6
+ function insert(parent, accessor, marker, initial) {
7
+ if (marker !== void 0 && !initial) initial = [];
8
+ if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
9
+ createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
10
+ }
11
+ function insertExpression(parent, value, current, marker, unwrapArray) {
12
+ while (typeof current === "function") current = current();
13
+ if (value === current) return current;
14
+ const t = typeof value, multi = marker !== void 0;
15
+ if (t === "string" || t === "number") {
16
+ if (t === "number") value = value.toString();
17
+ if (multi) {
18
+ let node = current[0];
19
+ if (node && isTextNode(node)) replaceText(node, value);
20
+ else node = createTextNode(value);
21
+ current = cleanChildren(parent, current, marker, node);
22
+ } else if (current !== "" && typeof current === "string") replaceText(getFirstChild(parent), current = value);
23
+ else {
24
+ cleanChildren(parent, current, marker, createTextNode(value));
25
+ current = value;
26
+ }
27
+ } else if (value == null || t === "boolean") current = cleanChildren(parent, current, marker);
28
+ else if (t === "function") {
29
+ createRenderEffect(() => {
30
+ let v = value();
31
+ while (typeof v === "function") v = v();
32
+ current = insertExpression(parent, v, current, marker);
33
+ });
34
+ return () => current;
35
+ } else if (Array.isArray(value)) {
36
+ const array = [];
37
+ if (normalizeIncomingArray(array, value, unwrapArray)) {
38
+ createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
39
+ return () => current;
40
+ }
41
+ if (array.length === 0) {
42
+ const replacement = cleanChildren(parent, current, marker);
43
+ if (multi) return current = replacement;
44
+ } else if (Array.isArray(current)) if (current.length === 0) appendNodes(parent, array, marker);
45
+ else reconcileArrays(parent, current, array);
46
+ else if (current == null || current === "") appendNodes(parent, array);
47
+ else reconcileArrays(parent, multi && current || [getFirstChild(parent)], array);
48
+ current = array;
49
+ } else {
50
+ if (Array.isArray(current)) {
51
+ if (multi) return current = cleanChildren(parent, current, marker, value);
52
+ cleanChildren(parent, current, null, value);
53
+ } else if (current == null || current === "" || !getFirstChild(parent)) insertNode(parent, value);
54
+ else replaceNode(parent, value, getFirstChild(parent));
55
+ current = value;
56
+ }
57
+ return current;
58
+ }
59
+ function normalizeIncomingArray(normalized, array, unwrap) {
60
+ let dynamic = false;
61
+ for (let i = 0, len = array.length; i < len; i++) {
62
+ let item = array[i], t;
63
+ if (item == null || item === true || item === false);
64
+ else if (Array.isArray(item)) dynamic = normalizeIncomingArray(normalized, item) || dynamic;
65
+ else if ((t = typeof item) === "string" || t === "number") normalized.push(createTextNode(item));
66
+ else if (t === "function") if (unwrap) {
67
+ while (typeof item === "function") item = item();
68
+ dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;
69
+ } else {
70
+ normalized.push(item);
71
+ dynamic = true;
72
+ }
73
+ else normalized.push(item);
74
+ }
75
+ return dynamic;
76
+ }
77
+ function reconcileArrays(parentNode, a, b) {
78
+ let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = getNextSibling(a[aEnd - 1]), map = null;
79
+ while (aStart < aEnd || bStart < bEnd) {
80
+ if (a[aStart] === b[bStart]) {
81
+ aStart++;
82
+ bStart++;
83
+ continue;
84
+ }
85
+ while (a[aEnd - 1] === b[bEnd - 1]) {
86
+ aEnd--;
87
+ bEnd--;
88
+ }
89
+ if (aEnd === aStart) {
90
+ const node = bEnd < bLength ? bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart] : after;
91
+ while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);
92
+ } else if (bEnd === bStart) while (aStart < aEnd) {
93
+ if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);
94
+ aStart++;
95
+ }
96
+ else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
97
+ const node = getNextSibling(a[--aEnd]);
98
+ insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));
99
+ insertNode(parentNode, b[--bEnd], node);
100
+ a[aEnd] = b[bEnd];
101
+ } else {
102
+ if (!map) {
103
+ map = /* @__PURE__ */ new Map();
104
+ let i = bStart;
105
+ while (i < bEnd) map.set(b[i], i++);
106
+ }
107
+ const index = map.get(a[aStart]);
108
+ if (index != null) if (bStart < index && index < bEnd) {
109
+ let i = aStart, sequence = 1, t;
110
+ while (++i < aEnd && i < bEnd) {
111
+ if ((t = map.get(a[i])) == null || t !== index + sequence) break;
112
+ sequence++;
113
+ }
114
+ if (sequence > index - bStart) {
115
+ const node = a[aStart];
116
+ while (bStart < index) insertNode(parentNode, b[bStart++], node);
117
+ } else replaceNode(parentNode, b[bStart++], a[aStart++]);
118
+ } else aStart++;
119
+ else removeNode(parentNode, a[aStart++]);
120
+ }
121
+ }
122
+ }
123
+ function cleanChildren(parent, current, marker, replacement) {
124
+ if (marker === void 0) {
125
+ let removed;
126
+ while (removed = getFirstChild(parent)) removeNode(parent, removed);
127
+ replacement && insertNode(parent, replacement);
128
+ return "";
129
+ }
130
+ const node = replacement || createTextNode("");
131
+ if (current.length) {
132
+ let inserted = false;
133
+ for (let i = current.length - 1; i >= 0; i--) {
134
+ const el = current[i];
135
+ if (node !== el) {
136
+ const isParent = getParentNode(el) === parent;
137
+ if (!inserted && !i) isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);
138
+ else isParent && removeNode(parent, el);
139
+ } else inserted = true;
140
+ }
141
+ } else insertNode(parent, node, marker);
142
+ return [node];
143
+ }
144
+ function appendNodes(parent, array, marker) {
145
+ for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);
146
+ }
147
+ function replaceNode(parent, newNode, oldNode) {
148
+ insertNode(parent, newNode, oldNode);
149
+ removeNode(parent, oldNode);
150
+ }
151
+ function spreadExpression(node, props, prevProps = {}, skipChildren) {
152
+ props || (props = {});
153
+ if (!skipChildren) createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
154
+ createRenderEffect(() => props.ref && props.ref(node));
155
+ createRenderEffect(() => {
156
+ for (const prop in props) {
157
+ if (prop === "children" || prop === "ref") continue;
158
+ const value = props[prop];
159
+ if (value === prevProps[prop]) continue;
160
+ setProperty(node, prop, value, prevProps[prop]);
161
+ prevProps[prop] = value;
162
+ }
163
+ });
164
+ return prevProps;
165
+ }
166
+ return {
167
+ render(code, element) {
168
+ let disposer;
169
+ createRoot((dispose) => {
170
+ disposer = dispose;
171
+ insert(element, code());
172
+ });
173
+ return disposer;
174
+ },
175
+ insert,
176
+ spread(node, accessor, skipChildren) {
177
+ if (typeof accessor === "function") createRenderEffect((current) => spreadExpression(node, accessor(), current, skipChildren));
178
+ else spreadExpression(node, accessor, void 0, skipChildren);
179
+ },
180
+ createElement,
181
+ createTextNode,
182
+ insertNode,
183
+ setProp(node, name, value, prev) {
184
+ setProperty(node, name, value, prev);
185
+ return value;
186
+ },
187
+ mergeProps,
188
+ effect: createRenderEffect,
189
+ memo,
190
+ createComponent,
191
+ use(fn, element, arg) {
192
+ return untrack(() => fn(element, arg));
193
+ }
194
+ };
195
+ }
196
+ function createRenderer(options) {
197
+ const renderer = createRenderer$1(options);
198
+ renderer.mergeProps = mergeProps;
199
+ return renderer;
200
+ }
201
+
202
+ //#endregion
203
+ export { createRenderer };
204
+ //# sourceMappingURL=universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"universal.js","names":[],"sources":["../node_modules/solid-js/universal/dist/universal.js"],"sourcesContent":["import { createMemo, createRoot, createRenderEffect, mergeProps, createComponent, untrack } from 'solid-js';\n\nconst memo = fn => createMemo(() => fn());\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), current = value);\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return current = replacement;\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, multi && current || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return current = cleanChildren(parent, current, marker, value);\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false) ; else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart] : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while (removed = getFirstChild(parent)) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i) isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nex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AE;AACpB,MAAI,CAAC,aACH,0BAAyB,UAAU,WAAW,iBAAiB,MAAM,MAAM,UAAU,UAAU,SAAS,CAAC;AAE3G,2BAAyB,MAAM,OAAO,MAAM,IAAI,KAAK,CAAC;AACtD,2BAAyB;AACvB,QAAK,MAAM,QAAQ,OAAO;AACxB,QAAI,SAAS,cAAc,SAAS,MAAO;IAC3C,MAAM,QAAQ,MAAM;AACpB,QAAI,UAAU,UAAU,MAAO;AAC/B,gBAAY,MAAM,MAAM,OAAO,UAAU,MAAM;AAC/C,cAAU,QAAQ;;IAEpB;AACF,SAAO;;AAET,QAAO;EACL,OAAO,MAAM,SAAS;GACpB,IAAI;AACJ,eAAW,YAAW;AACpB,eAAW;AACX,WAAO,SAAS,MAAM,CAAC;KACvB;AACF,UAAO;;EAET;EACA,OAAO,MAAM,UAAU,cAAc;AACnC,OAAI,OAAO,aAAa,WACtB,qBAAmB,YAAW,iBAAiB,MAAM,UAAU,EAAE,SAAS,aAAa,CAAC;OACnF,kBAAiB,MAAM,UAAU,QAAW,aAAa;;EAElE;EACA;EACA;EACA,QAAQ,MAAM,MAAM,OAAO,MAAM;AAC/B,eAAY,MAAM,MAAM,OAAO,KAAK;AACpC,UAAO;;EAET;EACA,QAAQ;EACR;EACA;EACA,IAAI,IAAI,SAAS,KAAK;AACpB,UAAO,cAAc,GAAG,SAAS,IAAI,CAAC;;EAEzC;;AAGH,SAAS,eAAe,SAAS;CAC/B,MAAM,WAAW,iBAAiB,QAAQ;AAC1C,UAAS,aAAa;AACtB,QAAO"}
@@ -0,0 +1,44 @@
1
+ import { usePixiApp } from "./pixi-application.js";
2
+ import { onCleanup } from "solid-js";
3
+
4
+ //#region src/use-ticker.tsx
5
+ /**
6
+ * useTicker
7
+ *
8
+ * A custom SolidJS hook that provides access to the PIXI.Application's shared Ticker instance.
9
+ * This hook must be called from a component that is a descendant of `PixiApplication`.
10
+ *
11
+ * @returns The PIXI.Ticker instance from the application context.
12
+ * @throws Will throw an error if used outside of a `PixiApplication` context provider.
13
+ *
14
+ * **Example**
15
+ * {@includeCode ./examples/useTicker.example.tsx}
16
+ */
17
+ const useTicker = () => usePixiApp().ticker;
18
+ /**
19
+ * useTick
20
+ *
21
+ * A custom SolidJS hook that registers a callback function to be executed on every frame
22
+ * of the PIXI.Application's ticker. The callback is automatically removed when the
23
+ * component or hook's owning computation is cleaned up.
24
+ *
25
+ * This hook must be called from a component that is a descendant of `PixiApplication`.
26
+ *
27
+ * @param tickerCallback - The function to call on each ticker update. It receives
28
+ * the `PIXI.Ticker` instance as its argument.
29
+ *
30
+ * **Example**
31
+ * @example {@link ./examples/useTick.example.tsx}
32
+ * {@includeCode ./examples/useTick.example.tsx}
33
+ */
34
+ const useTick = (tickerCallback) => {
35
+ const { ticker } = usePixiApp();
36
+ ticker.add(tickerCallback);
37
+ onCleanup(() => {
38
+ ticker.remove(tickerCallback);
39
+ });
40
+ };
41
+
42
+ //#endregion
43
+ export { useTick, useTicker };
44
+ //# sourceMappingURL=use-ticker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-ticker.js","names":["Ticker","TickerCallback","onCleanup","usePixiApp","useTicker","ticker","useTick","tickerCallback","add","remove"],"sources":["../src/use-ticker.tsx"],"sourcesContent":["import type { Ticker, TickerCallback } from \"pixi.js\";\n\nimport { onCleanup } from \"solid-js\";\nimport { usePixiApp } from \"./pixi-application\";\n\n/**\n * useTicker\n *\n * A custom SolidJS hook that provides access to the PIXI.Application's shared Ticker instance.\n * This hook must be called from a component that is a descendant of `PixiApplication`.\n *\n * @returns The PIXI.Ticker instance from the application context.\n * @throws Will throw an error if used outside of a `PixiApplication` context provider.\n *\n * **Example**\n * {@includeCode ./examples/useTicker.example.tsx}\n */\nexport const useTicker = (): Ticker => usePixiApp().ticker;\n\n/**\n * useTick\n *\n * A custom SolidJS hook that registers a callback function to be executed on every frame\n * of the PIXI.Application's ticker. The callback is automatically removed when the\n * component or hook's owning computation is cleaned up.\n *\n * This hook must be called from a component that is a descendant of `PixiApplication`.\n *\n * @param tickerCallback - The function to call on each ticker update. It receives\n * the `PIXI.Ticker` instance as its argument.\n *\n * **Example**\n * @example {@link ./examples/useTick.example.tsx}\n * {@includeCode ./examples/useTick.example.tsx}\n */\nexport const useTick = (tickerCallback: TickerCallback<Ticker>): void => {\n const { ticker } = usePixiApp();\n\n ticker.add(tickerCallback);\n onCleanup(() => {\n ticker.remove(tickerCallback);\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAaI,kBAA0BD,YAAY,CAACE;;;;;;;;;;;;;;;;;AAkBpD,MAAaC,WAAWC,mBAAiD;CACvE,MAAM,EAAEF,WAAWF,YAAY;AAE/BE,QAAOG,IAAID,eAAe;AAC1BL,iBAAgB;AACdG,SAAOI,OAAOF,eAAe;GAC7B"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "pixi-solid",
3
- "version": "0.0.1",
3
+ "private": false,
4
+ "version": "0.0.2",
4
5
  "description": "A library to write PixiJS applications with SolidJS",
5
6
  "author": "Luke Thompson",
6
7
  "license": "MIT",
@@ -24,7 +25,7 @@
24
25
  "scripts": {
25
26
  "dev": "vite",
26
27
  "prebuild": "rm -rf dist",
27
- "build": "tsc --project tsconfig.build.json && npm run build:docs",
28
+ "build": "vite build && tsc --project tsconfig.build.json --emitDeclarationOnly && npm run build:docs",
28
29
  "build:docs": "typedoc --options typedoc.config.js",
29
30
  "prepublishOnly": "npm run build",
30
31
  "preview": "vite preview"
@@ -1,17 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { AnimatedSprite } from "pixi-solid";
3
- export const MyAnimatedSpriteComponent = () => {
4
- let spriteRef;
5
- const textures = [
6
- Texture.from("path/to/your/image1.png"),
7
- Texture.from("path/to/your/image2.png"),
8
- Texture.from("path/to/your/image3.png"),
9
- ];
10
- const handlePointerDown = (e) => {
11
- if (!spriteRef)
12
- return;
13
- spriteRef.play();
14
- };
15
- return (<AnimatedSprite textures={textures} ref={spriteRef} autoPlay={true} onpointerdown={handlePointerDown} animationSpeed={0.1} x={100} y={150} anchor={{ x: 0.5, y: 0.5 }}/>);
16
- };
17
- //# sourceMappingURL=AnimatedSprite.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnimatedSprite.example.jsx","sourceRoot":"","sources":["../../src/examples/AnimatedSprite.example.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,IAAI,SAA0C,CAAC;IAE/C,MAAM,QAAQ,GAAG;QACf,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC;KACxC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,CAAsB,EAAE,EAAE;QACnD,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,SAAS,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,cAAc,CACb,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,QAAQ,CAAC,CAAC,IAAI,CAAC,CACf,aAAa,CAAC,CAAC,iBAAiB,CAAC,CACjC,cAAc,CAAC,CAAC,GAAG,CAAC,CACpB,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAC3B,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { BitmapFont } from "pixi.js";
2
- import { BitmapText } from "pixi-solid";
3
- // Assume a bitmap font is loaded, e.g., using Assets.load
4
- // BitmapFont.from("my-font-name", { fill: "#ffffff", fontSize: 32 });
5
- export const MyBitmapTextComponent = () => {
6
- return (<BitmapText text="Hello World" style={{ fontFamily: "my-font-name", fontSize: 32, fill: "#ffcc00" }} x={100} y={150} anchor={{ x: 0.5, y: 0.5 }}/>);
7
- };
8
- //# sourceMappingURL=BitmapText.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BitmapText.example.jsx","sourceRoot":"","sources":["../../src/examples/BitmapText.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,0DAA0D;AAC1D,sEAAsE;AAEtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,OAAO,CACL,CAAC,UAAU,CACT,IAAI,CAAC,aAAa,CAClB,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CACrE,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAC3B,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { Container, Sprite } from "pixi-solid";
3
- export const MyContainerComponent = () => {
4
- return (<Container x={50} y={50}>
5
- <Sprite texture={Texture.from("path/to/your/image.png")} x={100} y={150} anchor={{ x: 0.5, y: 0.5 }}/>
6
- </Container>);
7
- };
8
- //# sourceMappingURL=Container.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Container.example.jsx","sourceRoot":"","sources":["../../src/examples/Container.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,OAAO,CACL,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CACtB;MAAA,CAAC,MAAM,CACL,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAChD,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAE/B;IAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Graphics } from "pixi-solid";
2
- export const MyGraphicsComponent = () => {
3
- return (<Graphics ref={(graphics) => {
4
- graphics.rect(50, 50, 100, 100).fill(0xff0000);
5
- }}/>);
6
- };
7
- //# sourceMappingURL=Graphics.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Graphics.example.jsx","sourceRoot":"","sources":["../../src/examples/Graphics.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,OAAO,CACL,CAAC,QAAQ,CACP,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE;YAChB,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjD,CAAC,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { HTMLText } from "pixi-solid";
2
- export const MyHTMLTextComponent = () => {
3
- return (<HTMLText text={'<p style="color:white; font-size: 24px;">Hello <b>World</b></p>'} x={100} y={150}/>);
4
- };
5
- //# sourceMappingURL=HTMLText.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HTMLText.example.jsx","sourceRoot":"","sources":["../../src/examples/HTMLText.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,OAAO,CACL,CAAC,QAAQ,CACP,IAAI,CAAC,CAAC,iEAAiE,CAAC,CACxE,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,GAAG,CAAC,EACP,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { MeshPlane } from "pixi-solid";
3
- export const MyMeshPlaneComponent = () => {
4
- return <MeshPlane texture={Texture.from("path/to/your/image.png")}/>;
5
- };
6
- //# sourceMappingURL=MeshPlane.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MeshPlane.example.jsx","sourceRoot":"","sources":["../../src/examples/MeshPlane.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,EAAG,CAAC;AACxE,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Point, Texture } from "pixi.js";
2
- import { MeshRope } from "pixi-solid";
3
- export const MyMeshRopeComponent = () => {
4
- const points = [];
5
- for (let i = 0; i < 20; i++) {
6
- points.push(new Point(i * 40, Math.sin(i * 0.5) * 30));
7
- }
8
- return <MeshRope texture={Texture.from("path/to/rope.png")} points={points}/>;
9
- };
10
- //# sourceMappingURL=MeshRope.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MeshRope.example.jsx","sourceRoot":"","sources":["../../src/examples/MeshRope.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAG,CAAC;AACjF,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { MeshSimple } from "pixi-solid";
3
- export const MyMeshSimpleComponent = () => {
4
- const vertices = new Float32Array([-100, -100, 100, -100, 100, 100, -100, 100]);
5
- const uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]);
6
- const indices = new Uint32Array([0, 1, 2, 0, 2, 3]);
7
- return (<MeshSimple texture={Texture.from("path/to/your/image.png")} vertices={vertices} uvs={uvs} indices={indices}/>);
8
- };
9
- //# sourceMappingURL=MeshSimple.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MeshSimple.example.jsx","sourceRoot":"","sources":["../../src/examples/MeshSimple.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAChF,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEpD,OAAO,CACL,CAAC,UAAU,CACT,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAChD,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,OAAO,CAAC,CAAC,OAAO,CAAC,EACjB,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { NineSliceSprite } from "pixi-solid";
3
- export const MyNineSliceSpriteComponent = () => {
4
- // Assumes a texture that is a 3x3 grid for slicing
5
- return (<NineSliceSprite texture={Texture.from("path/to/your/nine-slice-image.png")} leftWidth={20} topHeight={20} rightWidth={20} bottomHeight={20} width={200} height={100}/>);
6
- };
7
- //# sourceMappingURL=NineSliceSprite.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NineSliceSprite.example.jsx","sourceRoot":"","sources":["../../src/examples/NineSliceSprite.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,mDAAmD;IACnD,OAAO,CACL,CAAC,eAAe,CACd,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAC3D,SAAS,CAAC,CAAC,EAAE,CAAC,CACd,SAAS,CAAC,CAAC,EAAE,CAAC,CACd,UAAU,CAAC,CAAC,EAAE,CAAC,CACf,YAAY,CAAC,CAAC,EAAE,CAAC,CACjB,KAAK,CAAC,CAAC,GAAG,CAAC,CACX,MAAM,CAAC,CAAC,GAAG,CAAC,EACZ,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,30 +0,0 @@
1
- import { Particle, Texture } from "pixi.js";
2
- import { ParticleContainer, useTick } from "pixi-solid";
3
- import { onMount } from "solid-js";
4
- export const MyParticleContainerComponent = () => {
5
- // Get a ref to the ParticleContainer
6
- let particleContainer;
7
- // Create the particle instances
8
- const particles = Array.from({ length: 100 }, () => new Particle({
9
- texture: Texture.from("path/to/your/particle.png"),
10
- x: Math.random() * 800,
11
- y: Math.random() * 600,
12
- anchorX: 0.5,
13
- anchorY: 0.5,
14
- }));
15
- // Update the particles imperatively in a useTick hook
16
- useTick((ticker) => {
17
- particles.forEach((particle) => {
18
- particle.rotation += 0.01 * ticker.deltaTime;
19
- particle.x = Math.sin(particle.rotation) * 100 + 400;
20
- particle.y = Math.cos(particle.rotation) * 100 + 300;
21
- });
22
- });
23
- onMount(() => {
24
- if (!particleContainer)
25
- return;
26
- particleContainer.addParticle(...particles);
27
- });
28
- return <ParticleContainer ref={particleContainer}/>;
29
- };
30
- //# sourceMappingURL=ParticleContainer.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParticleContainer.example.jsx","sourceRoot":"","sources":["../../src/examples/ParticleContainer.example.tsx"],"names":[],"mappings":"AACA,OAAO,EA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OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAAC,EAAG,CAAC;AACvD,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { PerspectiveMesh } from "pixi-solid";
3
- export const MyPerspectiveMeshComponent = () => {
4
- return <PerspectiveMesh texture={Texture.from("path/to/your/image.png")}/>;
5
- };
6
- //# sourceMappingURL=PerspectiveMesh.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PerspectiveMesh.example.jsx","sourceRoot":"","sources":["../../src/examples/PerspectiveMesh.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,EAAG,CAAC;AAC9E,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { PixiApplication, PixiCanvas, PixiStage, Sprite } from "pixi-solid";
3
- export const PixiApplicationExample = () => {
4
- return (<PixiApplication background="#1099bb">
5
- <PixiCanvas>
6
- <PixiStage>
7
- <Sprite texture={Texture.WHITE} x={120} y={80}/>
8
- </PixiStage>
9
- </PixiCanvas>
10
- </PixiApplication>);
11
- };
12
- //# sourceMappingURL=PixiApplication.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PixiApplication.example.jsx","sourceRoot":"","sources":["../../src/examples/PixiApplication.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,OAAO,CACL,CAAC,eAAe,CAAC,UAAU,CAAC,SAAS,CACnC;MAAA,CAAC,UAAU,CACT;QAAA,CAAC,SAAS,CACR;UAAA,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAChD;QAAA,EAAE,SAAS,CACb;MAAA,EAAE,UAAU,CACd;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { PixiApplication, PixiCanvas, PixiStage, Sprite } from "pixi-solid";
3
- export const PixiCanvasExample = () => {
4
- return (<PixiApplication>
5
- <PixiCanvas style={{ background: "#1099bb" }}>
6
- <PixiStage>
7
- <Sprite texture={Texture.WHITE} x={100} y={100}/>
8
- </PixiStage>
9
- </PixiCanvas>
10
- </PixiApplication>);
11
- };
12
- //# sourceMappingURL=PixiCanvas.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PixiCanvas.example.jsx","sourceRoot":"","sources":["../../src/examples/PixiCanvas.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO,CACL,CAAC,eAAe,CACd;MAAA,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAC3C;QAAA,CAAC,SAAS,CACR;UAAA,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EACjD;QAAA,EAAE,SAAS,CACb;MAAA,EAAE,UAAU,CACd;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { PixiApplication, PixiCanvas, PixiStage, Sprite } from "pixi-solid";
3
- export const PixiStageExample = () => {
4
- return (<PixiApplication>
5
- <PixiCanvas>
6
- <PixiStage>
7
- <Sprite texture={Texture.WHITE} x={50} y={50}/>
8
- </PixiStage>
9
- </PixiCanvas>
10
- </PixiApplication>);
11
- };
12
- //# sourceMappingURL=PixiStage.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PixiStage.example.jsx","sourceRoot":"","sources":["../../src/examples/PixiStage.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,OAAO,CACL,CAAC,eAAe,CACd;MAAA,CAAC,UAAU,CACT;QAAA,CAAC,SAAS,CACR;UAAA,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/C;QAAA,EAAE,SAAS,CACb;MAAA,EAAE,UAAU,CACd;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { RenderContainer, Sprite } from "pixi-solid";
3
- export const MyRenderContainerComponent = () => {
4
- return (<RenderContainer>
5
- <Sprite texture={Texture.from("path/to/your/image.png")}/>
6
- </RenderContainer>);
7
- };
8
- //# sourceMappingURL=RenderContainer.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RenderContainer.example.jsx","sourceRoot":"","sources":["../../src/examples/RenderContainer.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,OAAO,CACL,CAAC,eAAe,CACd;MAAA,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,EAC1D;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { RenderLayer, Sprite } from "pixi-solid";
3
- export const MyRenderLayerComponent = () => {
4
- // A RenderLayer can contain other objects.
5
- // It's used for advanced rendering effects.
6
- return (<RenderLayer>
7
- <Sprite texture={Texture.from("path/to/your/image.png")}/>
8
- </RenderLayer>);
9
- };
10
- //# sourceMappingURL=RenderLayer.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RenderLayer.example.jsx","sourceRoot":"","sources":["../../src/examples/RenderLayer.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,2CAA2C;IAC3C,4CAA4C;IAC5C,OAAO,CACL,CAAC,WAAW,CACV;MAAA,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,EAC1D;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { Sprite } from "pixi-solid";
3
- export const MySpriteComponent = () => {
4
- return (<Sprite texture={Texture.from("path/to/your/image.png")} x={100} y={150} anchor={{ x: 0.5, y: 0.5 }}/>);
5
- };
6
- //# sourceMappingURL=Sprite.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Sprite.example.jsx","sourceRoot":"","sources":["../../src/examples/Sprite.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO,CACL,CAAC,MAAM,CACL,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAChD,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAC3B,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import { Text } from "pixi-solid";
2
- export const MyTextComponent = () => {
3
- return (<Text text="Hello World" x={100} y={150} style={{
4
- fill: "white",
5
- fontSize: 24,
6
- fontFamily: "Arial",
7
- }}/>);
8
- };
9
- //# sourceMappingURL=Text.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.example.jsx","sourceRoot":"","sources":["../../src/examples/Text.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,CACL,CAAC,IAAI,CACH,IAAI,CAAC,aAAa,CAClB,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,GAAG,CAAC,CACP,KAAK,CAAC,CAAC;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,OAAO;SACpB,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { TilingSprite } from "pixi-solid";
3
- export const MyTilingSpriteComponent = () => {
4
- return (<TilingSprite texture={Texture.from("path/to/your/image.png")} width={800} height={600} tilePosition={{ x: 0, y: 0 }}/>);
5
- };
6
- //# sourceMappingURL=TilingSprite.example.jsx.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TilingSprite.example.jsx","sourceRoot":"","sources":["../../src/examples/TilingSprite.example.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,OAAO,CACL,CAAC,YAAY,CACX,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAChD,KAAK,CAAC,CAAC,GAAG,CAAC,CACX,MAAM,CAAC,CAAC,GAAG,CAAC,CACZ,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAC7B,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- import { Texture } from "pixi.js";
2
- import { Sprite, useTick } from "pixi-solid";
3
- export const UseTickExample = () => {
4
- let spriteRef;
5
- useTick((ticker) => {
6
- if (spriteRef) {
7
- spriteRef.rotation += 0.01 * ticker.deltaTime;
8
- }
9
- });
10
- return <Sprite ref={spriteRef} texture={Texture.WHITE} x={100} y={100}/>;
11
- };
12
- //# sourceMappingURL=useTick.example.jsx.map