pixi-solid 0.0.6 → 0.0.8
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/dist/pixi-application.js +0 -14
- package/dist/pixi-application.js.map +1 -1
- package/dist/pixi-canvas.js +2 -7
- package/dist/pixi-canvas.js.map +1 -1
- package/dist/pixi-components.js +18 -97
- package/dist/pixi-components.js.map +1 -1
- package/dist/pixi-events.js.map +1 -1
- package/dist/pixi-stage.js +0 -3
- package/dist/pixi-stage.js.map +1 -1
- package/dist/types/pixi-application.d.ts +0 -14
- package/dist/types/pixi-canvas.d.ts +2 -7
- package/dist/types/pixi-components.d.ts +18 -97
- package/dist/types/pixi-stage.d.ts +0 -3
- package/package.json +2 -16
- package/LICENSE.txt +0 -21
- package/dist/types/examples/AnimatedSprite.example.d.ts +0 -1
- package/dist/types/examples/BitmapText.example.d.ts +0 -1
- package/dist/types/examples/Container.example.d.ts +0 -1
- package/dist/types/examples/Graphics.example.d.ts +0 -1
- package/dist/types/examples/HTMLText.example.d.ts +0 -1
- package/dist/types/examples/MeshPlane.example.d.ts +0 -1
- package/dist/types/examples/MeshRope.example.d.ts +0 -1
- package/dist/types/examples/MeshSimple.example.d.ts +0 -1
- package/dist/types/examples/NineSliceSprite.example.d.ts +0 -1
- package/dist/types/examples/ParticleContainer.example.d.ts +0 -1
- package/dist/types/examples/PerspectiveMesh.example.d.ts +0 -1
- package/dist/types/examples/PixiApplication.example.d.ts +0 -1
- package/dist/types/examples/PixiCanvas.example.d.ts +0 -1
- package/dist/types/examples/PixiStage.example.d.ts +0 -1
- package/dist/types/examples/RenderContainer.example.d.ts +0 -1
- package/dist/types/examples/RenderLayer.example.d.ts +0 -1
- package/dist/types/examples/Sprite.example.d.ts +0 -1
- package/dist/types/examples/Text.example.d.ts +0 -1
- package/dist/types/examples/TilingSprite.example.d.ts +0 -1
- package/dist/types/examples/useTick.example.d.ts +0 -1
- package/dist/types/examples/useTicker.example.d.ts +0 -1
package/dist/pixi-application.js
CHANGED
|
@@ -10,18 +10,6 @@ var PixiAppContext = createContext();
|
|
|
10
10
|
*
|
|
11
11
|
* @returns The PIXI.Application instance provided by the `PixiApplication` component.
|
|
12
12
|
* @throws Will throw an error if used outside of a `PixiApplication` context provider.
|
|
13
|
-
* @example
|
|
14
|
-
* ```tsx
|
|
15
|
-
* const MyComponent = () => {
|
|
16
|
-
* const app = usePixiApp();
|
|
17
|
-
*
|
|
18
|
-
* createEffect(() => {
|
|
19
|
-
* console.log('App resolution:', app.renderer.resolution);
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* return <Sprite texture={Texture.WHITE} />;
|
|
23
|
-
* };
|
|
24
|
-
* ```
|
|
25
13
|
*/
|
|
26
14
|
const usePixiApp = () => {
|
|
27
15
|
const app = useContext(PixiAppContext);
|
|
@@ -37,8 +25,6 @@ const usePixiApp = () => {
|
|
|
37
25
|
*
|
|
38
26
|
* @param props The properties to configure the Pixi.js Application.
|
|
39
27
|
*
|
|
40
|
-
* **Example**
|
|
41
|
-
* {@includeCode ./examples/PixiApplication.example.tsx}
|
|
42
28
|
*/
|
|
43
29
|
const PixiApplication = (props) => {
|
|
44
30
|
const [_solidProps, initialisationProps] = splitProps(props, ["ref", "children"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-application.js","names":["ApplicationOptions","Application","JSX","Ref","createContext","createEffect","createResource","onCleanup","Show","splitProps","useContext","PixiAppContext","usePixiApp","app","Error","PixiApplicationProps","Partial","Omit","ref","children","Element","PixiApplication","props","_solidProps","initialisationProps","appResource","init","autoDensity","resolution","Math","min","window","devicePixelRatio","sharedTicker","arg","ticker","autoStart","start","globalThis","__PIXI_DEVTOOLS__","destroy","_$createComponent","when","Provider","value"],"sources":["../src/pixi-application.tsx"],"sourcesContent":["import type { ApplicationOptions } from \"pixi.js\";\nimport { Application } from \"pixi.js\";\nimport type { JSX, Ref } from \"solid-js\";\nimport {
|
|
1
|
+
{"version":3,"file":"pixi-application.js","names":["ApplicationOptions","Application","JSX","Ref","createContext","createEffect","createResource","onCleanup","Show","splitProps","useContext","PixiAppContext","usePixiApp","app","Error","PixiApplicationProps","Partial","Omit","ref","children","Element","PixiApplication","props","_solidProps","initialisationProps","appResource","init","autoDensity","resolution","Math","min","window","devicePixelRatio","sharedTicker","arg","ticker","autoStart","start","globalThis","__PIXI_DEVTOOLS__","destroy","_$createComponent","when","Provider","value"],"sources":["../src/pixi-application.tsx"],"sourcesContent":["import type { ApplicationOptions } from \"pixi.js\";\nimport { Application } from \"pixi.js\";\nimport type { JSX, Ref } from \"solid-js\";\nimport { createContext, createEffect, createResource, onCleanup, Show, splitProps, useContext } from \"solid-js\";\n\nconst PixiAppContext = createContext<Application>();\n\n/**\n * A custom SolidJS hook to access the root PIXI.Application instance.\n * This hook must be called from a component that is a descendant of `PixiApplication`.\n *\n * @returns The PIXI.Application instance provided by the `PixiApplication` component.\n * @throws Will throw an error if used outside of a `PixiApplication` context provider.\n */\nexport const usePixiApp = () => {\n const app = useContext(PixiAppContext);\n if (!app) {\n throw new Error(\"usePixiApp must be used within a PixiApplication\");\n }\n return app;\n};\n\n/**\n * Props for the `PixiApplication` component. It extends the PIXI.ApplicationOptions\n * to allow passing configuration directly to the Pixi.js Application constructor,\n * but omits properties that are handled by the component itself.\n */\nexport type PixiApplicationProps = Partial<Omit<ApplicationOptions, \"children\" | \"resizeTo\" | \"view\">> & {\n ref?: Ref<Application>;\n children?: JSX.Element;\n};\n\n/**\n * A SolidJS component that creates and manages a PIXI.Application instance.\n * It provides the application instance through context to be used by child components\n * and custom hooks like `usePixiApp`, `useTick`, and `useTicker`.\n *\n * This component should only be used once in your application.\n *\n * @param props The properties to configure the Pixi.js Application.\n *\n */\nexport const PixiApplication = (props: PixiApplicationProps) => {\n const [_solidProps, initialisationProps] = splitProps(props, [\"ref\", \"children\"]);\n\n // TODO: Reinitialise the pixi app if any of the initialisationProps change that we can't set at runtime\n\n const [appResource] = createResource(async () => {\n const app = new Application();\n await app.init({\n autoDensity: true,\n resolution: Math.min(window.devicePixelRatio, 2),\n sharedTicker: true,\n ...initialisationProps,\n });\n\n return app;\n });\n\n createEffect(() => {\n const app = appResource();\n if (app) {\n if (props.ref) {\n // Solid converts the ref prop to a callback function\n (props.ref as unknown as (arg: any) => void)(app);\n }\n\n // TODO: Go through the other props that can be set at runtime and apply them here\n // e.g. backgroundColor => app.renderer.backgroundColor, etc.\n\n app.ticker.autoStart = false;\n app.ticker.start();\n\n // @ts-expect-error\n globalThis.__PIXI_DEVTOOLS__ = {\n app,\n };\n\n onCleanup(() => {\n app.destroy(true, { children: true });\n });\n }\n });\n\n return (\n <Show when={appResource()}>\n {(app) => <PixiAppContext.Provider value={app()}>{props.children}</PixiAppContext.Provider>}\n </Show>\n );\n};\n"],"mappings":";;;;;AAKA,IAAMW,iBAAiBP,eAA4B;;;;;;;;AASnD,MAAaQ,mBAAmB;CAC9B,MAAMC,MAAMH,WAAWC,eAAe;AACtC,KAAI,CAACE,IACH,OAAM,IAAIC,MAAM,mDAAmD;AAErE,QAAOD;;;;;;;;;;;;AAuBT,MAAaQ,mBAAmBC,UAAgC;CAC9D,MAAM,CAACC,aAAaC,uBAAuBf,WAAWa,OAAO,CAAC,OAAO,WAAW,CAAC;CAIjF,MAAM,CAACG,eAAenB,eAAe,YAAY;EAC/C,MAAMO,MAAM,IAAIZ,aAAa;AAC7B,QAAMY,IAAIa,KAAK;GACbC,aAAa;GACbC,YAAYC,KAAKC,IAAIC,OAAOC,kBAAkB,EAAE;GAChDC,cAAc;GACd,GAAGT;GACJ,CAAC;AAEF,SAAOX;GACP;AAEFR,oBAAmB;EACjB,MAAMQ,MAAMY,aAAa;AACzB,MAAIZ,KAAK;AACP,OAAIS,MAAMJ,IAEPI,OAAMJ,IAAsCL,IAAI;AAMnDA,OAAIsB,OAAOC,YAAY;AACvBvB,OAAIsB,OAAOE,OAAO;AAGlBC,cAAWC,oBAAoB,EAC7B1B,KACD;AAEDN,mBAAgB;AACdM,QAAI2B,QAAQ,MAAM,EAAErB,UAAU,MAAM,CAAC;KACrC;;GAEJ;AAEF,QAAAsB,gBACGjC,MAAI;EAAA,IAACkC,OAAI;AAAA,UAAEjB,aAAa;;EAAAN,WACrBN,QAAG4B,gBAAM9B,eAAegC,UAAQ;GAAA,IAACC,QAAK;AAAA,WAAE/B,KAAK;;GAAA,IAAAM,WAAA;AAAA,WAAGG,MAAMH;;GAAQ,CAAA;EAA2B,CAAA"}
|
package/dist/pixi-canvas.js
CHANGED
|
@@ -10,16 +10,11 @@ var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
|
10
10
|
* A small wrapper that mounts the PIXI application's canvas element into the DOM
|
|
11
11
|
* and automatically resizes it.
|
|
12
12
|
*
|
|
13
|
-
* - Requires a surrounding `PixiApplication`
|
|
13
|
+
* - Requires a surrounding `PixiApplication` component.
|
|
14
14
|
* - Requires a `PixiStage` component as a child.
|
|
15
15
|
*
|
|
16
16
|
* Props:
|
|
17
|
-
* @param props.children - JSX content to render inside the canvas wrapper. Use
|
|
18
|
-
* `PixiStage` as the only child.
|
|
19
|
-
*
|
|
20
|
-
* **Example**
|
|
21
|
-
* {@includeCode ./examples/PixiCanvas.example.tsx}
|
|
22
|
-
*
|
|
17
|
+
* @param props.children - JSX content to render inside the canvas wrapper. Use `PixiStage` as the only child.
|
|
23
18
|
*/
|
|
24
19
|
const PixiCanvas = (props) => {
|
|
25
20
|
let canvasWrapElement;
|
package/dist/pixi-canvas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-canvas.js","names":["JSX","createRenderEffect","onCleanup","onMount","usePixiApp","PixiCanvas","props","children","Element","style","CSSProperties","className","canvasWrapElement","HTMLDivElement","pixiApp","canvas","display","undefined","Error","previousResizeTo","resizeTo","resizeObserver","ResizeObserver","queueResize","observe","disconnect","_el$","_tmpl$","_ref$","_$use","_$insert","_$effect","_p$","_v$","_v$2","e","_$style","t","_$className"],"sources":["../src/pixi-canvas.tsx"],"sourcesContent":["import type { JSX } from \"solid-js\";\nimport { createRenderEffect, onCleanup, onMount } from \"solid-js\";\nimport { usePixiApp } from \"./pixi-application\";\n\n/**\n * PixiCanvas\n *\n * A small wrapper that mounts the PIXI application's canvas element into the DOM\n * and automatically resizes it.\n *\n * - Requires a surrounding `PixiApplication`
|
|
1
|
+
{"version":3,"file":"pixi-canvas.js","names":["JSX","createRenderEffect","onCleanup","onMount","usePixiApp","PixiCanvas","props","children","Element","style","CSSProperties","className","canvasWrapElement","HTMLDivElement","pixiApp","canvas","display","undefined","Error","previousResizeTo","resizeTo","resizeObserver","ResizeObserver","queueResize","observe","disconnect","_el$","_tmpl$","_ref$","_$use","_$insert","_$effect","_p$","_v$","_v$2","e","_$style","t","_$className"],"sources":["../src/pixi-canvas.tsx"],"sourcesContent":["import type { JSX } from \"solid-js\";\nimport { createRenderEffect, onCleanup, onMount } from \"solid-js\";\nimport { usePixiApp } from \"./pixi-application\";\n\n/**\n * PixiCanvas\n *\n * A small wrapper that mounts the PIXI application's canvas element into the DOM\n * and automatically resizes it.\n *\n * - Requires a surrounding `PixiApplication` component.\n * - Requires a `PixiStage` component as a child.\n *\n * Props:\n * @param props.children - JSX content to render inside the canvas wrapper. Use `PixiStage` as the only child.\n */\n\nexport const PixiCanvas = (props: {\n children: JSX.Element;\n style?: JSX.CSSProperties | undefined;\n className?: string;\n}): JSX.Element => {\n let canvasWrapElement: HTMLDivElement | undefined;\n\n const pixiApp = usePixiApp();\n pixiApp.canvas.style.display = \"block\";\n\n createRenderEffect(() => {\n if (props.children === undefined) {\n throw new Error(\"PixiCanvas requires the `PixiStage` component to render.\");\n }\n });\n\n let previousResizeTo: typeof pixiApp.resizeTo;\n let resizeObserver: ResizeObserver | undefined;\n\n onMount(() => {\n if (!canvasWrapElement) return;\n previousResizeTo = pixiApp.resizeTo;\n pixiApp.resizeTo = canvasWrapElement;\n pixiApp.queueResize();\n resizeObserver = new ResizeObserver(() => {\n pixiApp.queueResize();\n });\n resizeObserver.observe(canvasWrapElement);\n });\n\n onCleanup(() => {\n if (!canvasWrapElement) return;\n pixiApp.resizeTo = previousResizeTo;\n resizeObserver?.disconnect();\n resizeObserver = undefined;\n });\n\n return (\n <div\n ref={canvasWrapElement}\n style={{\n ...(typeof props.style === \"object\" ? props.style : {}),\n }}\n class={props.className}\n >\n {pixiApp.canvas}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAaK,cAAcC,UAIR;CACjB,IAAIM;CAEJ,MAAME,UAAUV,YAAY;AAC5BU,SAAQC,OAAON,MAAMO,UAAU;AAE/Bf,0BAAyB;AACvB,MAAIK,MAAMC,aAAaU,OACrB,OAAM,IAAIC,MAAM,2DAA2D;GAE7E;CAEF,IAAIC;CACJ,IAAIE;AAEJlB,eAAc;AACZ,MAAI,CAACS,kBAAmB;AACxBO,qBAAmBL,QAAQM;AAC3BN,UAAQM,WAAWR;AACnBE,UAAQS,aAAa;AACrBF,mBAAiB,IAAIC,qBAAqB;AACxCR,WAAQS,aAAa;IACrB;AACFF,iBAAeG,QAAQZ,kBAAkB;GACzC;AAEFV,iBAAgB;AACd,MAAI,CAACU,kBAAmB;AACxBE,UAAQM,WAAWD;AACnBE,kBAAgBI,YAAY;AAC5BJ,mBAAiBJ;GACjB;AAEF,eAAA;EAAA,IAAAS,OAAAC,QAAA;EAAA,IAAAC,QAEShB;AAAiB,SAAAgB,UAAA,aAAAC,IAAAD,OAAAF,KAAA,GAAjBd,oBAAiBc;AAAAI,SAAAJ,YAMrBZ,QAAQC,OAAM;AAAAgB,UAAAC,QAAA;GAAA,IAAAC,MALR,EACL,GAAI,OAAO3B,MAAMG,UAAU,WAAWH,MAAMG,QAAQ,EAAE,EACvD,EAAAyB,OACM5B,MAAMK;AAASqB,OAAAG,IAAAC,MAAAV,MAAAO,KAAAD,IAAAG,EAAA;AAAAD,YAAAF,IAAAK,KAAAC,UAAAZ,MAAAM,IAAAK,IAAAH,KAAA;AAAA,UAAAF;KAAA;GAAAG,GAAAlB;GAAAoB,GAAApB;GAAA,CAAA;AAAA,SAAAS;KAAA"}
|
package/dist/pixi-components.js
CHANGED
|
@@ -11,7 +11,7 @@ const SOLID_PROP_KEYS = [
|
|
|
11
11
|
];
|
|
12
12
|
/**
|
|
13
13
|
* Apply's the props to a Pixi instance with subsriptions to maintain reactivity.
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
15
|
* @param instance The Pixi instance we want to apply props to.
|
|
16
16
|
* @param props The props object.
|
|
17
17
|
*/
|
|
@@ -46,149 +46,70 @@ var createLeafComponent = (PixiClass) => {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
|
-
* A SolidJS component that renders a PIXI.AnimatedSprite
|
|
50
|
-
*
|
|
51
|
-
* **Example**
|
|
52
|
-
* {@includeCode ./examples/AnimatedSprite.example.tsx}
|
|
53
|
-
*
|
|
54
|
-
* {@link PixiAnimatedSprite}
|
|
55
|
-
*
|
|
49
|
+
* A SolidJS component that renders a `PIXI.AnimatedSprite`.
|
|
56
50
|
*/
|
|
57
51
|
const AnimatedSprite$1 = createLeafComponent(AnimatedSprite);
|
|
58
52
|
/**
|
|
59
|
-
* A SolidJS component that renders a PIXI.BitmapText
|
|
60
|
-
*
|
|
61
|
-
* **Example**
|
|
62
|
-
* {@includeCode ./examples/BitmapText.example.tsx}
|
|
63
|
-
*
|
|
64
|
-
* {@link PixiBitmapText}
|
|
65
|
-
*
|
|
53
|
+
* A SolidJS component that renders a `PIXI.BitmapText`.
|
|
66
54
|
*/
|
|
67
55
|
const BitmapText$1 = createLeafComponent(BitmapText);
|
|
68
56
|
/**
|
|
69
|
-
* A SolidJS component that renders a PIXI.Container
|
|
70
|
-
*
|
|
71
|
-
* **Example**
|
|
72
|
-
* {@includeCode ./examples/Container.example.tsx}
|
|
73
|
-
*
|
|
57
|
+
* A SolidJS component that renders a `PIXI.Container`.
|
|
74
58
|
*/
|
|
75
59
|
const Container$1 = createContainerComponent(Container);
|
|
76
60
|
/**
|
|
77
|
-
* A SolidJS component that renders a PIXI.Graphics
|
|
61
|
+
* A SolidJS component that renders a `PIXI.Graphics`.
|
|
78
62
|
* Use a ref to access the underlying graphics instance and draw with it.
|
|
79
|
-
*
|
|
80
|
-
* **Example**
|
|
81
|
-
* {@includeCode ./examples/Graphics.example.tsx}
|
|
82
|
-
*
|
|
83
|
-
* {@link PixiGraphics}
|
|
84
63
|
*/
|
|
85
64
|
const Graphics$1 = createLeafComponent(Graphics);
|
|
86
65
|
/**
|
|
87
|
-
* A SolidJS component that renders a PIXI.HTMLText
|
|
88
|
-
*
|
|
89
|
-
* **Example**
|
|
90
|
-
* {@includeCode ./examples/HTMLText.example.tsx}
|
|
91
|
-
*
|
|
92
|
-
* {@link PixiHTMLText}
|
|
66
|
+
* A SolidJS component that renders a `PIXI.HTMLText`.
|
|
93
67
|
*/
|
|
94
68
|
const HTMLText$1 = createLeafComponent(HTMLText);
|
|
95
69
|
/**
|
|
96
|
-
* A SolidJS component that renders a PIXI.MeshPlane
|
|
97
|
-
*
|
|
98
|
-
* **Example**
|
|
99
|
-
* {@includeCode ./examples/MeshPlane.example.tsx}
|
|
100
|
-
*
|
|
101
|
-
* {@link PixiMeshPlane}
|
|
70
|
+
* A SolidJS component that renders a `PIXI.MeshPlane`.
|
|
102
71
|
*/
|
|
103
72
|
const MeshPlane$1 = createLeafComponent(MeshPlane);
|
|
104
73
|
/**
|
|
105
|
-
* A SolidJS component that renders a PIXI.MeshRope
|
|
106
|
-
*
|
|
107
|
-
* **Example**
|
|
108
|
-
* {@includeCode ./examples/MeshRope.example.tsx}
|
|
109
|
-
*
|
|
110
|
-
* {@link PixiMeshRope}
|
|
74
|
+
* A SolidJS component that renders a `PIXI.MeshRope`.
|
|
111
75
|
*/
|
|
112
76
|
const MeshRope$1 = createLeafComponent(MeshRope);
|
|
113
77
|
/**
|
|
114
|
-
* A SolidJS component that renders a PIXI.MeshSimple
|
|
115
|
-
*
|
|
116
|
-
* **Example**
|
|
117
|
-
* {@includeCode ./examples/MeshSimple.example.tsx}
|
|
118
|
-
*
|
|
119
|
-
* {@link PixiMeshSimple}
|
|
78
|
+
* A SolidJS component that renders a `PIXI.MeshSimple`.
|
|
120
79
|
*/
|
|
121
80
|
const MeshSimple$1 = createLeafComponent(MeshSimple);
|
|
122
81
|
/**
|
|
123
|
-
* A SolidJS component that renders a PIXI.NineSliceSprite
|
|
124
|
-
*
|
|
125
|
-
* **Example**
|
|
126
|
-
* {@includeCode ./examples/NineSliceSprite.example.tsx}
|
|
127
|
-
*
|
|
128
|
-
* {@link PixiNineSliceSprite}
|
|
82
|
+
* A SolidJS component that renders a `PIXI.NineSliceSprite`.
|
|
129
83
|
*/
|
|
130
84
|
const NineSliceSprite$1 = createLeafComponent(NineSliceSprite);
|
|
131
85
|
/**
|
|
132
|
-
* A SolidJS component that renders a PIXI.ParticleContainer
|
|
133
|
-
*
|
|
134
|
-
* **Example**
|
|
135
|
-
* {@includeCode ./examples/ParticleContainer.example.tsx}
|
|
86
|
+
* A SolidJS component that renders a `PIXI.ParticleContainer`.
|
|
136
87
|
*
|
|
137
|
-
*
|
|
88
|
+
* Particles should be added and removed from this component imperatively. Please see the docs for a reference example.
|
|
138
89
|
*/
|
|
139
90
|
const ParticleContainer$1 = createLeafComponent(ParticleContainer);
|
|
140
91
|
/**
|
|
141
|
-
* A SolidJS component that renders a PIXI.PerspectiveMesh
|
|
142
|
-
*
|
|
143
|
-
* **Example**
|
|
144
|
-
* {@includeCode ./examples/PerspectiveMesh.example.tsx}
|
|
145
|
-
*
|
|
146
|
-
* {@link PixiPerspectiveMesh}
|
|
92
|
+
* A SolidJS component that renders a `PIXI.PerspectiveMesh`.
|
|
147
93
|
*/
|
|
148
94
|
const PerspectiveMesh$1 = createLeafComponent(PerspectiveMesh);
|
|
149
95
|
/**
|
|
150
|
-
* A SolidJS component that renders a PIXI.RenderContainer
|
|
151
|
-
*
|
|
152
|
-
* **Example**
|
|
153
|
-
* {@includeCode ./examples/RenderContainer.example.tsx}
|
|
154
|
-
*
|
|
155
|
-
* {@link PixiRenderContainer}
|
|
96
|
+
* A SolidJS component that renders a `PIXI.RenderContainer`.
|
|
156
97
|
*/
|
|
157
98
|
const RenderContainer$1 = createContainerComponent(RenderContainer);
|
|
158
99
|
/**
|
|
159
|
-
* A SolidJS component that renders a PIXI.RenderLayer
|
|
160
|
-
*
|
|
161
|
-
* **Example**
|
|
162
|
-
* {@includeCode ./examples/RenderLayer.example.tsx}
|
|
163
|
-
*
|
|
164
|
-
* {@link PixiRenderLayer}
|
|
100
|
+
* A SolidJS component that renders a `PIXI.RenderLayer`.
|
|
165
101
|
*/
|
|
166
102
|
const RenderLayer$1 = createContainerComponent(RenderLayer);
|
|
167
103
|
/**
|
|
168
|
-
* A SolidJS component that renders a PIXI.Sprite
|
|
169
|
-
*
|
|
170
|
-
* **Example**
|
|
171
|
-
* {@includeCode ./examples/Sprite.example.tsx}
|
|
172
|
-
*
|
|
173
|
-
* {@link PixiSprite}
|
|
104
|
+
* A SolidJS component that renders a `PIXI.Sprite`.
|
|
174
105
|
*/
|
|
175
106
|
const Sprite$1 = createLeafComponent(Sprite);
|
|
176
107
|
/**
|
|
177
|
-
* A SolidJS component that renders a PIXI.Text
|
|
178
|
-
*
|
|
179
|
-
* **Example**
|
|
180
|
-
* {@includeCode ./examples/Text.example.tsx}
|
|
181
|
-
*
|
|
182
|
-
* {@link PixiText}
|
|
108
|
+
* A SolidJS component that renders a `PIXI.Text`.
|
|
183
109
|
*/
|
|
184
110
|
const Text$1 = createLeafComponent(Text);
|
|
185
111
|
/**
|
|
186
|
-
* A SolidJS component that renders a PIXI.TilingSprite
|
|
187
|
-
*
|
|
188
|
-
* **Example**
|
|
189
|
-
* {@includeCode ./examples/TilingSprite.example.tsx}
|
|
190
|
-
*
|
|
191
|
-
* {@link PixiTilingSprite}
|
|
112
|
+
* A SolidJS component that renders a `PIXI.TilingSprite`.
|
|
192
113
|
*/
|
|
193
114
|
const TilingSprite$1 = createLeafComponent(TilingSprite);
|
|
194
115
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-components.js","names":["Pixi","AnimatedSprite","PixiAnimatedSprite","BitmapText","PixiBitmapText","Container","PixiContainer","Graphics","PixiGraphics","HTMLText","PixiHTMLText","MeshPlane","PixiMeshPlane","MeshRope","PixiMeshRope","MeshSimple","PixiMeshSimple","NineSliceSprite","PixiNineSliceSprite","ParticleContainer","PixiParticleContainer","PerspectiveMesh","PixiPerspectiveMesh","RenderContainer","PixiRenderContainer","RenderLayer","PixiRenderLayer","Sprite","PixiSprite","Text","PixiText","TilingSprite","PixiTilingSprite","JSX","Ref","createRenderEffect","splitProps","PixiEventHandlerMap","PIXI_EVENT_HANDLER_NAMES","insert","setProp","ContainerProps","ref","Component","as","children","Element","LeafProps","Omit","SOLID_PROP_KEYS","const","applyProps","InstanceType","instance","props","OptionsType","key","arg","Error","createContainerComponent","PixiClass","runtimeProps","initialisationProps","createLeafComponent","AnimatedSpriteOptions","TextOptions","ContainerOptions","GraphicsOptions","HTMLTextOptions","MeshPlaneOptions","MeshRopeOptions","SimpleMeshOptions","NineSliceSpriteOptions","ParticleContainerOptions","PerspectivePlaneOptions","RenderContainerOptions","RenderLayerOptions","SpriteOptions","CanvasTextOptions","TilingSpriteOptions"],"sources":["../src/pixi-components.tsx"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport {\n AnimatedSprite as PixiAnimatedSprite,\n BitmapText as PixiBitmapText,\n Container as PixiContainer,\n Graphics as PixiGraphics,\n HTMLText as PixiHTMLText,\n MeshPlane as PixiMeshPlane,\n MeshRope as PixiMeshRope,\n MeshSimple as PixiMeshSimple,\n NineSliceSprite as PixiNineSliceSprite,\n ParticleContainer as PixiParticleContainer,\n PerspectiveMesh as PixiPerspectiveMesh,\n RenderContainer as PixiRenderContainer,\n RenderLayer as PixiRenderLayer,\n Sprite as PixiSprite,\n Text as PixiText,\n TilingSprite as PixiTilingSprite,\n} from \"pixi.js\";\nimport type { JSX, Ref } from \"solid-js\";\nimport { createRenderEffect, splitProps } from \"solid-js\";\nimport type { PixiEventHandlerMap } from \"./pixi-events\";\n\nimport { PIXI_EVENT_HANDLER_NAMES } from \"./pixi-events\";\nimport { insert, setProp } from \"./renderer\";\n\n/**\n * Prop definition for components that CAN have children\n */\nexport type ContainerProps<Component> = PixiEventHandlerMap & {\n ref?: Ref<Component>;\n as?: Component;\n children?: JSX.Element;\n};\n\n/**\n * Prop definition for components that CANNOT have children\n */\nexport type LeafProps<Component> = Omit<ContainerProps<Component>, \"children\">;\n\n// Keys that are specific to Solid components and not Pixi props\nexport const SOLID_PROP_KEYS = [\"ref\", \"as\", \"children\"] as const;\n\n/**\n * Apply's the props to a Pixi instance with subsriptions to maintain reactivity.\n * \n * @param instance The Pixi instance we want to apply props to.\n * @param props The props object.\n */\nexport const applyProps = <\n InstanceType extends PixiContainer,\n OptionsType extends ContainerProps<InstanceType>,\n>(\n instance: InstanceType,\n props: OptionsType,\n) => {\n for (const key in props) {\n if (key === \"as\") continue;\n\n if (key === \"ref\") {\n createRenderEffect(() => {\n // Solid converts the ref prop to a callback function\n (props[key] as unknown as (arg: any) => void)(instance);\n });\n } else if (key === \"children\") {\n if (!(\"addChild\" in instance)) {\n throw new Error(`Cannot set children on non-container instance.`);\n }\n createRenderEffect(() => {\n insert(instance, () => props.children);\n });\n } else {\n createRenderEffect(() => {\n setProp(instance, key, props[key as keyof typeof props]);\n });\n }\n }\n};\n\nconst createContainerComponent = <InstanceType extends PixiContainer, OptionsType extends object>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (props: Omit<OptionsType, \"children\"> & ContainerProps<InstanceType>): JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, [\n ...SOLID_PROP_KEYS,\n ...PIXI_EVENT_HANDLER_NAMES,\n ]);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n applyProps(instance, initialisationProps);\n applyProps(instance, runtimeProps);\n\n return instance as unknown as JSX.Element;\n };\n};\n\nconst createLeafComponent = <InstanceType extends PixiContainer, OptionsType extends object>(\n PixiClass: new (props: OptionsType) => InstanceType,\n) => {\n return (props: Omit<OptionsType, \"children\"> & LeafProps<InstanceType>): JSX.Element => {\n return createContainerComponent<PixiContainer, OptionsType>(PixiClass)(props as any);\n };\n};\n\n/**\n * A SolidJS component that renders a PIXI.AnimatedSprite.\n *\n * **Example**\n * {@includeCode ./examples/AnimatedSprite.example.tsx}\n * \n * {@link PixiAnimatedSprite}\n *\n */\nexport const AnimatedSprite = createLeafComponent<PixiAnimatedSprite, Pixi.AnimatedSpriteOptions>(\n PixiAnimatedSprite,\n);\n/**\n * A SolidJS component that renders a PIXI.BitmapText.\n *\n * **Example**\n * {@includeCode ./examples/BitmapText.example.tsx}\n * \n * {@link PixiBitmapText}\n *\n */\nexport const BitmapText = createLeafComponent<PixiBitmapText, Pixi.TextOptions>(PixiBitmapText);\n/**\n * A SolidJS component that renders a PIXI.Container.\n *\n * **Example**\n * {@includeCode ./examples/Container.example.tsx}\n *\n */\nexport const Container = createContainerComponent<PixiContainer, Pixi.ContainerOptions>(\n PixiContainer,\n);\n/**\n * A SolidJS component that renders a PIXI.Graphics.\n * Use a ref to access the underlying graphics instance and draw with it.\n *\n * **Example**\n * {@includeCode ./examples/Graphics.example.tsx}\n *\n * {@link PixiGraphics}\n */\nexport const Graphics = createLeafComponent<PixiGraphics, Pixi.GraphicsOptions>(PixiGraphics);\n/**\n * A SolidJS component that renders a PIXI.HTMLText.\n *\n * **Example**\n * {@includeCode ./examples/HTMLText.example.tsx}\n *\n * {@link PixiHTMLText}\n */\nexport const HTMLText = createLeafComponent<PixiHTMLText, Pixi.HTMLTextOptions>(PixiHTMLText);\n\n/**\n * A SolidJS component that renders a PIXI.MeshPlane.\n *\n * **Example**\n * {@includeCode ./examples/MeshPlane.example.tsx}\n *\n * {@link PixiMeshPlane}\n */\nexport const MeshPlane = createLeafComponent<PixiMeshPlane, Pixi.MeshPlaneOptions>(PixiMeshPlane);\n\n/**\n * A SolidJS component that renders a PIXI.MeshRope.\n *\n * **Example**\n * {@includeCode ./examples/MeshRope.example.tsx}\n *\n * {@link PixiMeshRope}\n */\nexport const MeshRope = createLeafComponent<PixiMeshRope, Pixi.MeshRopeOptions>(PixiMeshRope);\n\n/**\n * A SolidJS component that renders a PIXI.MeshSimple.\n *\n * **Example**\n * {@includeCode ./examples/MeshSimple.example.tsx}\n *\n * {@link PixiMeshSimple}\n */\nexport const MeshSimple = createLeafComponent<PixiMeshSimple, Pixi.SimpleMeshOptions>(\n PixiMeshSimple,\n);\n\n/**\n * A SolidJS component that renders a PIXI.NineSliceSprite.\n *\n * **Example**\n * {@includeCode ./examples/NineSliceSprite.example.tsx}\n *\n * {@link PixiNineSliceSprite}\n */\nexport const NineSliceSprite = createLeafComponent<\n PixiNineSliceSprite,\n Pixi.NineSliceSpriteOptions\n>(PixiNineSliceSprite);\n\n/**\n * A SolidJS component that renders a PIXI.ParticleContainer.\n *\n * **Example**\n * {@includeCode ./examples/ParticleContainer.example.tsx}\n *\n * {@link PixiParticleContainer}\n */\nexport const ParticleContainer = createLeafComponent<\n PixiParticleContainer,\n Pixi.ParticleContainerOptions\n>(PixiParticleContainer);\n\n/**\n * A SolidJS component that renders a PIXI.PerspectiveMesh.\n *\n * **Example**\n * {@includeCode ./examples/PerspectiveMesh.example.tsx}\n *\n * {@link PixiPerspectiveMesh}\n */\nexport const PerspectiveMesh = createLeafComponent<\n PixiPerspectiveMesh,\n Pixi.PerspectivePlaneOptions\n>(PixiPerspectiveMesh);\n\n/**\n * A SolidJS component that renders a PIXI.RenderContainer.\n *\n * **Example**\n * {@includeCode ./examples/RenderContainer.example.tsx}\n *\n * {@link PixiRenderContainer}\n */\nexport const RenderContainer = createContainerComponent<\n PixiRenderContainer,\n Pixi.RenderContainerOptions\n>(PixiRenderContainer);\n\n/**\n * A SolidJS component that renders a PIXI.RenderLayer.\n *\n * **Example**\n * {@includeCode ./examples/RenderLayer.example.tsx}\n *\n * {@link PixiRenderLayer}\n */\nexport const RenderLayer = createContainerComponent<PixiRenderLayer, Pixi.RenderLayerOptions>(\n PixiRenderLayer,\n);\n\n/**\n * A SolidJS component that renders a PIXI.Sprite.\n *\n * **Example**\n * {@includeCode ./examples/Sprite.example.tsx}\n *\n * {@link PixiSprite}\n */\nexport const Sprite = createLeafComponent<PixiSprite, Pixi.SpriteOptions>(PixiSprite);\n/**\n * A SolidJS component that renders a PIXI.Text.\n *\n * **Example**\n * {@includeCode ./examples/Text.example.tsx}\n *\n * {@link PixiText}\n */\nexport const Text = createLeafComponent<PixiText, Pixi.CanvasTextOptions>(PixiText);\n\n/**\n * A SolidJS component that renders a PIXI.TilingSprite.\n *\n * **Example**\n * {@includeCode ./examples/TilingSprite.example.tsx}\n *\n * {@link PixiTilingSprite}\n */\nexport const TilingSprite = createLeafComponent<PixiTilingSprite, Pixi.TilingSpriteOptions>(\n PixiTilingSprite,\n);\n\n// export const MeshGeometry = createLeafComponent<PixiMeshGeometry, Pixi.MeshGeometryOptions>(PixiMeshGeometry);\n// export const NineSliceGeometry = createLeafComponent<PixiNineSliceGeometry, Pixi.NineSliceGeometryOptions>(\n// PixiNineSliceGeometry\n// );\n\n// export const Particle = createLeafComponent<PixiParticle, Pixi.ParticleOptions>(PixiParticle);\n// export const PerspectivePlaneGeometry = createLeafComponent<\n// PixiPerspectivePlaneGeometry,\n// Pixi.PerspectivePlaneGeometryOptions\n// >(PixiPerspectivePlaneGeometry);\n// export const PlaneGeometry = createLeafComponent<PixiPlaneGeometry, Pixi.PlaneGeometryOptions>(PixiPlaneGeometry);\n// export const RopeGeometry = createLeafComponent<PixiRopeGeometry, Pixi.RopeGeometryOptions>(PixiRopeGeometry);\n\n// TODO: Don't need a component for the Culler. It needs to interact with the stage directly.\n// export const Culler = createLeafComponent<PixiCuller, Pixi.Culler>(PixiCuller);\n"],"mappings":";;;;;;AAyCA,MAAaiD,kBAAkB;CAAC;CAAO;CAAM;CAAW;;;;;;;AAQxD,MAAaE,cAIXE,UACAC,UACG;AACH,MAAK,MAAME,OAAOF,OAAO;AACvB,MAAIE,QAAQ,KAAM;AAElB,MAAIA,QAAQ,MACVrB,0BAAyB;AAEtBmB,SAAME,KAAuCH,SAAS;IACvD;WACOG,QAAQ,YAAY;AAC7B,OAAI,EAAE,cAAcH,UAClB,OAAM,IAAIK,MAAM,iDAAiD;AAEnEvB,4BAAyB;AACvBI,WAAOc,gBAAgBC,MAAMT,SAAS;KACtC;QAEFV,0BAAyB;AACvBK,WAAQa,UAAUG,KAAKF,MAAME,KAA2B;IACxD;;;AAKR,IAAMG,4BACJC,cACG;AACH,SAAQN,UAAqF;EAC3F,MAAM,CAACO,cAAcC,uBAAuB1B,WAAWkB,OAAO,CAC5D,GAAGL,iBACH,GAAGX,yBACJ,CAAC;EAEF,MAAMe,WAAWC,MAAMV,MAAM,IAAIgB,UAAUE,oBAA2B;AAEtEX,aAAWE,UAAUS,oBAAoB;AACzCX,aAAWE,UAAUQ,aAAa;AAElC,SAAOR;;;AAIX,IAAMU,uBACJH,cACG;AACH,SAAQN,UAAgF;AACtF,SAAOK,yBAAqDC,UAAU,CAACN,MAAa;;;;;;;;;;;;AAaxF,MAAarD,mBAAiB8D,oBAC5B7D,eACD;;;;;;;;;;AAUD,MAAaC,eAAa4D,oBAAsD3D,WAAe;;;;;;;;AAQ/F,MAAaC,cAAYsD,yBACvBrD,UACD;;;;;;;;;;AAUD,MAAaC,aAAWwD,oBAAwDvD,SAAa;;;;;;;;;AAS7F,MAAaC,aAAWsD,oBAAwDrD,SAAa;;;;;;;;;AAU7F,MAAaC,cAAYoD,oBAA0DnD,UAAc;;;;;;;;;AAUjG,MAAaC,aAAWkD,oBAAwDjD,SAAa;;;;;;;;;AAU7F,MAAaC,eAAagD,oBACxB/C,WACD;;;;;;;;;AAUD,MAAaC,oBAAkB8C,oBAG7B7C,gBAAoB;;;;;;;;;AAUtB,MAAaC,sBAAoB4C,oBAG/B3C,kBAAsB;;;;;;;;;AAUxB,MAAaC,oBAAkB0C,oBAG7BzC,gBAAoB;;;;;;;;;AAUtB,MAAaC,oBAAkBoC,yBAG7BnC,gBAAoB;;;;;;;;;AAUtB,MAAaC,gBAAckC,yBACzBjC,YACD;;;;;;;;;AAUD,MAAaC,WAASoC,oBAAoDnC,OAAW;;;;;;;;;AASrF,MAAaC,SAAOkC,oBAAsDjC,KAAS;;;;;;;;;AAUnF,MAAaC,iBAAegC,oBAC1B/B,aACD"}
|
|
1
|
+
{"version":3,"file":"pixi-components.js","names":["Pixi","AnimatedSprite","PixiAnimatedSprite","BitmapText","PixiBitmapText","Container","PixiContainer","Graphics","PixiGraphics","HTMLText","PixiHTMLText","MeshPlane","PixiMeshPlane","MeshRope","PixiMeshRope","MeshSimple","PixiMeshSimple","NineSliceSprite","PixiNineSliceSprite","ParticleContainer","PixiParticleContainer","PerspectiveMesh","PixiPerspectiveMesh","RenderContainer","PixiRenderContainer","RenderLayer","PixiRenderLayer","Sprite","PixiSprite","Text","PixiText","TilingSprite","PixiTilingSprite","JSX","Ref","createRenderEffect","splitProps","PixiEventHandlerMap","PIXI_EVENT_HANDLER_NAMES","insert","setProp","ContainerProps","ref","Component","as","children","Element","LeafProps","Omit","SOLID_PROP_KEYS","const","applyProps","InstanceType","instance","props","OptionsType","key","arg","Error","createContainerComponent","PixiClass","runtimeProps","initialisationProps","createLeafComponent","AnimatedSpriteOptions","ConstructorParameters","ContainerOptions","GraphicsOptions","HTMLTextOptions","MeshPlaneOptions","MeshRopeOptions","SimpleMeshOptions","NineSliceSpriteOptions","ParticleContainerOptions","PerspectivePlaneOptions","RenderContainerOptions","RenderLayerOptions","SpriteOptions","CanvasTextOptions","TilingSpriteOptions"],"sources":["../src/pixi-components.tsx"],"sourcesContent":["import type * as Pixi from \"pixi.js\";\nimport {\n AnimatedSprite as PixiAnimatedSprite,\n BitmapText as PixiBitmapText,\n Container as PixiContainer,\n Graphics as PixiGraphics,\n HTMLText as PixiHTMLText,\n MeshPlane as PixiMeshPlane,\n MeshRope as PixiMeshRope,\n MeshSimple as PixiMeshSimple,\n NineSliceSprite as PixiNineSliceSprite,\n ParticleContainer as PixiParticleContainer,\n PerspectiveMesh as PixiPerspectiveMesh,\n RenderContainer as PixiRenderContainer,\n RenderLayer as PixiRenderLayer,\n Sprite as PixiSprite,\n Text as PixiText,\n TilingSprite as PixiTilingSprite,\n} from \"pixi.js\";\nimport type { JSX, Ref } from \"solid-js\";\nimport { createRenderEffect, splitProps } from \"solid-js\";\nimport type { PixiEventHandlerMap } from \"./pixi-events\";\n\nimport { PIXI_EVENT_HANDLER_NAMES } from \"./pixi-events\";\nimport { insert, setProp } from \"./renderer\";\n\n/**\n * Prop definition for components that CAN have children\n */\nexport type ContainerProps<Component> = PixiEventHandlerMap & {\n ref?: Ref<Component>;\n as?: Component;\n children?: JSX.Element;\n};\n\n/**\n * Prop definition for components that CANNOT have children\n */\nexport type LeafProps<Component> = Omit<ContainerProps<Component>, \"children\">;\n\n// Keys that are specific to Solid components and not Pixi props\nexport const SOLID_PROP_KEYS = [\"ref\", \"as\", \"children\"] as const;\n\n/**\n * Apply's the props to a Pixi instance with subsriptions to maintain reactivity.\n *\n * @param instance The Pixi instance we want to apply props to.\n * @param props The props object.\n */\nexport const applyProps = <InstanceType extends PixiContainer, OptionsType extends ContainerProps<InstanceType>>(\n instance: InstanceType,\n props: OptionsType\n) => {\n for (const key in props) {\n if (key === \"as\") continue;\n\n if (key === \"ref\") {\n createRenderEffect(() => {\n // Solid converts the ref prop to a callback function\n (props[key] as unknown as (arg: any) => void)(instance);\n });\n } else if (key === \"children\") {\n if (!(\"addChild\" in instance)) {\n throw new Error(`Cannot set children on non-container instance.`);\n }\n createRenderEffect(() => {\n insert(instance, () => props.children);\n });\n } else {\n createRenderEffect(() => {\n setProp(instance, key, props[key as keyof typeof props]);\n });\n }\n }\n};\n\nconst createContainerComponent = <InstanceType extends PixiContainer, OptionsType extends object>(\n PixiClass: new (props: OptionsType) => InstanceType\n) => {\n return (props: Omit<OptionsType, \"children\"> & ContainerProps<InstanceType>): JSX.Element => {\n const [runtimeProps, initialisationProps] = splitProps(props, [...SOLID_PROP_KEYS, ...PIXI_EVENT_HANDLER_NAMES]);\n\n const instance = props.as || new PixiClass(initialisationProps as any);\n\n applyProps(instance, initialisationProps);\n applyProps(instance, runtimeProps);\n\n return instance as unknown as JSX.Element;\n };\n};\n\nconst createLeafComponent = <InstanceType extends PixiContainer, OptionsType extends object>(\n PixiClass: new (props: OptionsType) => InstanceType\n) => {\n return (props: Omit<OptionsType, \"children\"> & LeafProps<InstanceType>): JSX.Element => {\n return createContainerComponent<PixiContainer, OptionsType>(PixiClass)(props as any);\n };\n};\n\n/**\n * A SolidJS component that renders a `PIXI.AnimatedSprite`.\n */\nexport const AnimatedSprite = createLeafComponent<PixiAnimatedSprite, Pixi.AnimatedSpriteOptions>(PixiAnimatedSprite);\n/**\n * A SolidJS component that renders a `PIXI.BitmapText`.\n */\nexport const BitmapText = createLeafComponent<PixiBitmapText, ConstructorParameters<typeof PixiBitmapText>>(\n PixiBitmapText\n);\n/**\n * A SolidJS component that renders a `PIXI.Container`.\n */\nexport const Container = createContainerComponent<PixiContainer, Pixi.ContainerOptions>(PixiContainer);\n/**\n * A SolidJS component that renders a `PIXI.Graphics`.\n * Use a ref to access the underlying graphics instance and draw with it.\n */\nexport const Graphics = createLeafComponent<PixiGraphics, Pixi.GraphicsOptions>(PixiGraphics);\n/**\n * A SolidJS component that renders a `PIXI.HTMLText`.\n */\nexport const HTMLText = createLeafComponent<PixiHTMLText, Pixi.HTMLTextOptions>(PixiHTMLText);\n\n/**\n * A SolidJS component that renders a `PIXI.MeshPlane`.\n */\nexport const MeshPlane = createLeafComponent<PixiMeshPlane, Pixi.MeshPlaneOptions>(PixiMeshPlane);\n\n/**\n * A SolidJS component that renders a `PIXI.MeshRope`.\n */\nexport const MeshRope = createLeafComponent<PixiMeshRope, Pixi.MeshRopeOptions>(PixiMeshRope);\n\n/**\n * A SolidJS component that renders a `PIXI.MeshSimple`.\n */\nexport const MeshSimple = createLeafComponent<PixiMeshSimple, Pixi.SimpleMeshOptions>(PixiMeshSimple);\n\n/**\n * A SolidJS component that renders a `PIXI.NineSliceSprite`.\n */\nexport const NineSliceSprite = createLeafComponent<PixiNineSliceSprite, Pixi.NineSliceSpriteOptions>(\n PixiNineSliceSprite\n);\n\n/**\n * A SolidJS component that renders a `PIXI.ParticleContainer`.\n *\n * Particles should be added and removed from this component imperatively. Please see the docs for a reference example.\n */\nexport const ParticleContainer = createLeafComponent<PixiParticleContainer, Pixi.ParticleContainerOptions>(\n PixiParticleContainer\n);\n\n/**\n * A SolidJS component that renders a `PIXI.PerspectiveMesh`.\n */\nexport const PerspectiveMesh = createLeafComponent<PixiPerspectiveMesh, Pixi.PerspectivePlaneOptions>(\n PixiPerspectiveMesh\n);\n\n/**\n * A SolidJS component that renders a `PIXI.RenderContainer`.\n */\nexport const RenderContainer = createContainerComponent<PixiRenderContainer, Pixi.RenderContainerOptions>(\n PixiRenderContainer\n);\n\n/**\n * A SolidJS component that renders a `PIXI.RenderLayer`.\n */\nexport const RenderLayer = createContainerComponent<PixiRenderLayer, Pixi.RenderLayerOptions>(PixiRenderLayer);\n\n/**\n * A SolidJS component that renders a `PIXI.Sprite`.\n */\nexport const Sprite = createLeafComponent<PixiSprite, Pixi.SpriteOptions>(PixiSprite);\n/**\n * A SolidJS component that renders a `PIXI.Text`.\n */\nexport const Text = createLeafComponent<PixiText, Pixi.CanvasTextOptions>(PixiText);\n\n/**\n * A SolidJS component that renders a `PIXI.TilingSprite`.\n */\nexport const TilingSprite = createLeafComponent<PixiTilingSprite, Pixi.TilingSpriteOptions>(PixiTilingSprite);\n\n// export const MeshGeometry = createLeafComponent<PixiMeshGeometry, Pixi.MeshGeometryOptions>(PixiMeshGeometry);\n// export const NineSliceGeometry = createLeafComponent<PixiNineSliceGeometry, Pixi.NineSliceGeometryOptions>(\n// PixiNineSliceGeometry\n// );\n\n// export const Particle = createLeafComponent<PixiParticle, Pixi.ParticleOptions>(PixiParticle);\n// export const PerspectivePlaneGeometry = createLeafComponent<\n// PixiPerspectivePlaneGeometry,\n// Pixi.PerspectivePlaneGeometryOptions\n// >(PixiPerspectivePlaneGeometry);\n// export const PlaneGeometry = createLeafComponent<PixiPlaneGeometry, Pixi.PlaneGeometryOptions>(PixiPlaneGeometry);\n// export const RopeGeometry = createLeafComponent<PixiRopeGeometry, Pixi.RopeGeometryOptions>(PixiRopeGeometry);\n\n// TODO: Don't need a component for the Culler. It needs to interact with the stage directly.\n// export const Culler = createLeafComponent<PixiCuller, Pixi.Culler>(PixiCuller);\n"],"mappings":";;;;;;AAyCA,MAAaiD,kBAAkB;CAAC;CAAO;CAAM;CAAW;;;;;;;AAQxD,MAAaE,cACXE,UACAC,UACG;AACH,MAAK,MAAME,OAAOF,OAAO;AACvB,MAAIE,QAAQ,KAAM;AAElB,MAAIA,QAAQ,MACVrB,0BAAyB;AAEtBmB,SAAME,KAAuCH,SAAS;IACvD;WACOG,QAAQ,YAAY;AAC7B,OAAI,EAAE,cAAcH,UAClB,OAAM,IAAIK,MAAM,iDAAiD;AAEnEvB,4BAAyB;AACvBI,WAAOc,gBAAgBC,MAAMT,SAAS;KACtC;QAEFV,0BAAyB;AACvBK,WAAQa,UAAUG,KAAKF,MAAME,KAA2B;IACxD;;;AAKR,IAAMG,4BACJC,cACG;AACH,SAAQN,UAAqF;EAC3F,MAAM,CAACO,cAAcC,uBAAuB1B,WAAWkB,OAAO,CAAC,GAAGL,iBAAiB,GAAGX,yBAAyB,CAAC;EAEhH,MAAMe,WAAWC,MAAMV,MAAM,IAAIgB,UAAUE,oBAA2B;AAEtEX,aAAWE,UAAUS,oBAAoB;AACzCX,aAAWE,UAAUQ,aAAa;AAElC,SAAOR;;;AAIX,IAAMU,uBACJH,cACG;AACH,SAAQN,UAAgF;AACtF,SAAOK,yBAAqDC,UAAU,CAACN,MAAa;;;;;;AAOxF,MAAarD,mBAAiB8D,oBAAoE7D,eAAmB;;;;AAIrH,MAAaC,eAAa4D,oBACxB3D,WACD;;;;AAID,MAAaC,cAAYsD,yBAA+DrD,UAAc;;;;;AAKtG,MAAaC,aAAWwD,oBAAwDvD,SAAa;;;;AAI7F,MAAaC,aAAWsD,oBAAwDrD,SAAa;;;;AAK7F,MAAaC,cAAYoD,oBAA0DnD,UAAc;;;;AAKjG,MAAaC,aAAWkD,oBAAwDjD,SAAa;;;;AAK7F,MAAaC,eAAagD,oBAA4D/C,WAAe;;;;AAKrG,MAAaC,oBAAkB8C,oBAC7B7C,gBACD;;;;;;AAOD,MAAaC,sBAAoB4C,oBAC/B3C,kBACD;;;;AAKD,MAAaC,oBAAkB0C,oBAC7BzC,gBACD;;;;AAKD,MAAaC,oBAAkBoC,yBAC7BnC,gBACD;;;;AAKD,MAAaC,gBAAckC,yBAAmEjC,YAAgB;;;;AAK9G,MAAaC,WAASoC,oBAAoDnC,OAAW;;;;AAIrF,MAAaC,SAAOkC,oBAAsDjC,KAAS;;;;AAKnF,MAAaC,iBAAegC,oBAAgE/B,aAAiB"}
|
package/dist/pixi-events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-events.js","names":["PIXI_EVENT_NAMES: (keyof AllFederatedEventMap)[]","PIXI_EVENT_HANDLER_NAME_SET: Readonly<Set<(typeof PIXI_EVENT_HANDLER_NAMES)[number]>>","allEventsAreHandled: AllEventsAreHandled"],"sources":["../src/pixi-events.ts"],"sourcesContent":["import type { AllFederatedEventMap } from \"pixi.js\";\n\nexport const PIXI_EVENT_NAMES: (keyof AllFederatedEventMap)[] = [\n \"click\",\n \"mousedown\",\n \"mouseenter\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"mouseupoutside\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointertap\",\n \"pointerup\",\n \"pointerupoutside\",\n \"rightclick\",\n \"rightdown\",\n \"rightup\",\n \"rightupoutside\",\n \"tap\",\n \"touchcancel\",\n \"touchend\",\n \"touchendoutside\",\n \"touchmove\",\n \"touchstart\",\n \"wheel\",\n \"globalmousemove\",\n \"globalpointermove\",\n \"globaltouchmove\",\n] as const;\n\nexport const PIXI_EVENT_HANDLER_NAMES = PIXI_EVENT_NAMES.map((eventName) => `on${eventName}` as const);\n\nexport type PixiEventHandlerMap = {\n [K in (typeof PIXI_EVENT_NAMES)[number] as `on${K}`]?: (event: AllFederatedEventMap[K]) => void;\n};\n\nexport const PIXI_EVENT_HANDLER_NAME_SET: Readonly<Set<(typeof PIXI_EVENT_HANDLER_NAMES)[number]>>
|
|
1
|
+
{"version":3,"file":"pixi-events.js","names":["PIXI_EVENT_NAMES: (keyof AllFederatedEventMap)[]","PIXI_EVENT_HANDLER_NAME_SET: Readonly<Set<(typeof PIXI_EVENT_HANDLER_NAMES)[number]>>","allEventsAreHandled: AllEventsAreHandled"],"sources":["../src/pixi-events.ts"],"sourcesContent":["import type { AllFederatedEventMap } from \"pixi.js\";\n\nexport const PIXI_EVENT_NAMES: (keyof AllFederatedEventMap)[] = [\n \"click\",\n \"mousedown\",\n \"mouseenter\",\n \"mouseleave\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"mouseupoutside\",\n \"pointercancel\",\n \"pointerdown\",\n \"pointerenter\",\n \"pointerleave\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointertap\",\n \"pointerup\",\n \"pointerupoutside\",\n \"rightclick\",\n \"rightdown\",\n \"rightup\",\n \"rightupoutside\",\n \"tap\",\n \"touchcancel\",\n \"touchend\",\n \"touchendoutside\",\n \"touchmove\",\n \"touchstart\",\n \"wheel\",\n \"globalmousemove\",\n \"globalpointermove\",\n \"globaltouchmove\",\n] as const;\n\nexport const PIXI_EVENT_HANDLER_NAMES = PIXI_EVENT_NAMES.map(\n (eventName) => `on${eventName}` as const,\n);\n\nexport type PixiEventHandlerMap = {\n [K in (typeof PIXI_EVENT_NAMES)[number] as `on${K}`]?: (event: AllFederatedEventMap[K]) => void;\n};\n\nexport const PIXI_EVENT_HANDLER_NAME_SET: Readonly<Set<(typeof PIXI_EVENT_HANDLER_NAMES)[number]>> =\n new Set(PIXI_EVENT_HANDLER_NAMES);\n\n/**\n * This is a type-safe check that ensures `PIXI_EVENT_NAMES` includes every key from Pixi's `AllFederatedEventMap` type.\n * It will cause a build error if any event names are missing.\n */\ntype MissingKeys = Exclude<keyof AllFederatedEventMap, (typeof PIXI_EVENT_NAMES)[number]>;\ntype AllEventsAreHandled = MissingKeys extends never\n ? true\n : `Error: Missing event keys: ${MissingKeys}`;\nconst allEventsAreHandled: AllEventsAreHandled = true;\nvoid allEventsAreHandled;\n"],"mappings":";AAEA,MAAaA,mBAAmD;CAC9D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,2BAA2B,iBAAiB,KACtD,cAAc,KAAK,YACrB;AAMD,MAAaC,8BACX,IAAI,IAAI,yBAAyB"}
|
package/dist/pixi-stage.js
CHANGED
|
@@ -16,9 +16,6 @@ import { memo } from "solid-js/web";
|
|
|
16
16
|
* - Any other container options supported by Pixi may be passed.
|
|
17
17
|
*
|
|
18
18
|
* Children passed to `PixiStage` are inserted into the application stage.
|
|
19
|
-
*
|
|
20
|
-
* **Example**
|
|
21
|
-
* {@includeCode ./examples/PixiStage.example.tsx}
|
|
22
19
|
*/
|
|
23
20
|
const PixiStage = (props) => {
|
|
24
21
|
const pixiApp = usePixiApp();
|
package/dist/pixi-stage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-stage.js","names":["Container","ContainerOptions","JSX","Ref","usePixiApp","applyProps","PixiEventHandlerMap","PixiStageProps","Omit","ref","children","Element","PixiStage","props","pixiApp","stage","_$memo"],"sources":["../src/pixi-stage.tsx"],"sourcesContent":["import type { Container, ContainerOptions } from \"pixi.js\";\nimport type { JSX, Ref } from \"solid-js\";\nimport { usePixiApp } from \"./pixi-application\";\nimport { applyProps } from \"./pixi-components\";\nimport type { PixiEventHandlerMap } from \"./pixi-events\";\n\nexport type PixiStageProps = PixiEventHandlerMap &\n Omit<ContainerOptions, \"children\"> & {\n ref?: Ref<Container>;\n children?: JSX.Element;\n };\n\n/**\n * PixiStage\n *\n * The root container for rendering Pixi display objects. This component\n * uses the application stage (`pixiApp.stage`) as the mount point and\n * applies props and event handlers to it.\n *\n * Props:\n * - `ref` (optional): receives the stage container reference.\n * - Event handler props (e.g. `onpointerdown`) are forwarded to the stage.\n * - Any other container options supported by Pixi may be passed.\n *\n * Children passed to `PixiStage` are inserted into the application stage.\n
|
|
1
|
+
{"version":3,"file":"pixi-stage.js","names":["Container","ContainerOptions","JSX","Ref","usePixiApp","applyProps","PixiEventHandlerMap","PixiStageProps","Omit","ref","children","Element","PixiStage","props","pixiApp","stage","_$memo"],"sources":["../src/pixi-stage.tsx"],"sourcesContent":["import type { Container, ContainerOptions } from \"pixi.js\";\nimport type { JSX, Ref } from \"solid-js\";\nimport { usePixiApp } from \"./pixi-application\";\nimport { applyProps } from \"./pixi-components\";\nimport type { PixiEventHandlerMap } from \"./pixi-events\";\n\nexport type PixiStageProps = PixiEventHandlerMap &\n Omit<ContainerOptions, \"children\"> & {\n ref?: Ref<Container>;\n children?: JSX.Element;\n };\n\n/**\n * PixiStage\n *\n * The root container for rendering Pixi display objects. This component\n * uses the application stage (`pixiApp.stage`) as the mount point and\n * applies props and event handlers to it.\n *\n * Props:\n * - `ref` (optional): receives the stage container reference.\n * - Event handler props (e.g. `onpointerdown`) are forwarded to the stage.\n * - Any other container options supported by Pixi may be passed.\n *\n * Children passed to `PixiStage` are inserted into the application stage.\n */\nexport const PixiStage = (props: PixiStageProps): JSX.Element => {\n const pixiApp = usePixiApp();\n\n applyProps(pixiApp.stage, props);\n\n return <>{pixiApp.stage}</>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0BA,MAAaY,aAAaC,UAAuC;CAC/D,MAAMC,UAAUV,YAAY;AAE5BC,YAAWS,QAAQC,OAAOF,MAAM;AAEhC,QAAAG,WAAUF,QAAQC,MAAK"}
|
|
@@ -7,18 +7,6 @@ import type { JSX, Ref } from "solid-js";
|
|
|
7
7
|
*
|
|
8
8
|
* @returns The PIXI.Application instance provided by the `PixiApplication` component.
|
|
9
9
|
* @throws Will throw an error if used outside of a `PixiApplication` context provider.
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* const MyComponent = () => {
|
|
13
|
-
* const app = usePixiApp();
|
|
14
|
-
*
|
|
15
|
-
* createEffect(() => {
|
|
16
|
-
* console.log('App resolution:', app.renderer.resolution);
|
|
17
|
-
* });
|
|
18
|
-
*
|
|
19
|
-
* return <Sprite texture={Texture.WHITE} />;
|
|
20
|
-
* };
|
|
21
|
-
* ```
|
|
22
10
|
*/
|
|
23
11
|
export declare const usePixiApp: () => Application<import("pixi.js").Renderer>;
|
|
24
12
|
/**
|
|
@@ -39,7 +27,5 @@ export type PixiApplicationProps = Partial<Omit<ApplicationOptions, "children" |
|
|
|
39
27
|
*
|
|
40
28
|
* @param props The properties to configure the Pixi.js Application.
|
|
41
29
|
*
|
|
42
|
-
* **Example**
|
|
43
|
-
* {@includeCode ./examples/PixiApplication.example.tsx}
|
|
44
30
|
*/
|
|
45
31
|
export declare const PixiApplication: (props: PixiApplicationProps) => JSX.Element;
|
|
@@ -5,16 +5,11 @@ import type { JSX } from "solid-js";
|
|
|
5
5
|
* A small wrapper that mounts the PIXI application's canvas element into the DOM
|
|
6
6
|
* and automatically resizes it.
|
|
7
7
|
*
|
|
8
|
-
* - Requires a surrounding `PixiApplication`
|
|
8
|
+
* - Requires a surrounding `PixiApplication` component.
|
|
9
9
|
* - Requires a `PixiStage` component as a child.
|
|
10
10
|
*
|
|
11
11
|
* Props:
|
|
12
|
-
* @param props.children - JSX content to render inside the canvas wrapper. Use
|
|
13
|
-
* `PixiStage` as the only child.
|
|
14
|
-
*
|
|
15
|
-
* **Example**
|
|
16
|
-
* {@includeCode ./examples/PixiCanvas.example.tsx}
|
|
17
|
-
*
|
|
12
|
+
* @param props.children - JSX content to render inside the canvas wrapper. Use `PixiStage` as the only child.
|
|
18
13
|
*/
|
|
19
14
|
export declare const PixiCanvas: (props: {
|
|
20
15
|
children: JSX.Element;
|
|
@@ -23,31 +23,15 @@ export declare const SOLID_PROP_KEYS: readonly ["ref", "as", "children"];
|
|
|
23
23
|
*/
|
|
24
24
|
export declare const applyProps: <InstanceType extends PixiContainer, OptionsType extends ContainerProps<InstanceType>>(instance: InstanceType, props: OptionsType) => void;
|
|
25
25
|
/**
|
|
26
|
-
* A SolidJS component that renders a PIXI.AnimatedSprite
|
|
27
|
-
*
|
|
28
|
-
* **Example**
|
|
29
|
-
* {@includeCode ./examples/AnimatedSprite.example.tsx}
|
|
30
|
-
*
|
|
31
|
-
* {@link PixiAnimatedSprite}
|
|
32
|
-
*
|
|
26
|
+
* A SolidJS component that renders a `PIXI.AnimatedSprite`.
|
|
33
27
|
*/
|
|
34
28
|
export declare const AnimatedSprite: (props: Omit<Pixi.AnimatedSpriteOptions, "children"> & LeafProps<Pixi.AnimatedSprite>) => JSX.Element;
|
|
35
29
|
/**
|
|
36
|
-
* A SolidJS component that renders a PIXI.BitmapText
|
|
37
|
-
*
|
|
38
|
-
* **Example**
|
|
39
|
-
* {@includeCode ./examples/BitmapText.example.tsx}
|
|
40
|
-
*
|
|
41
|
-
* {@link PixiBitmapText}
|
|
42
|
-
*
|
|
30
|
+
* A SolidJS component that renders a `PIXI.BitmapText`.
|
|
43
31
|
*/
|
|
44
|
-
export declare const BitmapText: (props: Omit<Pixi.
|
|
32
|
+
export declare const BitmapText: (props: Omit<[text?: Pixi.TextString | undefined, options?: Partial<Pixi.TextStyle> | undefined], "children"> & LeafProps<Pixi.BitmapText>) => JSX.Element;
|
|
45
33
|
/**
|
|
46
|
-
* A SolidJS component that renders a PIXI.Container
|
|
47
|
-
*
|
|
48
|
-
* **Example**
|
|
49
|
-
* {@includeCode ./examples/Container.example.tsx}
|
|
50
|
-
*
|
|
34
|
+
* A SolidJS component that renders a `PIXI.Container`.
|
|
51
35
|
*/
|
|
52
36
|
export declare const Container: (props: Omit<Pixi.ContainerOptions<Pixi.ContainerChild>, "children"> & PixiEventHandlerMap & {
|
|
53
37
|
ref?: Ref<Pixi.Container<Pixi.ContainerChild>> | undefined;
|
|
@@ -55,85 +39,42 @@ export declare const Container: (props: Omit<Pixi.ContainerOptions<Pixi.Containe
|
|
|
55
39
|
children?: JSX.Element;
|
|
56
40
|
}) => JSX.Element;
|
|
57
41
|
/**
|
|
58
|
-
* A SolidJS component that renders a PIXI.Graphics
|
|
42
|
+
* A SolidJS component that renders a `PIXI.Graphics`.
|
|
59
43
|
* Use a ref to access the underlying graphics instance and draw with it.
|
|
60
|
-
*
|
|
61
|
-
* **Example**
|
|
62
|
-
* {@includeCode ./examples/Graphics.example.tsx}
|
|
63
|
-
*
|
|
64
|
-
* {@link PixiGraphics}
|
|
65
44
|
*/
|
|
66
45
|
export declare const Graphics: (props: Omit<Pixi.GraphicsOptions, "children"> & LeafProps<Pixi.Graphics>) => JSX.Element;
|
|
67
46
|
/**
|
|
68
|
-
* A SolidJS component that renders a PIXI.HTMLText
|
|
69
|
-
*
|
|
70
|
-
* **Example**
|
|
71
|
-
* {@includeCode ./examples/HTMLText.example.tsx}
|
|
72
|
-
*
|
|
73
|
-
* {@link PixiHTMLText}
|
|
47
|
+
* A SolidJS component that renders a `PIXI.HTMLText`.
|
|
74
48
|
*/
|
|
75
49
|
export declare const HTMLText: (props: Omit<Pixi.HTMLTextOptions, "children"> & LeafProps<Pixi.HTMLText>) => JSX.Element;
|
|
76
50
|
/**
|
|
77
|
-
* A SolidJS component that renders a PIXI.MeshPlane
|
|
78
|
-
*
|
|
79
|
-
* **Example**
|
|
80
|
-
* {@includeCode ./examples/MeshPlane.example.tsx}
|
|
81
|
-
*
|
|
82
|
-
* {@link PixiMeshPlane}
|
|
51
|
+
* A SolidJS component that renders a `PIXI.MeshPlane`.
|
|
83
52
|
*/
|
|
84
53
|
export declare const MeshPlane: (props: Omit<Pixi.MeshPlaneOptions, "children"> & LeafProps<Pixi.MeshPlane>) => JSX.Element;
|
|
85
54
|
/**
|
|
86
|
-
* A SolidJS component that renders a PIXI.MeshRope
|
|
87
|
-
*
|
|
88
|
-
* **Example**
|
|
89
|
-
* {@includeCode ./examples/MeshRope.example.tsx}
|
|
90
|
-
*
|
|
91
|
-
* {@link PixiMeshRope}
|
|
55
|
+
* A SolidJS component that renders a `PIXI.MeshRope`.
|
|
92
56
|
*/
|
|
93
57
|
export declare const MeshRope: (props: Omit<Pixi.MeshRopeOptions, "children"> & LeafProps<Pixi.MeshRope>) => JSX.Element;
|
|
94
58
|
/**
|
|
95
|
-
* A SolidJS component that renders a PIXI.MeshSimple
|
|
96
|
-
*
|
|
97
|
-
* **Example**
|
|
98
|
-
* {@includeCode ./examples/MeshSimple.example.tsx}
|
|
99
|
-
*
|
|
100
|
-
* {@link PixiMeshSimple}
|
|
59
|
+
* A SolidJS component that renders a `PIXI.MeshSimple`.
|
|
101
60
|
*/
|
|
102
61
|
export declare const MeshSimple: (props: Omit<Pixi.SimpleMeshOptions, "children"> & LeafProps<Pixi.MeshSimple>) => JSX.Element;
|
|
103
62
|
/**
|
|
104
|
-
* A SolidJS component that renders a PIXI.NineSliceSprite
|
|
105
|
-
*
|
|
106
|
-
* **Example**
|
|
107
|
-
* {@includeCode ./examples/NineSliceSprite.example.tsx}
|
|
108
|
-
*
|
|
109
|
-
* {@link PixiNineSliceSprite}
|
|
63
|
+
* A SolidJS component that renders a `PIXI.NineSliceSprite`.
|
|
110
64
|
*/
|
|
111
65
|
export declare const NineSliceSprite: (props: Omit<Pixi.NineSliceSpriteOptions, "children"> & LeafProps<Pixi.NineSliceSprite>) => JSX.Element;
|
|
112
66
|
/**
|
|
113
|
-
* A SolidJS component that renders a PIXI.ParticleContainer
|
|
114
|
-
*
|
|
115
|
-
* **Example**
|
|
116
|
-
* {@includeCode ./examples/ParticleContainer.example.tsx}
|
|
67
|
+
* A SolidJS component that renders a `PIXI.ParticleContainer`.
|
|
117
68
|
*
|
|
118
|
-
*
|
|
69
|
+
* Particles should be added and removed from this component imperatively. Please see the docs for a reference example.
|
|
119
70
|
*/
|
|
120
71
|
export declare const ParticleContainer: (props: Omit<Pixi.ParticleContainerOptions, "children"> & LeafProps<Pixi.ParticleContainer>) => JSX.Element;
|
|
121
72
|
/**
|
|
122
|
-
* A SolidJS component that renders a PIXI.PerspectiveMesh
|
|
123
|
-
*
|
|
124
|
-
* **Example**
|
|
125
|
-
* {@includeCode ./examples/PerspectiveMesh.example.tsx}
|
|
126
|
-
*
|
|
127
|
-
* {@link PixiPerspectiveMesh}
|
|
73
|
+
* A SolidJS component that renders a `PIXI.PerspectiveMesh`.
|
|
128
74
|
*/
|
|
129
75
|
export declare const PerspectiveMesh: (props: Omit<Pixi.PerspectivePlaneOptions, "children"> & LeafProps<Pixi.PerspectiveMesh>) => JSX.Element;
|
|
130
76
|
/**
|
|
131
|
-
* A SolidJS component that renders a PIXI.RenderContainer
|
|
132
|
-
*
|
|
133
|
-
* **Example**
|
|
134
|
-
* {@includeCode ./examples/RenderContainer.example.tsx}
|
|
135
|
-
*
|
|
136
|
-
* {@link PixiRenderContainer}
|
|
77
|
+
* A SolidJS component that renders a `PIXI.RenderContainer`.
|
|
137
78
|
*/
|
|
138
79
|
export declare const RenderContainer: (props: Omit<Pixi.RenderContainerOptions, "children"> & PixiEventHandlerMap & {
|
|
139
80
|
ref?: Ref<Pixi.RenderContainer> | undefined;
|
|
@@ -141,12 +82,7 @@ export declare const RenderContainer: (props: Omit<Pixi.RenderContainerOptions,
|
|
|
141
82
|
children?: JSX.Element;
|
|
142
83
|
}) => JSX.Element;
|
|
143
84
|
/**
|
|
144
|
-
* A SolidJS component that renders a PIXI.RenderLayer
|
|
145
|
-
*
|
|
146
|
-
* **Example**
|
|
147
|
-
* {@includeCode ./examples/RenderLayer.example.tsx}
|
|
148
|
-
*
|
|
149
|
-
* {@link PixiRenderLayer}
|
|
85
|
+
* A SolidJS component that renders a `PIXI.RenderLayer`.
|
|
150
86
|
*/
|
|
151
87
|
export declare const RenderLayer: (props: Omit<Pixi.RenderLayerOptions, "children"> & PixiEventHandlerMap & {
|
|
152
88
|
ref?: Ref<Pixi.RenderLayer> | undefined;
|
|
@@ -154,29 +90,14 @@ export declare const RenderLayer: (props: Omit<Pixi.RenderLayerOptions, "childre
|
|
|
154
90
|
children?: JSX.Element;
|
|
155
91
|
}) => JSX.Element;
|
|
156
92
|
/**
|
|
157
|
-
* A SolidJS component that renders a PIXI.Sprite
|
|
158
|
-
*
|
|
159
|
-
* **Example**
|
|
160
|
-
* {@includeCode ./examples/Sprite.example.tsx}
|
|
161
|
-
*
|
|
162
|
-
* {@link PixiSprite}
|
|
93
|
+
* A SolidJS component that renders a `PIXI.Sprite`.
|
|
163
94
|
*/
|
|
164
95
|
export declare const Sprite: (props: Omit<Pixi.SpriteOptions, "children"> & LeafProps<Pixi.Sprite>) => JSX.Element;
|
|
165
96
|
/**
|
|
166
|
-
* A SolidJS component that renders a PIXI.Text
|
|
167
|
-
*
|
|
168
|
-
* **Example**
|
|
169
|
-
* {@includeCode ./examples/Text.example.tsx}
|
|
170
|
-
*
|
|
171
|
-
* {@link PixiText}
|
|
97
|
+
* A SolidJS component that renders a `PIXI.Text`.
|
|
172
98
|
*/
|
|
173
99
|
export declare const Text: (props: Omit<Pixi.CanvasTextOptions, "children"> & LeafProps<Pixi.Text>) => JSX.Element;
|
|
174
100
|
/**
|
|
175
|
-
* A SolidJS component that renders a PIXI.TilingSprite
|
|
176
|
-
*
|
|
177
|
-
* **Example**
|
|
178
|
-
* {@includeCode ./examples/TilingSprite.example.tsx}
|
|
179
|
-
*
|
|
180
|
-
* {@link PixiTilingSprite}
|
|
101
|
+
* A SolidJS component that renders a `PIXI.TilingSprite`.
|
|
181
102
|
*/
|
|
182
103
|
export declare const TilingSprite: (props: Omit<Pixi.TilingSpriteOptions, "children"> & LeafProps<Pixi.TilingSprite>) => JSX.Element;
|
|
@@ -18,8 +18,5 @@ export type PixiStageProps = PixiEventHandlerMap & Omit<ContainerOptions, "child
|
|
|
18
18
|
* - Any other container options supported by Pixi may be passed.
|
|
19
19
|
*
|
|
20
20
|
* Children passed to `PixiStage` are inserted into the application stage.
|
|
21
|
-
*
|
|
22
|
-
* **Example**
|
|
23
|
-
* {@includeCode ./examples/PixiStage.example.tsx}
|
|
24
21
|
*/
|
|
25
22
|
export declare const PixiStage: (props: PixiStageProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixi-solid",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"description": "A library to write PixiJS applications with SolidJS",
|
|
6
6
|
"author": "Luke Thompson",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,24 +26,10 @@
|
|
|
26
26
|
"pixi.js": "^8.14.3",
|
|
27
27
|
"solid-js": "^1.9.10"
|
|
28
28
|
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@biomejs/biome": "2.3.8",
|
|
31
|
-
"@types/node": "^24.10.1",
|
|
32
|
-
"jsdom": "27.2.0",
|
|
33
|
-
"sass-embedded": "1.93.3",
|
|
34
|
-
"typedoc": "0.28.15",
|
|
35
|
-
"typescript": "~5.9.3",
|
|
36
|
-
"vite": "npm:rolldown-vite@7.2.5",
|
|
37
|
-
"vite-plugin-solid": "^2.11.10",
|
|
38
|
-
"vitest": "4.0.14"
|
|
39
|
-
},
|
|
40
|
-
"overrides": {
|
|
41
|
-
"vite": "npm:rolldown-vite@7.2.5"
|
|
42
|
-
},
|
|
43
29
|
"scripts": {
|
|
44
30
|
"dev": "vite",
|
|
45
31
|
"prebuild": "rm -rf dist",
|
|
46
|
-
"build": "vite build && tsc --project tsconfig.build.json --emitDeclarationOnly
|
|
32
|
+
"build": "vite build && tsc --project tsconfig.build.json --emitDeclarationOnly",
|
|
47
33
|
"build:docs": "typedoc --options typedoc.config.js",
|
|
48
34
|
"preview": "vite preview",
|
|
49
35
|
"preinstall": "npx only-allow pnpm"
|
package/LICENSE.txt
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) [year] [fullname]
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyAnimatedSpriteComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyBitmapTextComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyContainerComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyGraphicsComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyHTMLTextComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyMeshPlaneComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyMeshRopeComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyMeshSimpleComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyNineSliceSpriteComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyParticleContainerComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyPerspectiveMeshComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PixiApplicationExample: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PixiCanvasExample: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const PixiStageExample: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyRenderContainerComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyRenderLayerComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MySpriteComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyTextComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyTilingSpriteComponent: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const UseTickExample: () => import("solid-js").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MyComponent: () => import("solid-js").JSX.Element;
|