@energy8platform/game-engine 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +178 -68
- package/dist/core.cjs.js +12 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.d.ts +6 -0
- package/dist/core.esm.js +12 -1
- package/dist/core.esm.js.map +1 -1
- package/dist/index.cjs.js +12 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.esm.js +12 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/react.cjs.js +470 -0
- package/dist/react.cjs.js.map +1 -0
- package/dist/react.d.ts +871 -0
- package/dist/react.esm.js +455 -0
- package/dist/react.esm.js.map +1 -0
- package/dist/vite.cjs.js +5 -0
- package/dist/vite.cjs.js.map +1 -1
- package/dist/vite.esm.js +5 -0
- package/dist/vite.esm.js.map +1 -1
- package/package.json +25 -3
- package/src/core/GameApplication.ts +1 -0
- package/src/core/SceneManager.ts +13 -1
- package/src/react/EngineContext.ts +26 -0
- package/src/react/ReactScene.ts +88 -0
- package/src/react/applyProps.ts +107 -0
- package/src/react/catalogue.ts +17 -0
- package/src/react/createPixiRoot.ts +31 -0
- package/src/react/extendAll.ts +51 -0
- package/src/react/hooks.ts +46 -0
- package/src/react/index.ts +23 -0
- package/src/react/reconciler.ts +169 -0
- package/src/types.ts +3 -0
- package/src/vite/index.ts +5 -0
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import { DefaultEventPriority, ConcurrentRoot } from 'react-reconciler/constants';
|
|
2
|
+
import Reconciler from 'react-reconciler';
|
|
3
|
+
import { Container, HTMLText, BitmapText, MeshSimple, MeshRope, MeshPlane, Mesh, TilingSprite, NineSliceSprite, AnimatedSprite, Text, Graphics, Sprite } from 'pixi.js';
|
|
4
|
+
import { createContext, useContext, createElement, useState, useEffect } from 'react';
|
|
5
|
+
|
|
6
|
+
/** Mutable catalogue: PascalCase name -> PixiJS constructor */
|
|
7
|
+
const catalogue = {};
|
|
8
|
+
/**
|
|
9
|
+
* Register PixiJS classes for use as JSX elements.
|
|
10
|
+
* Keys must be PascalCase; JSX uses the camelCase equivalent.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { Container, Sprite, Text } from 'pixi.js';
|
|
15
|
+
* extend({ Container, Sprite, Text });
|
|
16
|
+
* // Now <container>, <sprite>, <text> work in JSX
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
function extend(components) {
|
|
20
|
+
Object.assign(catalogue, components);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const RESERVED = new Set(['children', 'key', 'ref']);
|
|
24
|
+
const REACT_TO_PIXI_EVENTS = {
|
|
25
|
+
onClick: 'onclick',
|
|
26
|
+
onPointerDown: 'onpointerdown',
|
|
27
|
+
onPointerUp: 'onpointerup',
|
|
28
|
+
onPointerMove: 'onpointermove',
|
|
29
|
+
onPointerOver: 'onpointerover',
|
|
30
|
+
onPointerOut: 'onpointerout',
|
|
31
|
+
onPointerEnter: 'onpointerenter',
|
|
32
|
+
onPointerLeave: 'onpointerleave',
|
|
33
|
+
onPointerCancel: 'onpointercancel',
|
|
34
|
+
onPointerTap: 'onpointertap',
|
|
35
|
+
onPointerUpOutside: 'onpointerupoutside',
|
|
36
|
+
onMouseDown: 'onmousedown',
|
|
37
|
+
onMouseUp: 'onmouseup',
|
|
38
|
+
onMouseMove: 'onmousemove',
|
|
39
|
+
onMouseOver: 'onmouseover',
|
|
40
|
+
onMouseOut: 'onmouseout',
|
|
41
|
+
onMouseEnter: 'onmouseenter',
|
|
42
|
+
onMouseLeave: 'onmouseleave',
|
|
43
|
+
onMouseUpOutside: 'onmouseupoutside',
|
|
44
|
+
onTouchStart: 'ontouchstart',
|
|
45
|
+
onTouchEnd: 'ontouchend',
|
|
46
|
+
onTouchMove: 'ontouchmove',
|
|
47
|
+
onTouchCancel: 'ontouchcancel',
|
|
48
|
+
onTouchEndOutside: 'ontouchendoutside',
|
|
49
|
+
onWheel: 'onwheel',
|
|
50
|
+
onRightClick: 'onrightclick',
|
|
51
|
+
onRightDown: 'onrightdown',
|
|
52
|
+
onRightUp: 'onrightup',
|
|
53
|
+
onRightUpOutside: 'onrightupoutside',
|
|
54
|
+
onTap: 'ontap',
|
|
55
|
+
onGlobalpointermove: 'onglobalpointermove',
|
|
56
|
+
onGlobalmousemove: 'onglobalmousemove',
|
|
57
|
+
onGlobaltouchmove: 'onglobaltouchmove',
|
|
58
|
+
};
|
|
59
|
+
function isEventProp(key) {
|
|
60
|
+
return key in REACT_TO_PIXI_EVENTS;
|
|
61
|
+
}
|
|
62
|
+
function hasEventProps(props) {
|
|
63
|
+
for (const key in props) {
|
|
64
|
+
if (isEventProp(key))
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
function setNestedValue(target, path, value) {
|
|
70
|
+
let obj = target;
|
|
71
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
72
|
+
obj = obj[path[i]];
|
|
73
|
+
if (obj == null)
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
obj[path[path.length - 1]] = value;
|
|
77
|
+
}
|
|
78
|
+
function applyProps(instance, newProps, oldProps = {}) {
|
|
79
|
+
// Remove old props not in newProps
|
|
80
|
+
for (const key in oldProps) {
|
|
81
|
+
if (RESERVED.has(key) || key in newProps)
|
|
82
|
+
continue;
|
|
83
|
+
const pixiEvent = REACT_TO_PIXI_EVENTS[key];
|
|
84
|
+
if (pixiEvent) {
|
|
85
|
+
instance[pixiEvent] = null;
|
|
86
|
+
}
|
|
87
|
+
else if (key === 'draw') ;
|
|
88
|
+
else if (key.includes('-')) ;
|
|
89
|
+
else {
|
|
90
|
+
try {
|
|
91
|
+
instance[key] = undefined;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// read-only or non-configurable
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Apply new props
|
|
99
|
+
for (const key in newProps) {
|
|
100
|
+
if (RESERVED.has(key))
|
|
101
|
+
continue;
|
|
102
|
+
const value = newProps[key];
|
|
103
|
+
const pixiEvent = REACT_TO_PIXI_EVENTS[key];
|
|
104
|
+
if (pixiEvent) {
|
|
105
|
+
instance[pixiEvent] = value;
|
|
106
|
+
}
|
|
107
|
+
else if (key === 'draw' && typeof value === 'function') {
|
|
108
|
+
instance.clear?.();
|
|
109
|
+
value(instance);
|
|
110
|
+
}
|
|
111
|
+
else if (key.includes('-')) {
|
|
112
|
+
const parts = key.split('-');
|
|
113
|
+
setNestedValue(instance, parts, value);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
try {
|
|
117
|
+
instance[key] = value;
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// read-only property
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function toPascalCase(str) {
|
|
127
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
128
|
+
}
|
|
129
|
+
const hostConfig = {
|
|
130
|
+
isPrimaryRenderer: false,
|
|
131
|
+
supportsMutation: true,
|
|
132
|
+
supportsPersistence: false,
|
|
133
|
+
supportsHydration: false,
|
|
134
|
+
createInstance(type, props) {
|
|
135
|
+
const name = toPascalCase(type);
|
|
136
|
+
const Ctor = catalogue[name];
|
|
137
|
+
if (!Ctor) {
|
|
138
|
+
throw new Error(`[PixiReconciler] Unknown element "<${type}>". ` +
|
|
139
|
+
`Call extend({ ${name} }) before rendering.`);
|
|
140
|
+
}
|
|
141
|
+
const instance = new Ctor();
|
|
142
|
+
applyProps(instance, props);
|
|
143
|
+
// Enable interactivity if any event prop is present
|
|
144
|
+
if (hasEventProps(props) && instance.eventMode === 'auto') {
|
|
145
|
+
instance.eventMode = 'static';
|
|
146
|
+
}
|
|
147
|
+
return instance;
|
|
148
|
+
},
|
|
149
|
+
createTextInstance() {
|
|
150
|
+
throw new Error('[PixiReconciler] Text strings are not supported. Use a <text> element.');
|
|
151
|
+
},
|
|
152
|
+
appendInitialChild(parent, child) {
|
|
153
|
+
if (child instanceof Container)
|
|
154
|
+
parent.addChild(child);
|
|
155
|
+
},
|
|
156
|
+
appendChild(parent, child) {
|
|
157
|
+
if (child instanceof Container)
|
|
158
|
+
parent.addChild(child);
|
|
159
|
+
},
|
|
160
|
+
appendChildToContainer(container, child) {
|
|
161
|
+
if (child instanceof Container)
|
|
162
|
+
container.addChild(child);
|
|
163
|
+
},
|
|
164
|
+
removeChild(parent, child) {
|
|
165
|
+
if (child instanceof Container) {
|
|
166
|
+
parent.removeChild(child);
|
|
167
|
+
child.destroy({ children: true });
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
removeChildFromContainer(container, child) {
|
|
171
|
+
if (child instanceof Container) {
|
|
172
|
+
container.removeChild(child);
|
|
173
|
+
child.destroy({ children: true });
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
insertBefore(parent, child, beforeChild) {
|
|
177
|
+
if (child instanceof Container && beforeChild instanceof Container) {
|
|
178
|
+
if (child.parent)
|
|
179
|
+
child.parent.removeChild(child);
|
|
180
|
+
const index = parent.getChildIndex(beforeChild);
|
|
181
|
+
parent.addChildAt(child, index);
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
insertInContainerBefore(container, child, beforeChild) {
|
|
185
|
+
if (child instanceof Container && beforeChild instanceof Container) {
|
|
186
|
+
if (child.parent)
|
|
187
|
+
child.parent.removeChild(child);
|
|
188
|
+
const index = container.getChildIndex(beforeChild);
|
|
189
|
+
container.addChildAt(child, index);
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
commitUpdate(instance, _updatePayload, _type, oldProps, newProps) {
|
|
193
|
+
applyProps(instance, newProps, oldProps);
|
|
194
|
+
if (hasEventProps(newProps) && instance.eventMode === 'auto') {
|
|
195
|
+
instance.eventMode = 'static';
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
finalizeInitialChildren() {
|
|
199
|
+
return false;
|
|
200
|
+
},
|
|
201
|
+
prepareUpdate() {
|
|
202
|
+
return true;
|
|
203
|
+
},
|
|
204
|
+
shouldSetTextContent() {
|
|
205
|
+
return false;
|
|
206
|
+
},
|
|
207
|
+
getRootHostContext() {
|
|
208
|
+
return null;
|
|
209
|
+
},
|
|
210
|
+
getChildHostContext(parentHostContext) {
|
|
211
|
+
return parentHostContext;
|
|
212
|
+
},
|
|
213
|
+
getPublicInstance(instance) {
|
|
214
|
+
return instance;
|
|
215
|
+
},
|
|
216
|
+
prepareForCommit() {
|
|
217
|
+
return null;
|
|
218
|
+
},
|
|
219
|
+
resetAfterCommit() { },
|
|
220
|
+
preparePortalMount() { },
|
|
221
|
+
scheduleTimeout: setTimeout,
|
|
222
|
+
cancelTimeout: clearTimeout,
|
|
223
|
+
noTimeout: -1,
|
|
224
|
+
getCurrentEventPriority() {
|
|
225
|
+
return DefaultEventPriority;
|
|
226
|
+
},
|
|
227
|
+
hideInstance(instance) {
|
|
228
|
+
instance.visible = false;
|
|
229
|
+
},
|
|
230
|
+
unhideInstance(instance) {
|
|
231
|
+
instance.visible = true;
|
|
232
|
+
},
|
|
233
|
+
hideTextInstance() { },
|
|
234
|
+
unhideTextInstance() { },
|
|
235
|
+
clearContainer() { },
|
|
236
|
+
detachDeletedInstance() { },
|
|
237
|
+
prepareScopeUpdate() { },
|
|
238
|
+
getInstanceFromNode() { return null; },
|
|
239
|
+
getInstanceFromScope() { return null; },
|
|
240
|
+
beforeActiveInstanceBlur() { },
|
|
241
|
+
afterActiveInstanceBlur() { },
|
|
242
|
+
};
|
|
243
|
+
const reconciler = Reconciler(hostConfig);
|
|
244
|
+
|
|
245
|
+
function createPixiRoot(container) {
|
|
246
|
+
const fiberRoot = reconciler.createContainer(container, // containerInfo
|
|
247
|
+
ConcurrentRoot, // tag
|
|
248
|
+
null, // hydrationCallbacks
|
|
249
|
+
false, // isStrictMode
|
|
250
|
+
null, // concurrentUpdatesByDefaultOverride
|
|
251
|
+
'', // identifierPrefix
|
|
252
|
+
(err) => console.error('[PixiRoot]', err), null);
|
|
253
|
+
return {
|
|
254
|
+
render(element) {
|
|
255
|
+
reconciler.updateContainer(element, fiberRoot, null, () => { });
|
|
256
|
+
},
|
|
257
|
+
unmount() {
|
|
258
|
+
reconciler.updateContainer(null, fiberRoot, null, () => { });
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Register all standard PixiJS display objects for JSX use.
|
|
265
|
+
* Call once at app startup before rendering any React scenes.
|
|
266
|
+
*/
|
|
267
|
+
function extendPixiElements() {
|
|
268
|
+
extend({
|
|
269
|
+
Container,
|
|
270
|
+
Sprite,
|
|
271
|
+
Graphics,
|
|
272
|
+
Text,
|
|
273
|
+
AnimatedSprite,
|
|
274
|
+
NineSliceSprite,
|
|
275
|
+
TilingSprite,
|
|
276
|
+
Mesh,
|
|
277
|
+
MeshPlane,
|
|
278
|
+
MeshRope,
|
|
279
|
+
MeshSimple,
|
|
280
|
+
BitmapText,
|
|
281
|
+
HTMLText,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Register @pixi/layout components for JSX use.
|
|
286
|
+
* Pass the dynamically imported module:
|
|
287
|
+
*
|
|
288
|
+
* ```ts
|
|
289
|
+
* const layout = await import('@pixi/layout/components');
|
|
290
|
+
* extendLayoutElements(layout);
|
|
291
|
+
* ```
|
|
292
|
+
*/
|
|
293
|
+
function extendLayoutElements(layoutModule) {
|
|
294
|
+
extend(layoutModule);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Base class for all scenes.
|
|
299
|
+
* Provides a root PixiJS Container and lifecycle hooks.
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```ts
|
|
303
|
+
* class MenuScene extends Scene {
|
|
304
|
+
* async onEnter() {
|
|
305
|
+
* const bg = Sprite.from('menu-bg');
|
|
306
|
+
* this.container.addChild(bg);
|
|
307
|
+
* }
|
|
308
|
+
*
|
|
309
|
+
* onUpdate(dt: number) {
|
|
310
|
+
* // per-frame logic
|
|
311
|
+
* }
|
|
312
|
+
*
|
|
313
|
+
* onResize(width: number, height: number) {
|
|
314
|
+
* // reposition UI
|
|
315
|
+
* }
|
|
316
|
+
* }
|
|
317
|
+
* ```
|
|
318
|
+
*/
|
|
319
|
+
class Scene {
|
|
320
|
+
container;
|
|
321
|
+
constructor() {
|
|
322
|
+
this.container = new Container();
|
|
323
|
+
this.container.label = this.constructor.name;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const EngineContext = createContext(null);
|
|
328
|
+
function useEngine() {
|
|
329
|
+
const ctx = useContext(EngineContext);
|
|
330
|
+
if (!ctx)
|
|
331
|
+
throw new Error('useEngine() must be used inside a ReactScene');
|
|
332
|
+
return ctx;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// ─── Scale Modes ───────────────────────────────────────────
|
|
336
|
+
var ScaleMode;
|
|
337
|
+
(function (ScaleMode) {
|
|
338
|
+
/** Fit inside container, maintain aspect ratio (letterbox/pillarbox) */
|
|
339
|
+
ScaleMode["FIT"] = "FIT";
|
|
340
|
+
/** Fill container, maintain aspect ratio (crop edges) */
|
|
341
|
+
ScaleMode["FILL"] = "FILL";
|
|
342
|
+
/** Stretch to fill (distorts) */
|
|
343
|
+
ScaleMode["STRETCH"] = "STRETCH";
|
|
344
|
+
})(ScaleMode || (ScaleMode = {}));
|
|
345
|
+
// ─── Orientation ───────────────────────────────────────────
|
|
346
|
+
var Orientation;
|
|
347
|
+
(function (Orientation) {
|
|
348
|
+
Orientation["LANDSCAPE"] = "landscape";
|
|
349
|
+
Orientation["PORTRAIT"] = "portrait";
|
|
350
|
+
Orientation["ANY"] = "any";
|
|
351
|
+
})(Orientation || (Orientation = {}));
|
|
352
|
+
// ─── Transition Types ──────────────────────────────────────
|
|
353
|
+
var TransitionType;
|
|
354
|
+
(function (TransitionType) {
|
|
355
|
+
TransitionType["NONE"] = "none";
|
|
356
|
+
TransitionType["FADE"] = "fade";
|
|
357
|
+
TransitionType["SLIDE_LEFT"] = "slide-left";
|
|
358
|
+
TransitionType["SLIDE_RIGHT"] = "slide-right";
|
|
359
|
+
})(TransitionType || (TransitionType = {}));
|
|
360
|
+
|
|
361
|
+
class ReactScene extends Scene {
|
|
362
|
+
_pixiRoot = null;
|
|
363
|
+
_contextValue = null;
|
|
364
|
+
/** Access the GameApplication instance. */
|
|
365
|
+
getApp() {
|
|
366
|
+
const app = this.__engineApp;
|
|
367
|
+
if (!app) {
|
|
368
|
+
throw new Error('[ReactScene] No GameApplication reference. ' +
|
|
369
|
+
'Ensure this scene is managed by SceneManager (not instantiated manually).');
|
|
370
|
+
}
|
|
371
|
+
return app;
|
|
372
|
+
}
|
|
373
|
+
async onEnter(data) {
|
|
374
|
+
const app = this.getApp();
|
|
375
|
+
this._contextValue = {
|
|
376
|
+
app,
|
|
377
|
+
sdk: app.sdk,
|
|
378
|
+
audio: app.audio,
|
|
379
|
+
input: app.input,
|
|
380
|
+
viewport: app.viewport,
|
|
381
|
+
gameConfig: app.gameConfig,
|
|
382
|
+
screen: {
|
|
383
|
+
width: app.viewport.width,
|
|
384
|
+
height: app.viewport.height,
|
|
385
|
+
scale: app.viewport.scale,
|
|
386
|
+
},
|
|
387
|
+
isPortrait: app.viewport.orientation === Orientation.PORTRAIT,
|
|
388
|
+
};
|
|
389
|
+
this._pixiRoot = createPixiRoot(this.container);
|
|
390
|
+
this._mountReactTree();
|
|
391
|
+
}
|
|
392
|
+
async onExit() {
|
|
393
|
+
this._pixiRoot?.unmount();
|
|
394
|
+
this._pixiRoot = null;
|
|
395
|
+
this._contextValue = null;
|
|
396
|
+
}
|
|
397
|
+
onResize(width, height) {
|
|
398
|
+
if (!this._contextValue)
|
|
399
|
+
return;
|
|
400
|
+
const app = this.getApp();
|
|
401
|
+
this._contextValue = {
|
|
402
|
+
...this._contextValue,
|
|
403
|
+
screen: { width, height, scale: app.viewport.scale },
|
|
404
|
+
isPortrait: height > width,
|
|
405
|
+
};
|
|
406
|
+
this._mountReactTree();
|
|
407
|
+
}
|
|
408
|
+
onDestroy() {
|
|
409
|
+
this._pixiRoot?.unmount();
|
|
410
|
+
this._pixiRoot = null;
|
|
411
|
+
this._contextValue = null;
|
|
412
|
+
}
|
|
413
|
+
_mountReactTree() {
|
|
414
|
+
if (!this._pixiRoot || !this._contextValue)
|
|
415
|
+
return;
|
|
416
|
+
this._pixiRoot.render(createElement(EngineContext.Provider, { value: this._contextValue }, this.render()));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function useSDK() {
|
|
421
|
+
return useEngine().sdk;
|
|
422
|
+
}
|
|
423
|
+
function useAudio() {
|
|
424
|
+
return useEngine().audio;
|
|
425
|
+
}
|
|
426
|
+
function useInput() {
|
|
427
|
+
return useEngine().input;
|
|
428
|
+
}
|
|
429
|
+
function useViewport() {
|
|
430
|
+
const { screen, isPortrait } = useEngine();
|
|
431
|
+
return { ...screen, isPortrait };
|
|
432
|
+
}
|
|
433
|
+
function useBalance() {
|
|
434
|
+
const { sdk } = useEngine();
|
|
435
|
+
const [balance, setBalance] = useState(sdk?.balance ?? 0);
|
|
436
|
+
useEffect(() => {
|
|
437
|
+
if (!sdk)
|
|
438
|
+
return;
|
|
439
|
+
const handler = (data) => setBalance(data.balance);
|
|
440
|
+
sdk.on('balanceUpdate', handler);
|
|
441
|
+
return () => {
|
|
442
|
+
sdk.off('balanceUpdate', handler);
|
|
443
|
+
};
|
|
444
|
+
}, [sdk]);
|
|
445
|
+
return balance;
|
|
446
|
+
}
|
|
447
|
+
function useSession() {
|
|
448
|
+
return useEngine().app.session;
|
|
449
|
+
}
|
|
450
|
+
function useGameConfig() {
|
|
451
|
+
return useEngine().gameConfig;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export { EngineContext, ReactScene, createPixiRoot, extend, extendLayoutElements, extendPixiElements, useAudio, useBalance, useEngine, useGameConfig, useInput, useSDK, useSession, useViewport };
|
|
455
|
+
//# sourceMappingURL=react.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.esm.js","sources":["../src/react/catalogue.ts","../src/react/applyProps.ts","../src/react/reconciler.ts","../src/react/createPixiRoot.ts","../src/react/extendAll.ts","../src/core/Scene.ts","../src/react/EngineContext.ts","../src/types.ts","../src/react/ReactScene.ts","../src/react/hooks.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;AAAA;AACO,MAAM,SAAS,GAAwB,EAAE;AAEhD;;;;;;;;;;AAUG;AACG,SAAU,MAAM,CAAC,UAA+B,EAAA;AACpD,IAAA,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC;AACtC;;AChBA,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEpD,MAAM,oBAAoB,GAA2B;AACnD,IAAA,OAAO,EAAE,SAAS;AAClB,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,YAAY,EAAE,cAAc;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AE,GAAG,EAAE,GAAG,SAAS,EAAE;AAC3B,IAAA,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,OAAO,IAAI,CAAC,CAAC;IAEzD,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,CAAC,GAAG;YAAE;AACV,QAAA,MAAM,OAAO,GAAG,CAAC,IAAyB,KAAK,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;AACvE,QAAA,GAAG,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC;AAChC,QAAA,OAAO,MAAK;AACV,YAAA,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC;AACnC,QAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAET,IAAA,OAAO,OAAO;AAChB;SAEgB,UAAU,GAAA;AACxB,IAAA,OAAO,SAAS,EAAE,CAAC,GAAG,CAAC,OAAO;AAChC;SAEgB,aAAa,GAAA;AAC3B,IAAA,OAAO,SAAS,EAAE,CAAC,UAAsB;AAC3C;;;;"}
|
package/dist/vite.cjs.js
CHANGED
|
@@ -116,6 +116,9 @@ function defineGameConfig(config = {}) {
|
|
|
116
116
|
'@pixi/ui',
|
|
117
117
|
'yoga-layout',
|
|
118
118
|
'yoga-layout/load',
|
|
119
|
+
'react',
|
|
120
|
+
'react-dom',
|
|
121
|
+
'react-reconciler',
|
|
119
122
|
],
|
|
120
123
|
...userVite.resolve,
|
|
121
124
|
},
|
|
@@ -126,6 +129,8 @@ function defineGameConfig(config = {}) {
|
|
|
126
129
|
'@pixi/layout/components',
|
|
127
130
|
'@pixi/ui',
|
|
128
131
|
'yoga-layout/load',
|
|
132
|
+
'react',
|
|
133
|
+
'react-dom',
|
|
129
134
|
],
|
|
130
135
|
exclude: [
|
|
131
136
|
'yoga-layout',
|
package/dist/vite.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.cjs.js","s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AACpB,SAAA;AAED,QAAA,YAAY,EAAE;AACZ,YAAA,OAAO,EAAE;gBACP,SAAS;gBACT,cAAc;gBACd,yBAAyB;gBACzB,UAAU;gBACV,kBAAkB;gBAClB,OAAO;gBACP,WAAW;AACZ,aAAA;AACD,YAAA,OAAO,EAAE;gBACP,aAAa;AACd,aAAA;AACD,YAAA,cAAc,EAAE;AACd,gBAAA,MAAM,EAAE,QAAQ;AACjB,aAAA;YACD,GAAG,QAAQ,CAAC,YAAY;AACzB,SAAA;KACF;AACH;;;;"}
|
package/dist/vite.esm.js
CHANGED
|
@@ -114,6 +114,9 @@ function defineGameConfig(config = {}) {
|
|
|
114
114
|
'@pixi/ui',
|
|
115
115
|
'yoga-layout',
|
|
116
116
|
'yoga-layout/load',
|
|
117
|
+
'react',
|
|
118
|
+
'react-dom',
|
|
119
|
+
'react-reconciler',
|
|
117
120
|
],
|
|
118
121
|
...userVite.resolve,
|
|
119
122
|
},
|
|
@@ -124,6 +127,8 @@ function defineGameConfig(config = {}) {
|
|
|
124
127
|
'@pixi/layout/components',
|
|
125
128
|
'@pixi/ui',
|
|
126
129
|
'yoga-layout/load',
|
|
130
|
+
'react',
|
|
131
|
+
'react-dom',
|
|
127
132
|
],
|
|
128
133
|
exclude: [
|
|
129
134
|
'yoga-layout',
|
package/dist/vite.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.esm.js","sources":["../src/vite/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAkBA;AAEA;;;;AAIG;AACH,MAAM,UAAU,GAAG,uBAAuB;AAE1C,SAAS,eAAe,CAAC,UAAkB,EAAA;IACzC,IAAI,QAAQ,GAAG,EAAE;IACjB,IAAI,kBAAkB,GAAG,UAAU;IAEnC,OAAO;AACL,QAAA,IAAI,EAAE,wBAAwB;QAC9B,KAAK,EAAE,OAAO;AACd,QAAA,OAAO,EAAE,KAAK;AAEd,QAAA,cAAc,CAAC,MAAM,EAAA;;;AAGnB,YA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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@energy8platform/game-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Universal casino game engine built on PixiJS v8 and @energy8platform/game-sdk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs.js",
|
|
@@ -46,6 +46,11 @@
|
|
|
46
46
|
"import": "./dist/vite.esm.js",
|
|
47
47
|
"require": "./dist/vite.cjs.js",
|
|
48
48
|
"types": "./dist/vite.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./react": {
|
|
51
|
+
"import": "./dist/react.esm.js",
|
|
52
|
+
"require": "./dist/react.cjs.js",
|
|
53
|
+
"types": "./dist/react.d.ts"
|
|
49
54
|
}
|
|
50
55
|
},
|
|
51
56
|
"files": [
|
|
@@ -67,7 +72,10 @@
|
|
|
67
72
|
"@energy8platform/game-sdk": "^2.7.0",
|
|
68
73
|
"@pixi/ui": "^2.3.0",
|
|
69
74
|
"@pixi/layout": "^3.2.0",
|
|
70
|
-
"yoga-layout": "^3.0.0"
|
|
75
|
+
"yoga-layout": "^3.0.0",
|
|
76
|
+
"react": ">=18.0.0",
|
|
77
|
+
"react-dom": ">=18.0.0",
|
|
78
|
+
"react-reconciler": ">=0.29.0"
|
|
71
79
|
},
|
|
72
80
|
"peerDependenciesMeta": {
|
|
73
81
|
"@esotericsoftware/spine-pixi-v8": {
|
|
@@ -84,6 +92,15 @@
|
|
|
84
92
|
},
|
|
85
93
|
"yoga-layout": {
|
|
86
94
|
"optional": true
|
|
95
|
+
},
|
|
96
|
+
"react": {
|
|
97
|
+
"optional": true
|
|
98
|
+
},
|
|
99
|
+
"react-dom": {
|
|
100
|
+
"optional": true
|
|
101
|
+
},
|
|
102
|
+
"react-reconciler": {
|
|
103
|
+
"optional": true
|
|
87
104
|
}
|
|
88
105
|
},
|
|
89
106
|
"devDependencies": {
|
|
@@ -104,7 +121,12 @@
|
|
|
104
121
|
"tslib": "^2.8.0",
|
|
105
122
|
"typescript": "^5.6.0",
|
|
106
123
|
"vite": "^6.0.0",
|
|
107
|
-
"vitest": "^2.0.0"
|
|
124
|
+
"vitest": "^2.0.0",
|
|
125
|
+
"react": "^19.0.0",
|
|
126
|
+
"react-dom": "^19.0.0",
|
|
127
|
+
"react-reconciler": "^0.31.0",
|
|
128
|
+
"@types/react": "^19.0.0",
|
|
129
|
+
"@types/react-dom": "^19.0.0"
|
|
108
130
|
},
|
|
109
131
|
"keywords": [
|
|
110
132
|
"casino",
|
|
@@ -290,6 +290,7 @@ export class GameApplication extends EventEmitter<GameEngineEvents> {
|
|
|
290
290
|
|
|
291
291
|
// Wire SceneManager to the PixiJS stage
|
|
292
292
|
this.scenes.setRoot(this.app.stage);
|
|
293
|
+
this.scenes.setApp(this);
|
|
293
294
|
|
|
294
295
|
// Wire viewport resize → scene manager + input manager
|
|
295
296
|
this.viewport.on('resize', ({ width, height, scale }) => {
|
package/src/core/SceneManager.ts
CHANGED
|
@@ -38,6 +38,9 @@ export class SceneManager extends EventEmitter<SceneManagerEvents> {
|
|
|
38
38
|
private _width = 0;
|
|
39
39
|
private _height = 0;
|
|
40
40
|
|
|
41
|
+
/** @internal GameApplication reference — passed to scenes */
|
|
42
|
+
private _app: any;
|
|
43
|
+
|
|
41
44
|
constructor(root?: Container) {
|
|
42
45
|
super();
|
|
43
46
|
if (root) this.root = root;
|
|
@@ -48,6 +51,11 @@ export class SceneManager extends EventEmitter<SceneManagerEvents> {
|
|
|
48
51
|
this.root = root;
|
|
49
52
|
}
|
|
50
53
|
|
|
54
|
+
/** @internal Set the app reference (called by GameApplication) */
|
|
55
|
+
setApp(app: any): void {
|
|
56
|
+
this._app = app;
|
|
57
|
+
}
|
|
58
|
+
|
|
51
59
|
/** Register a scene class by key */
|
|
52
60
|
register(key: string, ctor: SceneConstructor): this {
|
|
53
61
|
this.registry.set(key, ctor);
|
|
@@ -183,7 +191,11 @@ export class SceneManager extends EventEmitter<SceneManagerEvents> {
|
|
|
183
191
|
if (!Ctor) {
|
|
184
192
|
throw new Error(`[SceneManager] Scene "${key}" is not registered`);
|
|
185
193
|
}
|
|
186
|
-
|
|
194
|
+
const scene = new Ctor();
|
|
195
|
+
if (this._app) {
|
|
196
|
+
scene.__engineApp = this._app;
|
|
197
|
+
}
|
|
198
|
+
return scene;
|
|
187
199
|
}
|
|
188
200
|
|
|
189
201
|
private async pushInternal(
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import type { GameApplication } from '../core/GameApplication';
|
|
3
|
+
import type { AudioManager } from '../audio/AudioManager';
|
|
4
|
+
import type { InputManager } from '../input/InputManager';
|
|
5
|
+
import type { ViewportManager } from '../viewport/ViewportManager';
|
|
6
|
+
import type { CasinoGameSDK } from '@energy8platform/game-sdk';
|
|
7
|
+
import type { GameConfigData } from '@energy8platform/game-sdk';
|
|
8
|
+
|
|
9
|
+
export interface EngineContextValue {
|
|
10
|
+
app: GameApplication;
|
|
11
|
+
sdk: CasinoGameSDK | null;
|
|
12
|
+
audio: AudioManager;
|
|
13
|
+
input: InputManager;
|
|
14
|
+
viewport: ViewportManager;
|
|
15
|
+
gameConfig: GameConfigData | null;
|
|
16
|
+
screen: { width: number; height: number; scale: number };
|
|
17
|
+
isPortrait: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const EngineContext = createContext<EngineContextValue | null>(null);
|
|
21
|
+
|
|
22
|
+
export function useEngine(): EngineContextValue {
|
|
23
|
+
const ctx = useContext(EngineContext);
|
|
24
|
+
if (!ctx) throw new Error('useEngine() must be used inside a ReactScene');
|
|
25
|
+
return ctx;
|
|
26
|
+
}
|