@flare-engine/react 0.1.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/dist/index.js ADDED
@@ -0,0 +1,1035 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ GameContext: () => GameContext,
24
+ GameView: () => GameView,
25
+ LoadingScreen: () => LoadingScreen,
26
+ SafeAreaContext: () => SafeAreaContext,
27
+ VirtualButton: () => VirtualButton,
28
+ VirtualJoystick: () => VirtualJoystick,
29
+ createSkiaFrameRenderer: () => createSkiaFrameRenderer,
30
+ renderShapesToImage: () => renderShapesToImage,
31
+ useEntity: () => useEntity,
32
+ useGame: () => useGame,
33
+ useGameLoop: () => useGameLoop,
34
+ useSafeArea: () => useSafeArea
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+
38
+ // src/game-context.ts
39
+ var import_react = require("react");
40
+ var GameContext = (0, import_react.createContext)(null);
41
+
42
+ // src/game-view.tsx
43
+ var import_assets = require("@flare-engine/assets");
44
+ var import_audio = require("@flare-engine/audio");
45
+ var import_core = require("@flare-engine/core");
46
+ var import_ecs = require("@flare-engine/ecs");
47
+ var import_input = require("@flare-engine/input");
48
+ var import_render2 = require("@flare-engine/render");
49
+ var import_scene = require("@flare-engine/scene");
50
+ var import_react_native_skia = require("@shopify/react-native-skia");
51
+ var import_react3 = require("react");
52
+ var import_react_native = require("react-native");
53
+ var import_react_native_safe_area_context = require("react-native-safe-area-context");
54
+
55
+ // src/safe-area.ts
56
+ var import_react2 = require("react");
57
+ var SafeAreaContext = (0, import_react2.createContext)(null);
58
+ function useSafeArea() {
59
+ const value = (0, import_react2.useContext)(SafeAreaContext);
60
+ if (value === null) {
61
+ throw new Error("useSafeArea must be used inside a <GameView>");
62
+ }
63
+ return value;
64
+ }
65
+
66
+ // src/skia-bridge.ts
67
+ var import_render = require("@flare-engine/render");
68
+ function detachSnapshot(surface) {
69
+ const snap = surface.makeImageSnapshot();
70
+ if (typeof snap.makeNonTextureImage === "function") {
71
+ return snap.makeNonTextureImage();
72
+ }
73
+ return snap;
74
+ }
75
+ var BLEND_SRC_OVER = 3;
76
+ var BLEND_SRC_IN = 5;
77
+ var OUTLINE_OFFSETS = [
78
+ [1, 0],
79
+ [-1, 0],
80
+ [0, 1],
81
+ [0, -1],
82
+ [Math.SQRT1_2, Math.SQRT1_2],
83
+ [Math.SQRT1_2, -Math.SQRT1_2],
84
+ [-Math.SQRT1_2, Math.SQRT1_2],
85
+ [-Math.SQRT1_2, -Math.SQRT1_2]
86
+ ];
87
+ function createSkiaFrameRenderer(Skia2) {
88
+ const defaultPaint = Skia2.Paint();
89
+ let tintPaint = null;
90
+ let flashPaint = null;
91
+ let grayscalePaint = null;
92
+ let outlinePaint = null;
93
+ let customPaint = null;
94
+ let waterPaint = null;
95
+ let waterRuntimeEffect = null;
96
+ let fogPaint = null;
97
+ let fogRuntimeEffect = null;
98
+ let firePaint = null;
99
+ let fireRuntimeEffect = null;
100
+ let roofsCityPaint = null;
101
+ let roofsCityEffect = null;
102
+ let forestCanopyPaint = null;
103
+ let forestCanopyEffect = null;
104
+ let riverWavePaint = null;
105
+ let riverWaveEffect = null;
106
+ let moonCraterPaint = null;
107
+ let moonCraterEffect = null;
108
+ let caveInteriorPaint = null;
109
+ let caveInteriorEffect = null;
110
+ let mountainHillsPaint = null;
111
+ let mountainHillsEffect = null;
112
+ const roofsCityUniforms = new Array(10).fill(0);
113
+ const forestCanopyUniforms = new Array(10).fill(0);
114
+ const riverWaveUniforms = new Array(10).fill(0);
115
+ const moonCraterUniforms = new Array(10).fill(0);
116
+ const caveInteriorUniforms = new Array(10).fill(0);
117
+ const mountainHillsUniforms = new Array(10).fill(0);
118
+ const recorder = Skia2.PictureRecorder();
119
+ const recordingBounds = Skia2.XYWHRect(0, 0, 0, 0);
120
+ const srcRects = [];
121
+ const xforms = [];
122
+ const stretchSrcRects = [];
123
+ const stretchDstRects = [];
124
+ let stretchPaint = null;
125
+ const clearColor = new Float32Array(4);
126
+ const tintColor = new Float32Array(4);
127
+ const flashColor = new Float32Array(4);
128
+ const outlineColor = new Float32Array(4);
129
+ const grayMatrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
130
+ const customUniforms = [];
131
+ const waterUniforms = new Array(11).fill(0);
132
+ const fogUniforms = new Array(9).fill(0);
133
+ const fireUniforms = new Array(11).fill(0);
134
+ let currentFrameTime = 0;
135
+ let current = null;
136
+ let _boundRuntime = null;
137
+ let _boundChain = null;
138
+ const _loggedOnce = /* @__PURE__ */ new Set();
139
+ function logOnce(msg) {
140
+ if (_loggedOnce.has(msg)) return;
141
+ _loggedOnce.add(msg);
142
+ console.warn(`[postfx] ${msg}`);
143
+ }
144
+ const canvas = {
145
+ save: () => current?.save() ?? 0,
146
+ restore: () => {
147
+ current?.restore();
148
+ },
149
+ translate: (x, y) => {
150
+ current?.translate(x, y);
151
+ },
152
+ scale: (sx, sy) => {
153
+ current?.scale(sx, sy);
154
+ },
155
+ rotate: (radians, cx, cy) => {
156
+ current?.rotate(radians, cx, cy);
157
+ },
158
+ clear: (argb) => {
159
+ if (current === null) return;
160
+ clearColor[0] = (argb >>> 16 & 255) / 255;
161
+ clearColor[1] = (argb >>> 8 & 255) / 255;
162
+ clearColor[2] = (argb & 255) / 255;
163
+ clearColor[3] = (argb >>> 24 & 255) / 255;
164
+ current.clear(clearColor);
165
+ }
166
+ };
167
+ function ensurePoolCapacity(n) {
168
+ while (srcRects.length < n) {
169
+ srcRects.push(Skia2.XYWHRect(0, 0, 0, 0));
170
+ xforms.push(Skia2.RSXform(1, 0, 0, 0));
171
+ }
172
+ }
173
+ function ensureStretchPoolCapacity(n) {
174
+ while (stretchSrcRects.length < n) {
175
+ stretchSrcRects.push(Skia2.XYWHRect(0, 0, 0, 0));
176
+ stretchDstRects.push(Skia2.XYWHRect(0, 0, 0, 0));
177
+ }
178
+ }
179
+ function fillSrcRects(commands, n) {
180
+ for (let i = 0; i < n; i++) {
181
+ const cmd = commands[i];
182
+ srcRects[i]?.setXYWH(cmd.srcX, cmd.srcY, cmd.srcW, cmd.srcH);
183
+ }
184
+ }
185
+ function fillXforms(commands, n, dx, dy) {
186
+ for (let i = 0; i < n; i++) {
187
+ const cmd = commands[i];
188
+ const scale = cmd.srcW === 0 ? 1 : cmd.dstW / cmd.srcW;
189
+ if (cmd.rotation === 0) {
190
+ xforms[i]?.set(scale, 0, cmd.dstX + dx, cmd.dstY + dy);
191
+ } else {
192
+ const c = Math.cos(cmd.rotation);
193
+ const s = Math.sin(cmd.rotation);
194
+ const scos = scale * c;
195
+ const ssin = scale * s;
196
+ const px = cmd.dstX + cmd.anchorX * cmd.dstW + dx;
197
+ const py = cmd.dstY + cmd.anchorY * cmd.dstH + dy;
198
+ const axSrc = cmd.anchorX * cmd.srcW;
199
+ const aySrc = cmd.anchorY * cmd.srcH;
200
+ xforms[i]?.set(
201
+ scos,
202
+ ssin,
203
+ px - scos * axSrc + ssin * aySrc,
204
+ py - ssin * axSrc - scos * aySrc
205
+ );
206
+ }
207
+ }
208
+ }
209
+ function applyTint(effect) {
210
+ if (tintPaint === null) tintPaint = Skia2.Paint();
211
+ writeColor(tintColor, effect.color, effect.amount);
212
+ tintPaint.setColorFilter(Skia2.ColorFilter.MakeBlend(tintColor, BLEND_SRC_OVER));
213
+ return tintPaint;
214
+ }
215
+ function applyFlash(effect) {
216
+ if (flashPaint === null) flashPaint = Skia2.Paint();
217
+ writeColor(flashColor, effect.color, (0, import_render.flashIntensity)(effect));
218
+ flashPaint.setColorFilter(Skia2.ColorFilter.MakeBlend(flashColor, BLEND_SRC_OVER));
219
+ return flashPaint;
220
+ }
221
+ function applyGrayscale(effect) {
222
+ if (grayscalePaint === null) grayscalePaint = Skia2.Paint();
223
+ writeGrayscaleMatrix(grayMatrix, effect.amount);
224
+ grayscalePaint.setColorFilter(Skia2.ColorFilter.MakeMatrix(grayMatrix));
225
+ return grayscalePaint;
226
+ }
227
+ function applyOutlinePaint(effect) {
228
+ if (outlinePaint === null) outlinePaint = Skia2.Paint();
229
+ writeColor(outlineColor, effect.color, 1);
230
+ outlinePaint.setColorFilter(Skia2.ColorFilter.MakeBlend(outlineColor, BLEND_SRC_IN));
231
+ return outlinePaint;
232
+ }
233
+ function applyCustom(effect) {
234
+ if (customPaint === null) customPaint = Skia2.Paint();
235
+ const shader = effect.shader;
236
+ const floatCount = shader.getUniformFloatCount();
237
+ while (customUniforms.length < floatCount) customUniforms.push(0);
238
+ customUniforms.length = floatCount;
239
+ fillCustomUniforms(effect, shader, customUniforms);
240
+ customPaint.setShader(shader.makeShader(customUniforms));
241
+ return customPaint;
242
+ }
243
+ function applyWater(effect, time) {
244
+ if (Skia2.RuntimeEffect === void 0) return defaultPaint;
245
+ if (waterRuntimeEffect === null) {
246
+ const compiled = Skia2.RuntimeEffect.Make(import_render.WATER_SKSL);
247
+ if (compiled === null) return defaultPaint;
248
+ waterRuntimeEffect = compiled;
249
+ }
250
+ if (waterPaint === null) waterPaint = Skia2.Paint();
251
+ waterUniforms[0] = 0;
252
+ waterUniforms[1] = 0;
253
+ waterUniforms[2] = effect.color.r;
254
+ waterUniforms[3] = effect.color.g;
255
+ waterUniforms[4] = effect.color.b;
256
+ waterUniforms[5] = effect.foamColor.r;
257
+ waterUniforms[6] = effect.foamColor.g;
258
+ waterUniforms[7] = effect.foamColor.b;
259
+ waterUniforms[8] = effect.waveSpeed;
260
+ waterUniforms[9] = effect.waveAmplitude;
261
+ waterUniforms[10] = time;
262
+ waterPaint.setShader(waterRuntimeEffect.makeShader(waterUniforms));
263
+ return waterPaint;
264
+ }
265
+ function applyFog(effect, time) {
266
+ if (Skia2.RuntimeEffect === void 0) return defaultPaint;
267
+ if (fogRuntimeEffect === null) {
268
+ const compiled = Skia2.RuntimeEffect.Make(import_render.FOG_SKSL);
269
+ if (compiled === null) return defaultPaint;
270
+ fogRuntimeEffect = compiled;
271
+ }
272
+ if (fogPaint === null) fogPaint = Skia2.Paint();
273
+ fogUniforms[0] = 0;
274
+ fogUniforms[1] = 0;
275
+ fogUniforms[2] = effect.color.r;
276
+ fogUniforms[3] = effect.color.g;
277
+ fogUniforms[4] = effect.color.b;
278
+ fogUniforms[5] = effect.density;
279
+ fogUniforms[6] = effect.speed;
280
+ fogUniforms[7] = effect.scale;
281
+ fogUniforms[8] = time;
282
+ fogPaint.setShader(fogRuntimeEffect.makeShader(fogUniforms));
283
+ return fogPaint;
284
+ }
285
+ function applyFire(effect, time) {
286
+ if (Skia2.RuntimeEffect === void 0) return defaultPaint;
287
+ if (fireRuntimeEffect === null) {
288
+ const compiled = Skia2.RuntimeEffect.Make(import_render.FIRE_SKSL);
289
+ if (compiled === null) return defaultPaint;
290
+ fireRuntimeEffect = compiled;
291
+ }
292
+ if (firePaint === null) firePaint = Skia2.Paint();
293
+ fireUniforms[0] = 0;
294
+ fireUniforms[1] = 0;
295
+ fireUniforms[2] = effect.color.r;
296
+ fireUniforms[3] = effect.color.g;
297
+ fireUniforms[4] = effect.color.b;
298
+ fireUniforms[5] = effect.tipColor.r;
299
+ fireUniforms[6] = effect.tipColor.g;
300
+ fireUniforms[7] = effect.tipColor.b;
301
+ fireUniforms[8] = effect.speed;
302
+ fireUniforms[9] = effect.intensity;
303
+ fireUniforms[10] = time;
304
+ firePaint.setShader(fireRuntimeEffect.makeShader(fireUniforms));
305
+ return firePaint;
306
+ }
307
+ function applyRoofsCity(effect) {
308
+ if (Skia2.RuntimeEffect === void 0) return defaultPaint;
309
+ if (roofsCityEffect === null) {
310
+ const compiled = Skia2.RuntimeEffect.Make(import_render.ROOFS_CITY_SKSL);
311
+ if (compiled === null) return defaultPaint;
312
+ roofsCityEffect = compiled;
313
+ }
314
+ if (roofsCityPaint === null) roofsCityPaint = Skia2.Paint();
315
+ roofsCityUniforms[0] = effect.resolutionW;
316
+ roofsCityUniforms[1] = effect.resolutionH;
317
+ roofsCityUniforms[2] = effect.skyColor.r;
318
+ roofsCityUniforms[3] = effect.skyColor.g;
319
+ roofsCityUniforms[4] = effect.skyColor.b;
320
+ roofsCityUniforms[5] = effect.roofColor.r;
321
+ roofsCityUniforms[6] = effect.roofColor.g;
322
+ roofsCityUniforms[7] = effect.roofColor.b;
323
+ roofsCityUniforms[8] = effect.scrollOffsetY;
324
+ roofsCityUniforms[9] = effect.density;
325
+ roofsCityPaint.setShader(roofsCityEffect.makeShader(roofsCityUniforms));
326
+ return roofsCityPaint;
327
+ }
328
+ function applyForestCanopy(effect) {
329
+ if (Skia2.RuntimeEffect === void 0) return defaultPaint;
330
+ if (forestCanopyEffect === null) {
331
+ const compiled = Skia2.RuntimeEffect.Make(import_render.FOREST_CANOPY_SKSL);
332
+ if (compiled === null) return defaultPaint;
333
+ forestCanopyEffect = compiled;
334
+ }
335
+ if (forestCanopyPaint === null) forestCanopyPaint = Skia2.Paint();
336
+ forestCanopyUniforms[0] = effect.resolutionW;
337
+ forestCanopyUniforms[1] = effect.resolutionH;
338
+ forestCanopyUniforms[2] = effect.skyColor.r;
339
+ forestCanopyUniforms[3] = effect.skyColor.g;
340
+ forestCanopyUniforms[4] = effect.skyColor.b;
341
+ forestCanopyUniforms[5] = effect.leafColor.r;
342
+ forestCanopyUniforms[6] = effect.leafColor.g;
343
+ forestCanopyUniforms[7] = effect.leafColor.b;
344
+ forestCanopyUniforms[8] = effect.scrollOffsetY;
345
+ forestCanopyUniforms[9] = effect.density;
346
+ forestCanopyPaint.setShader(forestCanopyEffect.makeShader(forestCanopyUniforms));
347
+ return forestCanopyPaint;
348
+ }
349
+ function applyRiverWave(effect) {
350
+ if (Skia2.RuntimeEffect === void 0) return defaultPaint;
351
+ if (riverWaveEffect === null) {
352
+ const compiled = Skia2.RuntimeEffect.Make(import_render.RIVER_WAVE_SKSL);
353
+ if (compiled === null) return defaultPaint;
354
+ riverWaveEffect = compiled;
355
+ }
356
+ if (riverWavePaint === null) riverWavePaint = Skia2.Paint();
357
+ riverWaveUniforms[0] = effect.resolutionW;
358
+ riverWaveUniforms[1] = effect.resolutionH;
359
+ riverWaveUniforms[2] = effect.waterColor.r;
360
+ riverWaveUniforms[3] = effect.waterColor.g;
361
+ riverWaveUniforms[4] = effect.waterColor.b;
362
+ riverWaveUniforms[5] = effect.foamColor.r;
363
+ riverWaveUniforms[6] = effect.foamColor.g;
364
+ riverWaveUniforms[7] = effect.foamColor.b;
365
+ riverWaveUniforms[8] = effect.scrollOffsetY;
366
+ riverWaveUniforms[9] = effect.waveScale;
367
+ riverWavePaint.setShader(riverWaveEffect.makeShader(riverWaveUniforms));
368
+ return riverWavePaint;
369
+ }
370
+ function applyMoonCrater(effect) {
371
+ if (Skia2.RuntimeEffect === void 0) return defaultPaint;
372
+ if (moonCraterEffect === null) {
373
+ const compiled = Skia2.RuntimeEffect.Make(import_render.MOON_CRATER_SKSL);
374
+ if (compiled === null) return defaultPaint;
375
+ moonCraterEffect = compiled;
376
+ }
377
+ if (moonCraterPaint === null) moonCraterPaint = Skia2.Paint();
378
+ moonCraterUniforms[0] = effect.resolutionW;
379
+ moonCraterUniforms[1] = effect.resolutionH;
380
+ moonCraterUniforms[2] = effect.moonColor.r;
381
+ moonCraterUniforms[3] = effect.moonColor.g;
382
+ moonCraterUniforms[4] = effect.moonColor.b;
383
+ moonCraterUniforms[5] = effect.craterColor.r;
384
+ moonCraterUniforms[6] = effect.craterColor.g;
385
+ moonCraterUniforms[7] = effect.craterColor.b;
386
+ moonCraterUniforms[8] = effect.scrollOffsetY;
387
+ moonCraterUniforms[9] = effect.craterCount;
388
+ moonCraterPaint.setShader(moonCraterEffect.makeShader(moonCraterUniforms));
389
+ return moonCraterPaint;
390
+ }
391
+ function applyCaveInterior(effect) {
392
+ if (Skia2.RuntimeEffect === void 0) return defaultPaint;
393
+ if (caveInteriorEffect === null) {
394
+ const compiled = Skia2.RuntimeEffect.Make(import_render.CAVE_INTERIOR_SKSL);
395
+ if (compiled === null) return defaultPaint;
396
+ caveInteriorEffect = compiled;
397
+ }
398
+ if (caveInteriorPaint === null) caveInteriorPaint = Skia2.Paint();
399
+ caveInteriorUniforms[0] = effect.resolutionW;
400
+ caveInteriorUniforms[1] = effect.resolutionH;
401
+ caveInteriorUniforms[2] = effect.caveColor.r;
402
+ caveInteriorUniforms[3] = effect.caveColor.g;
403
+ caveInteriorUniforms[4] = effect.caveColor.b;
404
+ caveInteriorUniforms[5] = effect.glowColor.r;
405
+ caveInteriorUniforms[6] = effect.glowColor.g;
406
+ caveInteriorUniforms[7] = effect.glowColor.b;
407
+ caveInteriorUniforms[8] = effect.scrollOffsetY;
408
+ caveInteriorUniforms[9] = effect.stalactiteCount;
409
+ caveInteriorPaint.setShader(caveInteriorEffect.makeShader(caveInteriorUniforms));
410
+ return caveInteriorPaint;
411
+ }
412
+ function applyMountainHills(effect) {
413
+ if (Skia2.RuntimeEffect === void 0) return defaultPaint;
414
+ if (mountainHillsEffect === null) {
415
+ const compiled = Skia2.RuntimeEffect.Make(import_render.MOUNTAIN_HILLS_SKSL);
416
+ if (compiled === null) return defaultPaint;
417
+ mountainHillsEffect = compiled;
418
+ }
419
+ if (mountainHillsPaint === null) mountainHillsPaint = Skia2.Paint();
420
+ mountainHillsUniforms[0] = effect.resolutionW;
421
+ mountainHillsUniforms[1] = effect.resolutionH;
422
+ mountainHillsUniforms[2] = effect.skyColor.r;
423
+ mountainHillsUniforms[3] = effect.skyColor.g;
424
+ mountainHillsUniforms[4] = effect.skyColor.b;
425
+ mountainHillsUniforms[5] = effect.hillColor.r;
426
+ mountainHillsUniforms[6] = effect.hillColor.g;
427
+ mountainHillsUniforms[7] = effect.hillColor.b;
428
+ mountainHillsUniforms[8] = effect.scrollOffsetY;
429
+ mountainHillsUniforms[9] = effect.ridgeScale;
430
+ mountainHillsPaint.setShader(mountainHillsEffect.makeShader(mountainHillsUniforms));
431
+ return mountainHillsPaint;
432
+ }
433
+ function drawOutlined(canvas2, image, commands, n, effect, alpha) {
434
+ const paint = applyOutlinePaint(effect);
435
+ paint.setAlphaf(alpha);
436
+ const srcs = srcRects.length === n ? srcRects : srcRects.slice(0, n);
437
+ for (let k = 0; k < OUTLINE_OFFSETS.length; k++) {
438
+ const offset = OUTLINE_OFFSETS[k];
439
+ fillXforms(commands, n, offset[0] * effect.width, offset[1] * effect.width);
440
+ const dsts = xforms.length === n ? xforms : xforms.slice(0, n);
441
+ canvas2.drawAtlas(image, srcs, dsts, paint);
442
+ }
443
+ paint.setAlphaf(1);
444
+ defaultPaint.setAlphaf(alpha);
445
+ fillXforms(commands, n, 0, 0);
446
+ const mainDsts = xforms.length === n ? xforms : xforms.slice(0, n);
447
+ canvas2.drawAtlas(image, srcs, mainDsts, defaultPaint);
448
+ defaultPaint.setAlphaf(1);
449
+ }
450
+ function resolveEffectPaint(effect) {
451
+ switch (effect.type) {
452
+ case "tint":
453
+ return applyTint(effect);
454
+ case "flash":
455
+ return applyFlash(effect);
456
+ case "grayscale":
457
+ return applyGrayscale(effect);
458
+ case "custom":
459
+ return applyCustom(effect);
460
+ case "water":
461
+ return applyWater(effect, currentFrameTime);
462
+ case "fog":
463
+ return applyFog(effect, currentFrameTime);
464
+ case "fire":
465
+ return applyFire(effect, currentFrameTime);
466
+ case "outline":
467
+ return applyOutlinePaint(effect);
468
+ case "roofs-city":
469
+ return applyRoofsCity(effect);
470
+ case "forest-canopy":
471
+ return applyForestCanopy(effect);
472
+ case "river-wave":
473
+ return applyRiverWave(effect);
474
+ case "moon-crater":
475
+ return applyMoonCrater(effect);
476
+ case "cave-interior":
477
+ return applyCaveInterior(effect);
478
+ case "mountain-hills":
479
+ return applyMountainHills(effect);
480
+ }
481
+ }
482
+ return {
483
+ canvas,
484
+ beginFrame(viewportWidth, viewportHeight, time = 0, pixelDensity = 1) {
485
+ if (viewportWidth === 0 || viewportHeight === 0) return;
486
+ _boundRuntime = null;
487
+ _boundChain = null;
488
+ currentFrameTime = time;
489
+ const pd = pixelDensity;
490
+ recordingBounds.setXYWH(0, 0, viewportWidth * pd, viewportHeight * pd);
491
+ current = recorder.beginRecording(recordingBounds);
492
+ if (pd !== 1) current.scale(pd, pd);
493
+ },
494
+ drawAtlas(image, commands) {
495
+ if (current === null) return;
496
+ const n = commands.length;
497
+ if (n === 0) return;
498
+ const effect = commands[0]?.effect;
499
+ const alpha = commands[0]?.alpha ?? 1;
500
+ const skImage = image;
501
+ if (effect?.type === "roofs-city" || effect?.type === "forest-canopy" || effect?.type === "river-wave" || effect?.type === "moon-crater" || effect?.type === "cave-interior" || effect?.type === "mountain-hills") {
502
+ const paint2 = resolveEffectPaint(effect);
503
+ paint2.setAlphaf(alpha);
504
+ for (let i = 0; i < n; i++) {
505
+ const cmd = commands[i];
506
+ const rect = Skia2.XYWHRect(cmd.dstX, cmd.dstY, cmd.dstW, cmd.dstH);
507
+ current.drawRect(rect, paint2);
508
+ }
509
+ paint2.setAlphaf(1);
510
+ return;
511
+ }
512
+ if (commands[0]?.stretch) {
513
+ if (stretchPaint === null) stretchPaint = Skia2.Paint();
514
+ ensureStretchPoolCapacity(n);
515
+ stretchPaint.setAlphaf(alpha);
516
+ for (let i = 0; i < n; i++) {
517
+ const cmd = commands[i];
518
+ const srcR = stretchSrcRects[i];
519
+ const dstR = stretchDstRects[i];
520
+ srcR.setXYWH(cmd.srcX, cmd.srcY, cmd.srcW, cmd.srcH);
521
+ dstR.setXYWH(cmd.dstX, cmd.dstY, cmd.dstW, cmd.dstH);
522
+ current.drawImageRect(skImage, srcR, dstR, stretchPaint);
523
+ }
524
+ stretchPaint.setAlphaf(1);
525
+ return;
526
+ }
527
+ ensurePoolCapacity(n);
528
+ fillSrcRects(commands, n);
529
+ if (effect?.type === "outline") {
530
+ drawOutlined(current, skImage, commands, n, effect, alpha);
531
+ return;
532
+ }
533
+ fillXforms(commands, n, 0, 0);
534
+ const srcs = srcRects.length === n ? srcRects : srcRects.slice(0, n);
535
+ const dsts = xforms.length === n ? xforms : xforms.slice(0, n);
536
+ const paint = effect === void 0 ? defaultPaint : resolveEffectPaint(effect);
537
+ paint.setAlphaf(alpha);
538
+ current.drawAtlas(skImage, srcs, dsts, paint);
539
+ paint.setAlphaf(1);
540
+ },
541
+ setPostFxBinding(runtime, chain) {
542
+ _boundRuntime = runtime;
543
+ _boundChain = chain;
544
+ },
545
+ buildPostFxPasses(runtime, chain, width, height) {
546
+ const rt = runtime ?? _boundRuntime;
547
+ const ch = chain ?? _boundChain;
548
+ if (rt === null || !rt.supported) return [];
549
+ if (rt.buildPass === void 0) {
550
+ logOnce("buildPostFxPasses: runtime.supported but buildPass absent \u2014 no passes");
551
+ return [];
552
+ }
553
+ if (ch === null) return [];
554
+ const passes = rt.buildPass(ch, width, height);
555
+ if (passes.length === 0) return [];
556
+ const out = [];
557
+ for (const pass of passes) {
558
+ const shader = pass.shader;
559
+ const uniformCount = typeof shader.getUniformCount === "function" ? shader.getUniformCount() : 0;
560
+ const uniforms = {};
561
+ for (let i = 0; i < uniformCount; i++) {
562
+ const name = typeof shader.getUniformName === "function" ? shader.getUniformName(i) : String(i);
563
+ const info = typeof shader.getUniform === "function" ? shader.getUniform(i) : { columns: 1, rows: 1, slot: i };
564
+ const size = info.columns * info.rows;
565
+ if (size === 1) {
566
+ uniforms[name] = pass.uniforms[info.slot] ?? 0;
567
+ } else {
568
+ const vec = [];
569
+ for (let k = 0; k < size; k++) {
570
+ vec.push(pass.uniforms[info.slot + k] ?? 0);
571
+ }
572
+ uniforms[name] = vec;
573
+ }
574
+ }
575
+ out.push({
576
+ id: pass.id,
577
+ source: shader,
578
+ uniforms,
579
+ children: pass.children
580
+ });
581
+ }
582
+ return out;
583
+ },
584
+ endFrame() {
585
+ if (current === null) return null;
586
+ current = null;
587
+ return recorder.finishRecordingAsPicture();
588
+ }
589
+ };
590
+ }
591
+ function renderShapesToImage(skia, opts) {
592
+ if (skia.Surface === void 0) return null;
593
+ const surface = skia.Surface.Make(opts.width, opts.height);
594
+ if (surface === null) return null;
595
+ const scratch = new Float32Array(4);
596
+ const canvas = surface.getCanvas();
597
+ unpackArgb(scratch, opts.clearColor);
598
+ canvas.clear(scratch);
599
+ const paint = skia.Paint();
600
+ for (const shape of opts.shapes) {
601
+ unpackArgb(scratch, shape.color);
602
+ paint.setColor(scratch);
603
+ const rect = skia.XYWHRect(shape.x, shape.y, shape.w, shape.h);
604
+ canvas.drawRect(rect, paint);
605
+ }
606
+ return detachSnapshot(surface);
607
+ }
608
+ function unpackArgb(out, argb) {
609
+ out[0] = (argb >>> 16 & 255) / 255;
610
+ out[1] = (argb >>> 8 & 255) / 255;
611
+ out[2] = (argb & 255) / 255;
612
+ out[3] = (argb >>> 24 & 255) / 255;
613
+ }
614
+ function writeColor(out, color, alphaMul) {
615
+ out[0] = color.r;
616
+ out[1] = color.g;
617
+ out[2] = color.b;
618
+ out[3] = color.a * alphaMul;
619
+ }
620
+ function writeGrayscaleMatrix(out, amount) {
621
+ const inv = 1 - amount;
622
+ const lr = 0.299 * amount;
623
+ const lg = 0.587 * amount;
624
+ const lb = 0.114 * amount;
625
+ out[0] = inv + lr;
626
+ out[1] = lg;
627
+ out[2] = lb;
628
+ out[3] = 0;
629
+ out[4] = 0;
630
+ out[5] = lr;
631
+ out[6] = inv + lg;
632
+ out[7] = lb;
633
+ out[8] = 0;
634
+ out[9] = 0;
635
+ out[10] = lr;
636
+ out[11] = lg;
637
+ out[12] = inv + lb;
638
+ out[13] = 0;
639
+ out[14] = 0;
640
+ out[15] = 0;
641
+ out[16] = 0;
642
+ out[17] = 0;
643
+ out[18] = 1;
644
+ out[19] = 0;
645
+ }
646
+ function fillCustomUniforms(effect, shader, out) {
647
+ const count = shader.getUniformCount();
648
+ for (let i = 0; i < out.length; i++) out[i] = 0;
649
+ for (let i = 0; i < count; i++) {
650
+ const info = shader.getUniform(i);
651
+ const name = shader.getUniformName(i);
652
+ const value = effect.uniforms[name];
653
+ const size = info.columns * info.rows;
654
+ if (value === void 0) continue;
655
+ if (typeof value === "number") {
656
+ out[info.slot] = value;
657
+ continue;
658
+ }
659
+ for (let k = 0; k < size; k++) {
660
+ out[info.slot + k] = value[k] ?? 0;
661
+ }
662
+ }
663
+ }
664
+
665
+ // src/game-view.tsx
666
+ var import_jsx_runtime = require("react/jsx-runtime");
667
+ function GameView({
668
+ config,
669
+ onReady,
670
+ style,
671
+ children,
672
+ safeArea
673
+ }) {
674
+ const insets = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
675
+ const resolvedSafeArea = safeArea ?? insets;
676
+ const canvasRef = (0, import_react_native_skia.useCanvasRef)();
677
+ const [picture, setPicture] = (0, import_react3.useState)(null);
678
+ const [passes, setPasses] = (0, import_react3.useState)([]);
679
+ const [viewportSize, setViewportSize] = (0, import_react3.useState)({ w: 0, h: 0 });
680
+ const pd = import_react_native.PixelRatio.get();
681
+ const sceneSize = (0, import_react3.useMemo)(
682
+ () => ({ width: viewportSize.w * pd, height: viewportSize.h * pd }),
683
+ [viewportSize.w, viewportSize.h, pd]
684
+ );
685
+ const sceneTexture = (0, import_react_native_skia.usePictureAsTexture)(picture, sceneSize);
686
+ const ctx = (0, import_react3.useMemo)(() => {
687
+ const loop = new import_core.GameLoop({
688
+ fixedDt: config?.fixedDt,
689
+ maxDt: config?.maxDt
690
+ });
691
+ const world = new import_ecs.World();
692
+ const camera = new import_render2.Camera2D();
693
+ const input = new import_input.InputManager();
694
+ const audio = new import_audio.AudioManager();
695
+ const noop = () => Promise.resolve(null);
696
+ const assets = new import_assets.AssetManager(config?.assetLoader ?? noop);
697
+ const scenes = new import_scene.SceneManager();
698
+ const renderer = new import_render2.Renderer();
699
+ const batch = new import_render2.SpriteBatch();
700
+ return { world, camera, input, audio, assets, scenes, loop, renderer, batch };
701
+ }, []);
702
+ (0, import_react3.useEffect)(() => {
703
+ const bridge = createSkiaFrameRenderer(import_react_native_skia.Skia);
704
+ ctx.renderer.setCanvas(bridge.canvas);
705
+ const clearColor = config?.clearColor ?? 4278190080;
706
+ const onRenderBackground = config?.onRenderBackground;
707
+ const onRenderPostFx = config?.onRenderPostFx;
708
+ const spriteQuery = ctx.world.query(import_ecs.Position, import_render2.Sprite);
709
+ const renderSystem = (0, import_render2.createRenderSystem)(ctx.world, spriteQuery, import_ecs.Position, import_render2.Sprite, ctx.batch);
710
+ const unsubscribeLate = ctx.loop.onLateUpdate.add((dt) => {
711
+ ctx.camera.update(dt);
712
+ ctx.input.update();
713
+ });
714
+ const unsubscribePre = ctx.loop.onPreRender.add(() => {
715
+ const w = ctx.camera.viewportWidth;
716
+ const h = ctx.camera.viewportHeight;
717
+ bridge.beginFrame(w, h, 0, pd);
718
+ ctx.renderer.begin(clearColor);
719
+ ctx.renderer.applyCamera(
720
+ ctx.camera.effectiveX,
721
+ ctx.camera.effectiveY,
722
+ ctx.camera.zoom,
723
+ ctx.camera.rotation,
724
+ w,
725
+ h
726
+ );
727
+ if (onRenderBackground) onRenderBackground(ctx, ctx.renderer.canvas);
728
+ renderSystem();
729
+ ctx.batch.flush(bridge.drawAtlas, ctx.renderer);
730
+ if (onRenderPostFx) onRenderPostFx(ctx, ctx.renderer.canvas, bridge);
731
+ ctx.renderer.end();
732
+ const pic = bridge.endFrame();
733
+ if (pic !== null) setPicture(pic);
734
+ const built = bridge.buildPostFxPasses(null, null, w, h);
735
+ setPasses(built);
736
+ canvasRef.current?.redraw();
737
+ });
738
+ onReady?.(ctx);
739
+ ctx.loop.start();
740
+ return () => {
741
+ unsubscribeLate();
742
+ unsubscribePre();
743
+ ctx.loop.stop();
744
+ };
745
+ }, []);
746
+ const handleLayout = (event) => {
747
+ const { width, height } = event.nativeEvent.layout;
748
+ ctx.camera.setViewport(width, height);
749
+ setViewportSize({ w: width, h: height });
750
+ };
751
+ const onGrant = (e) => {
752
+ ctx.input.onPointerDown(0, e.nativeEvent.locationX, e.nativeEvent.locationY);
753
+ };
754
+ const onMove = (e) => {
755
+ ctx.input.onPointerMove(0, e.nativeEvent.locationX, e.nativeEvent.locationY);
756
+ };
757
+ const onRelease = (e) => {
758
+ ctx.input.onPointerUp(0, e.nativeEvent.locationX, e.nativeEvent.locationY);
759
+ };
760
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SafeAreaContext.Provider, { value: resolvedSafeArea, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GameContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
761
+ import_react_native.View,
762
+ {
763
+ style: [styles.container, style],
764
+ onLayout: handleLayout,
765
+ onStartShouldSetResponder: returnTrue,
766
+ onResponderGrant: onGrant,
767
+ onResponderMove: onMove,
768
+ onResponderRelease: onRelease,
769
+ onResponderTerminate: onRelease,
770
+ children: [
771
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
772
+ import_react_native_skia.Canvas,
773
+ {
774
+ ref: canvasRef,
775
+ style: import_react_native.StyleSheet.absoluteFill,
776
+ pointerEvents: "none",
777
+ opaque: config?.opaque ?? false,
778
+ children: viewportSize.w === 0 || sceneTexture == null ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
779
+ import_react_native_skia.Image,
780
+ {
781
+ image: sceneTexture,
782
+ x: 0,
783
+ y: 0,
784
+ width: viewportSize.w,
785
+ height: viewportSize.h,
786
+ fit: "cover",
787
+ children: passes.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native_skia.RuntimeShader, { source: p.source, uniforms: p.uniforms }, p.id))
788
+ }
789
+ )
790
+ }
791
+ ),
792
+ children
793
+ ]
794
+ }
795
+ ) }) });
796
+ }
797
+ function returnTrue() {
798
+ return true;
799
+ }
800
+ var styles = import_react_native.StyleSheet.create({
801
+ container: { flex: 1 }
802
+ });
803
+
804
+ // src/hooks.ts
805
+ var import_react4 = require("react");
806
+ function useGame() {
807
+ const ctx = (0, import_react4.useContext)(GameContext);
808
+ if (!ctx) {
809
+ throw new Error("useGame must be used inside a <GameView>");
810
+ }
811
+ return ctx;
812
+ }
813
+ function useEntity(query) {
814
+ const [entities, setEntities] = (0, import_react4.useState)(() => Array.from(query));
815
+ (0, import_react4.useEffect)(() => {
816
+ const refresh = () => setEntities(Array.from(query));
817
+ const unsubAdd = query.onEntityAdded.add(refresh);
818
+ const unsubRemove = query.onEntityRemoved.add(refresh);
819
+ refresh();
820
+ return () => {
821
+ unsubAdd();
822
+ unsubRemove();
823
+ };
824
+ }, [query]);
825
+ return entities;
826
+ }
827
+ function useGameLoop(callback) {
828
+ const { loop } = useGame();
829
+ const callbackRef = (0, import_react4.useRef)(callback);
830
+ callbackRef.current = callback;
831
+ const stable = (0, import_react4.useCallback)((dt) => {
832
+ callbackRef.current(dt);
833
+ }, []);
834
+ (0, import_react4.useEffect)(() => {
835
+ const unsub = loop.onUpdate.add(stable);
836
+ return () => {
837
+ unsub();
838
+ };
839
+ }, [loop, stable]);
840
+ }
841
+
842
+ // src/virtual-joystick.tsx
843
+ var import_input2 = require("@flare-engine/input");
844
+ var import_react5 = require("react");
845
+ var import_react_native2 = require("react-native");
846
+ var import_jsx_runtime2 = require("react/jsx-runtime");
847
+ function VirtualJoystick({
848
+ config,
849
+ onStateChange,
850
+ style,
851
+ base,
852
+ thumb
853
+ }) {
854
+ const stateRef = (0, import_react5.useRef)((0, import_input2.createJoystickState)());
855
+ const sizeRef = (0, import_react5.useRef)({ w: 0, h: 0 });
856
+ const [knob, setKnob] = (0, import_react5.useState)({ x: 0, y: 0 });
857
+ const handleLayout = (0, import_react5.useCallback)(
858
+ (e) => {
859
+ sizeRef.current = { w: e.nativeEvent.layout.width, h: e.nativeEvent.layout.height };
860
+ },
861
+ []
862
+ );
863
+ const handleTouch = (0, import_react5.useCallback)(
864
+ (e) => {
865
+ const { locationX, locationY } = e.nativeEvent;
866
+ const { w, h } = sizeRef.current;
867
+ (0, import_input2.updateJoystick)(stateRef.current, w / 2, h / 2, locationX, locationY, config);
868
+ onStateChange?.(stateRef.current);
869
+ const { x, y } = stateRef.current.offset;
870
+ setKnob((prev) => prev.x === x && prev.y === y ? prev : { x, y });
871
+ },
872
+ [config, onStateChange]
873
+ );
874
+ const handleRelease = (0, import_react5.useCallback)(() => {
875
+ (0, import_input2.releaseJoystick)(stateRef.current);
876
+ onStateChange?.(stateRef.current);
877
+ setKnob((prev) => prev.x === 0 && prev.y === 0 ? prev : { x: 0, y: 0 });
878
+ }, [onStateChange]);
879
+ const maxRadius = config?.maxRadius ?? 50;
880
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
881
+ import_react_native2.View,
882
+ {
883
+ style: [
884
+ styles2.center,
885
+ ...base ? [] : [styles2.baseBg],
886
+ {
887
+ width: maxRadius * 2,
888
+ height: maxRadius * 2,
889
+ borderRadius: maxRadius
890
+ },
891
+ style
892
+ ],
893
+ onLayout: handleLayout,
894
+ onStartShouldSetResponder: returnTrue2,
895
+ onMoveShouldSetResponder: returnTrue2,
896
+ onResponderGrant: handleTouch,
897
+ onResponderMove: handleTouch,
898
+ onResponderRelease: handleRelease,
899
+ onResponderTerminate: handleRelease,
900
+ children: [
901
+ base ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.View, { style: import_react_native2.StyleSheet.absoluteFill, pointerEvents: "none", children: base }) : null,
902
+ thumb ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
903
+ import_react_native2.View,
904
+ {
905
+ style: { transform: [{ translateX: knob.x }, { translateY: knob.y }] },
906
+ pointerEvents: "none",
907
+ children: thumb
908
+ }
909
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
910
+ import_react_native2.View,
911
+ {
912
+ style: [styles2.knob, { transform: [{ translateX: knob.x }, { translateY: knob.y }] }]
913
+ }
914
+ )
915
+ ]
916
+ }
917
+ );
918
+ }
919
+ function returnTrue2() {
920
+ return true;
921
+ }
922
+ var styles2 = import_react_native2.StyleSheet.create({
923
+ center: {
924
+ alignItems: "center",
925
+ justifyContent: "center"
926
+ },
927
+ baseBg: {
928
+ backgroundColor: "rgba(255,255,255,0.2)"
929
+ },
930
+ knob: {
931
+ width: 40,
932
+ height: 40,
933
+ borderRadius: 20,
934
+ backgroundColor: "rgba(255,255,255,0.6)"
935
+ }
936
+ });
937
+
938
+ // src/virtual-button.tsx
939
+ var import_input3 = require("@flare-engine/input");
940
+ var import_react6 = require("react");
941
+ var import_react_native3 = require("react-native");
942
+ var import_jsx_runtime3 = require("react/jsx-runtime");
943
+ function VirtualButton({
944
+ onStateChange,
945
+ style,
946
+ children
947
+ }) {
948
+ const stateRef = (0, import_react6.useRef)((0, import_input3.createButtonState)());
949
+ const handlePress = (0, import_react6.useCallback)(() => {
950
+ (0, import_input3.resetButtonFrame)(stateRef.current);
951
+ (0, import_input3.pressButton)(stateRef.current);
952
+ onStateChange?.(stateRef.current);
953
+ }, [onStateChange]);
954
+ const handleRelease = (0, import_react6.useCallback)(() => {
955
+ (0, import_input3.resetButtonFrame)(stateRef.current);
956
+ (0, import_input3.releaseButton)(stateRef.current);
957
+ onStateChange?.(stateRef.current);
958
+ }, [onStateChange]);
959
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
960
+ import_react_native3.View,
961
+ {
962
+ style: [styles3.button, style],
963
+ onStartShouldSetResponder: returnTrue3,
964
+ onResponderGrant: handlePress,
965
+ onResponderRelease: handleRelease,
966
+ onResponderTerminate: handleRelease,
967
+ children
968
+ }
969
+ );
970
+ }
971
+ function returnTrue3() {
972
+ return true;
973
+ }
974
+ var styles3 = import_react_native3.StyleSheet.create({
975
+ button: {
976
+ width: 60,
977
+ height: 60,
978
+ borderRadius: 30,
979
+ backgroundColor: "rgba(255,255,255,0.3)",
980
+ alignItems: "center",
981
+ justifyContent: "center"
982
+ }
983
+ });
984
+
985
+ // src/loading-screen.tsx
986
+ var import_react_native4 = require("react-native");
987
+ var import_jsx_runtime4 = require("react/jsx-runtime");
988
+ function LoadingScreen({
989
+ progress,
990
+ style,
991
+ barColor = "#ffffff",
992
+ trackColor = "rgba(255,255,255,0.2)",
993
+ backgroundColor = "#000000"
994
+ }) {
995
+ const clamped = progress < 0 ? 0 : progress > 1 ? 1 : progress;
996
+ const percent = `${Math.round(clamped * 100)}%`;
997
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.View, { style: [styles4.container, { backgroundColor }, style], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.View, { style: [styles4.track, { backgroundColor: trackColor }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.View, { style: [styles4.bar, { width: percent, backgroundColor: barColor }] }) }) });
998
+ }
999
+ var styles4 = import_react_native4.StyleSheet.create({
1000
+ container: {
1001
+ position: "absolute",
1002
+ top: 0,
1003
+ left: 0,
1004
+ right: 0,
1005
+ bottom: 0,
1006
+ alignItems: "center",
1007
+ justifyContent: "center",
1008
+ padding: 32
1009
+ },
1010
+ track: {
1011
+ width: "80%",
1012
+ height: 6,
1013
+ borderRadius: 3,
1014
+ overflow: "hidden"
1015
+ },
1016
+ bar: {
1017
+ height: "100%"
1018
+ }
1019
+ });
1020
+ // Annotate the CommonJS export names for ESM import in node:
1021
+ 0 && (module.exports = {
1022
+ GameContext,
1023
+ GameView,
1024
+ LoadingScreen,
1025
+ SafeAreaContext,
1026
+ VirtualButton,
1027
+ VirtualJoystick,
1028
+ createSkiaFrameRenderer,
1029
+ renderShapesToImage,
1030
+ useEntity,
1031
+ useGame,
1032
+ useGameLoop,
1033
+ useSafeArea
1034
+ });
1035
+ //# sourceMappingURL=index.js.map