rn-gamekit 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/CHANGELOG.md +18 -0
- package/LICENSE +21 -0
- package/README.md +131 -0
- package/lib/module/assets/defineAssets.js +48 -0
- package/lib/module/assets/defineAssets.js.map +1 -0
- package/lib/module/assets/errors.js +38 -0
- package/lib/module/assets/errors.js.map +1 -0
- package/lib/module/assets/types.js +2 -0
- package/lib/module/assets/types.js.map +1 -0
- package/lib/module/assets/validation.js +99 -0
- package/lib/module/assets/validation.js.map +1 -0
- package/lib/module/core/frameDriver.js +20 -0
- package/lib/module/core/frameDriver.js.map +1 -0
- package/lib/module/core/input/createInputBuffer.js +296 -0
- package/lib/module/core/input/createInputBuffer.js.map +1 -0
- package/lib/module/core/input/types.js +4 -0
- package/lib/module/core/input/types.js.map +1 -0
- package/lib/module/core/session/createGameSession.js +554 -0
- package/lib/module/core/session/createGameSession.js.map +1 -0
- package/lib/module/core/session/deepFreeze.js +155 -0
- package/lib/module/core/session/deepFreeze.js.map +1 -0
- package/lib/module/core/session/diagnostics.js +2 -0
- package/lib/module/core/session/diagnostics.js.map +1 -0
- package/lib/module/core/session/types.js +43 -0
- package/lib/module/core/session/types.js.map +1 -0
- package/lib/module/definition/defineGame.js +57 -0
- package/lib/module/definition/defineGame.js.map +1 -0
- package/lib/module/definition/types.js +4 -0
- package/lib/module/definition/types.js.map +1 -0
- package/lib/module/geometry/types.js +2 -0
- package/lib/module/geometry/types.js.map +1 -0
- package/lib/module/index.js +12 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/react/GamePointerInput.js +385 -0
- package/lib/module/react/GamePointerInput.js.map +1 -0
- package/lib/module/react/GameView.js +223 -0
- package/lib/module/react/GameView.js.map +1 -0
- package/lib/module/react/alphaClock.js +42 -0
- package/lib/module/react/alphaClock.js.map +1 -0
- package/lib/module/react/assets/createGameAssetStore.js +358 -0
- package/lib/module/react/assets/createGameAssetStore.js.map +1 -0
- package/lib/module/react/assets/decodeSkiaImage.js +54 -0
- package/lib/module/react/assets/decodeSkiaImage.js.map +1 -0
- package/lib/module/react/assets/errors.js +10 -0
- package/lib/module/react/assets/errors.js.map +1 -0
- package/lib/module/react/assets/useGameAssets.js +160 -0
- package/lib/module/react/assets/useGameAssets.js.map +1 -0
- package/lib/module/react/bindAppLifecycle.js +58 -0
- package/lib/module/react/bindAppLifecycle.js.map +1 -0
- package/lib/module/react/bindGameSession.js +37 -0
- package/lib/module/react/bindGameSession.js.map +1 -0
- package/lib/module/react/gestureLifecycle.js +68 -0
- package/lib/module/react/gestureLifecycle.js.map +1 -0
- package/lib/module/react/instrumentation.js +4 -0
- package/lib/module/react/instrumentation.js.map +1 -0
- package/lib/module/react/pointerBinding.js +196 -0
- package/lib/module/react/pointerBinding.js.map +1 -0
- package/lib/module/react/pointerCoalescer.js +224 -0
- package/lib/module/react/pointerCoalescer.js.map +1 -0
- package/lib/module/react/pointerContainment.js +27 -0
- package/lib/module/react/pointerContainment.js.map +1 -0
- package/lib/module/react/sprites/GameSprite.js +116 -0
- package/lib/module/react/sprites/GameSprite.js.map +1 -0
- package/lib/module/react/sprites/GameWorld2D.js +44 -0
- package/lib/module/react/sprites/GameWorld2D.js.map +1 -0
- package/lib/module/react/sprites/Sprite.js +147 -0
- package/lib/module/react/sprites/Sprite.js.map +1 -0
- package/lib/module/react/sprites/SpriteBatch.js +173 -0
- package/lib/module/react/sprites/SpriteBatch.js.map +1 -0
- package/lib/module/react/sprites/spriteBatchPolicy.js +25 -0
- package/lib/module/react/sprites/spriteBatchPolicy.js.map +1 -0
- package/lib/module/react/sprites/spriteTransform.js +135 -0
- package/lib/module/react/sprites/spriteTransform.js.map +1 -0
- package/lib/module/react/viewportBinding.js +101 -0
- package/lib/module/react/viewportBinding.js.map +1 -0
- package/lib/module/react.js +13 -0
- package/lib/module/react.js.map +1 -0
- package/lib/module/scene/defineScene.js +29 -0
- package/lib/module/scene/defineScene.js.map +1 -0
- package/lib/module/scene/types.js +4 -0
- package/lib/module/scene/types.js.map +1 -0
- package/lib/module/sprites/sampleSpriteClip.js +50 -0
- package/lib/module/sprites/sampleSpriteClip.js.map +1 -0
- package/lib/module/sprites/spriteAnimationState.js +165 -0
- package/lib/module/sprites/spriteAnimationState.js.map +1 -0
- package/lib/module/testing.js +57 -0
- package/lib/module/testing.js.map +1 -0
- package/lib/module/viewport2d/index.js +4 -0
- package/lib/module/viewport2d/index.js.map +1 -0
- package/lib/module/viewport2d/math.js +129 -0
- package/lib/module/viewport2d/math.js.map +1 -0
- package/lib/module/viewport2d/types.js +2 -0
- package/lib/module/viewport2d/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/assets/defineAssets.d.ts +20 -0
- package/lib/typescript/src/assets/defineAssets.d.ts.map +1 -0
- package/lib/typescript/src/assets/errors.d.ts +20 -0
- package/lib/typescript/src/assets/errors.d.ts.map +1 -0
- package/lib/typescript/src/assets/types.d.ts +138 -0
- package/lib/typescript/src/assets/types.d.ts.map +1 -0
- package/lib/typescript/src/assets/validation.d.ts +15 -0
- package/lib/typescript/src/assets/validation.d.ts.map +1 -0
- package/lib/typescript/src/core/frameDriver.d.ts +12 -0
- package/lib/typescript/src/core/frameDriver.d.ts.map +1 -0
- package/lib/typescript/src/core/input/createInputBuffer.d.ts +12 -0
- package/lib/typescript/src/core/input/createInputBuffer.d.ts.map +1 -0
- package/lib/typescript/src/core/input/types.d.ts +64 -0
- package/lib/typescript/src/core/input/types.d.ts.map +1 -0
- package/lib/typescript/src/core/session/createGameSession.d.ts +18 -0
- package/lib/typescript/src/core/session/createGameSession.d.ts.map +1 -0
- package/lib/typescript/src/core/session/deepFreeze.d.ts +27 -0
- package/lib/typescript/src/core/session/deepFreeze.d.ts.map +1 -0
- package/lib/typescript/src/core/session/diagnostics.d.ts +36 -0
- package/lib/typescript/src/core/session/diagnostics.d.ts.map +1 -0
- package/lib/typescript/src/core/session/types.d.ts +104 -0
- package/lib/typescript/src/core/session/types.d.ts.map +1 -0
- package/lib/typescript/src/definition/defineGame.d.ts +66 -0
- package/lib/typescript/src/definition/defineGame.d.ts.map +1 -0
- package/lib/typescript/src/definition/types.d.ts +56 -0
- package/lib/typescript/src/definition/types.d.ts.map +1 -0
- package/lib/typescript/src/geometry/types.d.ts +8 -0
- package/lib/typescript/src/geometry/types.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +18 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/react/GamePointerInput.d.ts +37 -0
- package/lib/typescript/src/react/GamePointerInput.d.ts.map +1 -0
- package/lib/typescript/src/react/GameView.d.ts +61 -0
- package/lib/typescript/src/react/GameView.d.ts.map +1 -0
- package/lib/typescript/src/react/alphaClock.d.ts +29 -0
- package/lib/typescript/src/react/alphaClock.d.ts.map +1 -0
- package/lib/typescript/src/react/assets/createGameAssetStore.d.ts +33 -0
- package/lib/typescript/src/react/assets/createGameAssetStore.d.ts.map +1 -0
- package/lib/typescript/src/react/assets/decodeSkiaImage.d.ts +12 -0
- package/lib/typescript/src/react/assets/decodeSkiaImage.d.ts.map +1 -0
- package/lib/typescript/src/react/assets/errors.d.ts +8 -0
- package/lib/typescript/src/react/assets/errors.d.ts.map +1 -0
- package/lib/typescript/src/react/assets/useGameAssets.d.ts +35 -0
- package/lib/typescript/src/react/assets/useGameAssets.d.ts.map +1 -0
- package/lib/typescript/src/react/bindAppLifecycle.d.ts +32 -0
- package/lib/typescript/src/react/bindAppLifecycle.d.ts.map +1 -0
- package/lib/typescript/src/react/bindGameSession.d.ts +14 -0
- package/lib/typescript/src/react/bindGameSession.d.ts.map +1 -0
- package/lib/typescript/src/react/gestureLifecycle.d.ts +37 -0
- package/lib/typescript/src/react/gestureLifecycle.d.ts.map +1 -0
- package/lib/typescript/src/react/instrumentation.d.ts +47 -0
- package/lib/typescript/src/react/instrumentation.d.ts.map +1 -0
- package/lib/typescript/src/react/pointerBinding.d.ts +104 -0
- package/lib/typescript/src/react/pointerBinding.d.ts.map +1 -0
- package/lib/typescript/src/react/pointerCoalescer.d.ts +106 -0
- package/lib/typescript/src/react/pointerCoalescer.d.ts.map +1 -0
- package/lib/typescript/src/react/pointerContainment.d.ts +12 -0
- package/lib/typescript/src/react/pointerContainment.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/GameSprite.d.ts +75 -0
- package/lib/typescript/src/react/sprites/GameSprite.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/GameWorld2D.d.ts +29 -0
- package/lib/typescript/src/react/sprites/GameWorld2D.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/Sprite.d.ts +43 -0
- package/lib/typescript/src/react/sprites/Sprite.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/SpriteBatch.d.ts +41 -0
- package/lib/typescript/src/react/sprites/SpriteBatch.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/spriteBatchPolicy.d.ts +10 -0
- package/lib/typescript/src/react/sprites/spriteBatchPolicy.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/spriteTransform.d.ts +86 -0
- package/lib/typescript/src/react/sprites/spriteTransform.d.ts.map +1 -0
- package/lib/typescript/src/react/viewportBinding.d.ts +42 -0
- package/lib/typescript/src/react/viewportBinding.d.ts.map +1 -0
- package/lib/typescript/src/react.d.ts +20 -0
- package/lib/typescript/src/react.d.ts.map +1 -0
- package/lib/typescript/src/scene/defineScene.d.ts +26 -0
- package/lib/typescript/src/scene/defineScene.d.ts.map +1 -0
- package/lib/typescript/src/scene/types.d.ts +71 -0
- package/lib/typescript/src/scene/types.d.ts.map +1 -0
- package/lib/typescript/src/sprites/sampleSpriteClip.d.ts +24 -0
- package/lib/typescript/src/sprites/sampleSpriteClip.d.ts.map +1 -0
- package/lib/typescript/src/sprites/spriteAnimationState.d.ts +45 -0
- package/lib/typescript/src/sprites/spriteAnimationState.d.ts.map +1 -0
- package/lib/typescript/src/testing.d.ts +28 -0
- package/lib/typescript/src/testing.d.ts.map +1 -0
- package/lib/typescript/src/viewport2d/index.d.ts +3 -0
- package/lib/typescript/src/viewport2d/index.d.ts.map +1 -0
- package/lib/typescript/src/viewport2d/math.d.ts +25 -0
- package/lib/typescript/src/viewport2d/math.d.ts.map +1 -0
- package/lib/typescript/src/viewport2d/types.d.ts +59 -0
- package/lib/typescript/src/viewport2d/types.d.ts.map +1 -0
- package/package.json +120 -0
- package/src/assets/defineAssets.ts +62 -0
- package/src/assets/errors.ts +64 -0
- package/src/assets/types.ts +164 -0
- package/src/assets/validation.ts +158 -0
- package/src/core/frameDriver.ts +31 -0
- package/src/core/input/createInputBuffer.ts +337 -0
- package/src/core/input/types.ts +67 -0
- package/src/core/session/createGameSession.ts +652 -0
- package/src/core/session/deepFreeze.ts +158 -0
- package/src/core/session/diagnostics.ts +35 -0
- package/src/core/session/types.ts +122 -0
- package/src/definition/defineGame.ts +94 -0
- package/src/definition/types.ts +67 -0
- package/src/geometry/types.ts +7 -0
- package/src/index.ts +84 -0
- package/src/react/GamePointerInput.tsx +478 -0
- package/src/react/GameView.tsx +317 -0
- package/src/react/alphaClock.ts +59 -0
- package/src/react/assets/createGameAssetStore.ts +459 -0
- package/src/react/assets/decodeSkiaImage.ts +64 -0
- package/src/react/assets/errors.ts +7 -0
- package/src/react/assets/useGameAssets.ts +171 -0
- package/src/react/bindAppLifecycle.ts +79 -0
- package/src/react/bindGameSession.ts +41 -0
- package/src/react/gestureLifecycle.ts +73 -0
- package/src/react/instrumentation.ts +54 -0
- package/src/react/pointerBinding.ts +226 -0
- package/src/react/pointerCoalescer.ts +234 -0
- package/src/react/pointerContainment.ts +23 -0
- package/src/react/sprites/GameSprite.tsx +192 -0
- package/src/react/sprites/GameWorld2D.tsx +46 -0
- package/src/react/sprites/Sprite.tsx +194 -0
- package/src/react/sprites/SpriteBatch.tsx +219 -0
- package/src/react/sprites/spriteBatchPolicy.ts +21 -0
- package/src/react/sprites/spriteTransform.ts +163 -0
- package/src/react/viewportBinding.ts +104 -0
- package/src/react.ts +37 -0
- package/src/scene/defineScene.ts +38 -0
- package/src/scene/types.ts +79 -0
- package/src/sprites/sampleSpriteClip.ts +51 -0
- package/src/sprites/spriteAnimationState.ts +176 -0
- package/src/testing.ts +61 -0
- package/src/viewport2d/index.ts +7 -0
- package/src/viewport2d/math.ts +134 -0
- package/src/viewport2d/types.ts +63 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { LoadedImage, LoadedSpriteSheet } from '../../assets/types.js';
|
|
2
|
+
/** The resolved source rectangle for one frame selection. */
|
|
3
|
+
export interface SpriteFrameRect {
|
|
4
|
+
readonly x: number;
|
|
5
|
+
readonly y: number;
|
|
6
|
+
readonly width: number;
|
|
7
|
+
readonly height: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Resolve the source rectangle for a static frame selection.
|
|
11
|
+
*
|
|
12
|
+
* RF4: an absent selection (the dynamic clip/elapsed mode before its first
|
|
13
|
+
* value) presents nothing instead of throwing. The static baseline uses the
|
|
14
|
+
* sheet's first frame so the anchor/scale correction has sane dimensions
|
|
15
|
+
* while the per-frame worklet resolves the real selection.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveSpriteFrameRect(source: LoadedImage | LoadedSpriteSheet, frame: string | undefined): SpriteFrameRect;
|
|
18
|
+
/**
|
|
19
|
+
* Sprite transform math (T7.6).
|
|
20
|
+
*
|
|
21
|
+
* Pure, worklet-compatible. A sprite's frame occupies
|
|
22
|
+
* `[0, 0, frameWidth, frameHeight]` in local space and the documented pivot
|
|
23
|
+
* order is:
|
|
24
|
+
*
|
|
25
|
+
* M = T(x, y) · R(rotation) · T(anchor) · S(scaleX, scaleY) · T(-anchor)
|
|
26
|
+
*
|
|
27
|
+
* i.e. scale and explicit flips happen around the anchor, then the frame
|
|
28
|
+
* rotates around the anchor at the world position. The RSXform carries the
|
|
29
|
+
* rotation + position (its 2x2 cannot express flips or non-uniform scale);
|
|
30
|
+
* the wrapping Group applies the scale/flip part around the anchor.
|
|
31
|
+
*/
|
|
32
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
33
|
+
/** A sprite's presentation input; numbers or UI-runtime animated values. */
|
|
34
|
+
export interface SpriteTransformInput {
|
|
35
|
+
/** World position in logical units. */
|
|
36
|
+
readonly x: number | SharedValue<number>;
|
|
37
|
+
readonly y: number | SharedValue<number>;
|
|
38
|
+
/** Rotation in radians around the anchor. */
|
|
39
|
+
readonly rotation: number | SharedValue<number>;
|
|
40
|
+
/** Uniform scale around the anchor. */
|
|
41
|
+
readonly scale: number | SharedValue<number>;
|
|
42
|
+
/** Explicit flips preserve the anchor. */
|
|
43
|
+
readonly flipX: boolean | SharedValue<boolean>;
|
|
44
|
+
readonly flipY: boolean | SharedValue<boolean>;
|
|
45
|
+
/** Normalized anchor in [0, 1] relative to the selected frame. */
|
|
46
|
+
readonly anchorX: number;
|
|
47
|
+
readonly anchorY: number;
|
|
48
|
+
/** Selected frame size in source pixels (logical units for placement). */
|
|
49
|
+
readonly frameWidth: number;
|
|
50
|
+
readonly frameHeight: number;
|
|
51
|
+
}
|
|
52
|
+
/** The computed RSXform (rotation + position, pivot-compensated). */
|
|
53
|
+
export interface SpriteRsxform {
|
|
54
|
+
readonly scos: number;
|
|
55
|
+
readonly ssin: number;
|
|
56
|
+
readonly tx: number;
|
|
57
|
+
readonly ty: number;
|
|
58
|
+
}
|
|
59
|
+
/** A Skia-compatible 3x3 transform element list. */
|
|
60
|
+
export type SkiaTransformElement = {
|
|
61
|
+
readonly translateX: number;
|
|
62
|
+
} | {
|
|
63
|
+
readonly translateY: number;
|
|
64
|
+
} | {
|
|
65
|
+
readonly scaleX: number;
|
|
66
|
+
} | {
|
|
67
|
+
readonly scaleY: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* The RSXform for the atlas path: rotation + position with the pivot
|
|
71
|
+
* compensated (`tx = x - pivotX·cos + pivotY·sin`). Scale and flips are
|
|
72
|
+
* applied by the wrapping Group (`spriteGroupCorrection`).
|
|
73
|
+
*/
|
|
74
|
+
export declare function computeSpriteRsxform(input: SpriteTransformInput): SpriteRsxform;
|
|
75
|
+
/**
|
|
76
|
+
* The scale/flip part around the anchor as a Skia transform element list:
|
|
77
|
+
* `T(anchor) · S(scaleX, scaleY) · T(-anchor)` (the first element is the
|
|
78
|
+
* outermost).
|
|
79
|
+
*/
|
|
80
|
+
export declare function spriteGroupCorrection(input: SpriteTransformInput): readonly SkiaTransformElement[];
|
|
81
|
+
/** World position of the anchor point (for debugging and overlays). */
|
|
82
|
+
export declare function spriteAnchorWorld(input: SpriteTransformInput): {
|
|
83
|
+
readonly x: number;
|
|
84
|
+
readonly y: number;
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=spriteTransform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spriteTransform.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/spriteTransform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAoB,CAAC;AAEzE,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,WAAW,GAAG,iBAAiB,EACvC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,eAAe,CAwBjB;AAED;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC,uCAAuC;IACvC,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC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B,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,oBAAoB,EAAE,CAelG;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,GAAG;IAC9D,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB,CAMA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ResolvedViewport2D, type SurfaceSize, type Viewport } from '../viewport2d/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Platform-neutral holder for the resolved viewport of a mounted game
|
|
4
|
+
* surface.
|
|
5
|
+
*
|
|
6
|
+
* It re-resolves whenever the surface size changes, notifies subscribers on
|
|
7
|
+
* each layout revision (so pointer input can cancel an active gesture on
|
|
8
|
+
* layout invalidation), and exposes the latest immutable resolved viewport to
|
|
9
|
+
* both the renderer and the input adapter. It never touches React, Skia, or
|
|
10
|
+
* platform dimensions.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ViewportBinding {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(config: Viewport);
|
|
15
|
+
/** The authored viewport configuration this binding resolves. */
|
|
16
|
+
get config(): Viewport;
|
|
17
|
+
/** The latest resolved viewport, or `undefined` while the layout is invalid. */
|
|
18
|
+
get resolved(): ResolvedViewport2D | undefined;
|
|
19
|
+
/** The latest native surface measurement, retained across viewport swaps. */
|
|
20
|
+
get surfaceSize(): SurfaceSize | undefined;
|
|
21
|
+
/** Monotonic counter incremented on every layout revision. */
|
|
22
|
+
get revision(): number;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the configured viewport against a new surface size.
|
|
25
|
+
*
|
|
26
|
+
* No-op for unchanged sizes. Subscribers are notified only when the layout
|
|
27
|
+
* actually changes.
|
|
28
|
+
*/
|
|
29
|
+
setSurfaceSize(size: SurfaceSize): void;
|
|
30
|
+
/** Observe layout revisions. Returns an idempotent unsubscribe. */
|
|
31
|
+
subscribe(listener: () => void): () => void;
|
|
32
|
+
/** Release subscribers. The binding becomes inert. */
|
|
33
|
+
dispose(): void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Return the existing binding when its authored viewport is unchanged, or
|
|
37
|
+
* create a replacement that immediately resolves against the already-mounted
|
|
38
|
+
* native surface. React Native does not guarantee another `onLayout` event
|
|
39
|
+
* when only the game/viewport changes and the View's dimensions stay equal.
|
|
40
|
+
*/
|
|
41
|
+
export declare function bindingForViewport(config: Viewport, previous: ViewportBinding | null): ViewportBinding;
|
|
42
|
+
//# sourceMappingURL=viewportBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewportBinding.d.ts","sourceRoot":"","sources":["../../../../src/react/viewportBinding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,kBAAkB,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAe,CAAC;AAE5G;;;;;;;;;GASG;AACH,qBAAa,eAAe;;gBAOd,MAAM,EAAE,QAAQ;IAI5B,iEAAiE;IACjE,IAAI,MAAM,IAAI,QAAQ,CAErB;IAED,gFAAgF;IAChF,IAAI,QAAQ,IAAI,kBAAkB,GAAG,SAAS,CAE7C;IAED,6EAA6E;IAC7E,IAAI,WAAW,IAAI,WAAW,GAAG,SAAS,CAEzC;IAED,8DAA8D;IAC9D,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAgBvC,mEAAmE;IACnE,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAY3C,sDAAsD;IACtD,OAAO,IAAI,IAAI;CAGhB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,eAAe,GAAG,IAAI,GAC/B,eAAe,CAUjB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { GameView } from './react/GameView.js';
|
|
2
|
+
export { createGameAssetStore } from './react/assets/decodeSkiaImage.js';
|
|
3
|
+
export { useGameAssets, stableGroupsKey } from './react/assets/useGameAssets.js';
|
|
4
|
+
export type { GameAssetsState } from './react/assets/useGameAssets.js';
|
|
5
|
+
export { GameWorld2D, viewportTransform } from './react/sprites/GameWorld2D.js';
|
|
6
|
+
export { Sprite, resolveSpriteFrameRect } from './react/sprites/Sprite.js';
|
|
7
|
+
export type { SpriteAnimatable, SpriteAnimatableBoolean, SpriteProps } from './react/sprites/Sprite.js';
|
|
8
|
+
export { GameSprite, spriteFrameNameForClip } from './react/sprites/GameSprite.js';
|
|
9
|
+
export type { GameSpriteProps, GameSpriteSelectContext, GameSpriteSelection, } from './react/sprites/GameSprite.js';
|
|
10
|
+
export { SpriteBatch } from './react/sprites/SpriteBatch.js';
|
|
11
|
+
export type { SpriteBatchProps, SpriteBatchWrite } from './react/sprites/SpriteBatch.js';
|
|
12
|
+
export { computeSpriteRsxform, spriteAnchorWorld, spriteGroupCorrection, } from './react/sprites/spriteTransform.js';
|
|
13
|
+
export type { SkiaTransformElement, SpriteRsxform, SpriteTransformInput, } from './react/sprites/spriteTransform.js';
|
|
14
|
+
export { createGameAssetStoreCore } from './react/assets/createGameAssetStore.js';
|
|
15
|
+
export type { AcquireOptions, AssetPipelines, GameAssetStore, NativeImageHandle, } from './react/assets/createGameAssetStore.js';
|
|
16
|
+
export type { GameRendererProps, GameViewProps } from './react/GameView.js';
|
|
17
|
+
export { GamePointerInput } from './react/GamePointerInput.js';
|
|
18
|
+
export type { GamePointerInputProps } from './react/GamePointerInput.js';
|
|
19
|
+
export type { GamePointerInstrumentation, GameViewInstrumentation } from './react/instrumentation.js';
|
|
20
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EA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|
1
|
+
import type { SceneDefinition } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Define a synchronous functional scene while inferring its state, snapshot,
|
|
4
|
+
* action, and transition types.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* const ready = defineScene({
|
|
9
|
+
* actions: ['primary'],
|
|
10
|
+
* transitions: ['play'],
|
|
11
|
+
* create: () => ({ ready: true }),
|
|
12
|
+
* update: ({ state, input, transition }) => {
|
|
13
|
+
* if (input.pointer('primary').pressed) {
|
|
14
|
+
* transition.setScene('play');
|
|
15
|
+
* }
|
|
16
|
+
* return state;
|
|
17
|
+
* },
|
|
18
|
+
* snapshot: ({ state }) => state,
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function defineScene<const TActions extends readonly string[], TState, TSnapshot, const TTransitions extends readonly string[] = []>(definition: Omit<SceneDefinition<TState, TSnapshot, TActions[number], TTransitions[number]>, 'kind' | '__actionType' | '__transitionType' | '__snapshotType' | 'actions' | 'transitions'> & {
|
|
23
|
+
readonly actions: TActions;
|
|
24
|
+
readonly transitions?: TTransitions;
|
|
25
|
+
}): SceneDefinition<TState, TSnapshot, TActions[number], TTransitions[number]>;
|
|
26
|
+
//# sourceMappingURL=defineScene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineScene.d.ts","sourceRoot":"","sources":["../../../../src/scene/defineScene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CACzB,KAAK,CAAC,QAAQ,SAAS,SAAS,MAAM,EAAE,EACxC,MAAM,EACN,SAAS,EACT,KAAK,CAAC,YAAY,SAAS,SAAS,MAAM,EAAE,GAAG,EAAE,EAEjD,UAAU,EAAE,IAAI,CACd,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,EAC1E,MAAM,GAAG,cAAc,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,SAAS,GAAG,aAAa,CAC5F,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,YAAY,CAAA;CAAE,GACtE,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAK5E"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { InputFrame } from '../core/input/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Update-scoped scene transition controls.
|
|
4
|
+
*
|
|
5
|
+
* The controller is valid only for the duration of the `update` call that
|
|
6
|
+
* received it. Retaining it and calling either method afterwards throws a
|
|
7
|
+
* lifecycle error. Conflicting requests within one update fail clearly.
|
|
8
|
+
*/
|
|
9
|
+
export interface SceneTransitionController<TTransitionName extends string> {
|
|
10
|
+
/**
|
|
11
|
+
* Request a transition to a declared target scene.
|
|
12
|
+
*
|
|
13
|
+
* Requests to the current scene are idempotent no-ops. The transition
|
|
14
|
+
* commits after the current update completes successfully.
|
|
15
|
+
*/
|
|
16
|
+
setScene(name: TTransitionName): void;
|
|
17
|
+
/** Recreate the current scene with fresh state. */
|
|
18
|
+
restartScene(): void;
|
|
19
|
+
}
|
|
20
|
+
/** Values supplied to a scene for one deterministic simulation tick. */
|
|
21
|
+
export interface SceneUpdate<TState, TActionName extends string, TTransitionName extends string> {
|
|
22
|
+
/** The authoritative state produced by the previous tick. */
|
|
23
|
+
readonly state: Readonly<TState>;
|
|
24
|
+
/** One immutable semantic input snapshot for this tick. */
|
|
25
|
+
readonly input: InputFrame<TActionName>;
|
|
26
|
+
/** Update-scoped transition controls restricted to declared targets. */
|
|
27
|
+
readonly transition: SceneTransitionController<TTransitionName>;
|
|
28
|
+
/** One-based global simulation tick number. */
|
|
29
|
+
readonly tick: number;
|
|
30
|
+
/** One-based tick number within the current scene instance. */
|
|
31
|
+
readonly sceneTick: number;
|
|
32
|
+
/** Constant fixed-step duration in seconds. */
|
|
33
|
+
readonly deltaSeconds: number;
|
|
34
|
+
/** Deterministic global simulation time after this tick. */
|
|
35
|
+
readonly elapsedSeconds: number;
|
|
36
|
+
/** Deterministic time within the current scene instance. */
|
|
37
|
+
readonly sceneElapsedSeconds: number;
|
|
38
|
+
}
|
|
39
|
+
/** Values supplied when extracting a renderer-specific snapshot. */
|
|
40
|
+
export interface SceneSnapshotContext<TState> {
|
|
41
|
+
/** Current authoritative scene state. */
|
|
42
|
+
readonly state: Readonly<TState>;
|
|
43
|
+
}
|
|
44
|
+
/** A synchronous functional scene used by the runtime. */
|
|
45
|
+
export interface SceneDefinition<TState, TSnapshot, TActionName extends string = never, TTransitionName extends string = never> {
|
|
46
|
+
/** Internal scene-definition discriminator. */
|
|
47
|
+
readonly kind: 'gamekit.scene';
|
|
48
|
+
/** @internal Covariant type witness used to infer presentation snapshots. */
|
|
49
|
+
readonly __snapshotType?: TSnapshot;
|
|
50
|
+
/** @internal Type witness used to validate scene actions against the game. */
|
|
51
|
+
readonly __actionType?: TActionName;
|
|
52
|
+
/** @internal Type witness used to validate scene transition targets. */
|
|
53
|
+
readonly __transitionType?: TTransitionName;
|
|
54
|
+
/** Semantic input actions this scene may read. */
|
|
55
|
+
readonly actions: readonly TActionName[];
|
|
56
|
+
/** Declared scene names this scene may transition to. */
|
|
57
|
+
readonly transitions?: readonly TTransitionName[];
|
|
58
|
+
/** Create the scene's initial authoritative state. */
|
|
59
|
+
readonly create: () => TState;
|
|
60
|
+
/** Produce the next state for one fixed simulation tick. */
|
|
61
|
+
readonly update: (frame: SceneUpdate<TState, TActionName, TTransitionName>) => TState;
|
|
62
|
+
/** Extract a compact renderer-specific snapshot from current state. */
|
|
63
|
+
readonly snapshot: (context: SceneSnapshotContext<TState>) => TSnapshot;
|
|
64
|
+
/** Release scene-owned resources exactly once. */
|
|
65
|
+
readonly dispose?: (state: Readonly<TState>) => void;
|
|
66
|
+
}
|
|
67
|
+
/** Infer the presentation snapshot produced by a scene definition. */
|
|
68
|
+
export type SceneSnapshot<TScene> = TScene extends {
|
|
69
|
+
readonly __snapshotType?: infer TSnapshot;
|
|
70
|
+
} ? TSnapshot : never;
|
|
71
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/scene/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAqB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB,CAAC,eAAe,SAAS,MAAM;IACvE;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IACtC,mDAAmD;IACnD,YAAY,IAAI,IAAI,CAAC;CACtB;AAED,wEAAwE;AACxE,MAAM,WAAW,WAAW,CAAC,MAAM,EAAE,WAAW,SAAS,MAAM,EAAE,eAAe,SAAS,MAAM;IAC7F,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACxC,wEAAwE;IACxE,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAC;IAChE,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,4DAA4D;IAC5D,QAAQ,CAAC,mBA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,MAAM,SAAS,CAAA;CAAE,GAAG,SAAS,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic clip frame sampling (T7.3).
|
|
3
|
+
*
|
|
4
|
+
* Pure, allocation-free, worklet-compatible frame selection. The same clip
|
|
5
|
+
* metadata and elapsed time always select the same frame, so equivalent
|
|
6
|
+
* game time produces identical presentation at 30/60/90/120 Hz.
|
|
7
|
+
*/
|
|
8
|
+
import type { SpriteClip } from '../assets/types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Select the frame index for `elapsedMs` of playback.
|
|
11
|
+
*
|
|
12
|
+
* Loop clips wrap with modulo — the boundary frame is never duplicated and
|
|
13
|
+
* no zero-length boundary frame exists. One-shot clips clamp to their final
|
|
14
|
+
* frame; completion is reported separately.
|
|
15
|
+
*/
|
|
16
|
+
export declare function sampleSpriteClipFrame(clip: SpriteClip, elapsedMs: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* The frame NAME selected for `elapsedMs` of playback (the ordered frame
|
|
19
|
+
* references of the clip).
|
|
20
|
+
*/
|
|
21
|
+
export declare function sampleSpriteClipFrameName(clip: SpriteClip, elapsedMs: number): string;
|
|
22
|
+
/** Total clip duration in milliseconds (one-shot: its full timeline). */
|
|
23
|
+
export declare function spriteClipDurationMs(clip: SpriteClip): number;
|
|
24
|
+
//# sourceMappingURL=sampleSpriteClip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleSpriteClip.d.ts","sourceRoot":"","sources":["../../../../src/sprites/sampleSpriteClip.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAiB,CAAC;AAElD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,GAChB,MAAM,CAUR;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,GAChB,MAAM,CAMR;AAED,yEAAyE;AACzE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAG7D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SpriteSheetDescriptor } from '../assets/types.js';
|
|
2
|
+
/** Immutable, serializable animation playback state. */
|
|
3
|
+
export interface SpriteAnimationState<TClipName extends string = string> {
|
|
4
|
+
/** The clip currently selected on the descriptor. */
|
|
5
|
+
readonly clip: TClipName;
|
|
6
|
+
/** Elapsed milliseconds within the current playback of the clip. */
|
|
7
|
+
readonly elapsedMs: number;
|
|
8
|
+
/** Playback paused: advance is a no-op while paused. */
|
|
9
|
+
readonly paused: boolean;
|
|
10
|
+
/** Finite, positive playback speed multiplier. */
|
|
11
|
+
readonly speed: number;
|
|
12
|
+
/** One-shot clips report completion after their final frame. */
|
|
13
|
+
readonly completed: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** The clip names of a sprite-sheet descriptor (works through the manifest brand). */
|
|
16
|
+
export type SpriteClipNames<TDescriptor extends SpriteSheetDescriptor> = Extract<keyof TDescriptor['animations'], string>;
|
|
17
|
+
/**
|
|
18
|
+
* Start playback of `clip` from its beginning. The clip name is preserved
|
|
19
|
+
* as a string literal in the returned state; unknown clips are rejected at
|
|
20
|
+
* runtime (the manifest descriptor keeps the sheet-level frame and clip
|
|
21
|
+
* names literal via the spriteSheet contract).
|
|
22
|
+
*/
|
|
23
|
+
export declare function startSpriteAnimation<TClipName extends string>(descriptor: SpriteSheetDescriptor, clip: TClipName): SpriteAnimationState<TClipName>;
|
|
24
|
+
/**
|
|
25
|
+
* Advance playback by `deltaSeconds` of fixed-step game time.
|
|
26
|
+
*
|
|
27
|
+
* Finite negative deltas clamp elapsed time to zero; NaN/infinity fail
|
|
28
|
+
* clearly. Loop clips keep their elapsed time bounded within one timeline
|
|
29
|
+
* (modulo), so arbitrarily large deltas cost constant arithmetic.
|
|
30
|
+
*/
|
|
31
|
+
export declare function advanceSpriteAnimation<TClipName extends string>(descriptor: SpriteSheetDescriptor, state: SpriteAnimationState<TClipName>, deltaSeconds: number): SpriteAnimationState<TClipName>;
|
|
32
|
+
/**
|
|
33
|
+
* Switch playback to `clip`, restarting it from the beginning. The clip
|
|
34
|
+
* name is typed against the descriptor's animation table.
|
|
35
|
+
*/
|
|
36
|
+
export declare function playSpriteAnimation<TClipName extends string>(descriptor: SpriteSheetDescriptor, state: SpriteAnimationState<TClipName>, clip: TClipName): SpriteAnimationState<TClipName>;
|
|
37
|
+
/** Pause playback; `advance` becomes a no-op while paused. */
|
|
38
|
+
export declare function pauseSpriteAnimation<TClipName extends string>(state: SpriteAnimationState<TClipName>): SpriteAnimationState<TClipName>;
|
|
39
|
+
/** Resume playback from the paused position. */
|
|
40
|
+
export declare function resumeSpriteAnimation<TClipName extends string>(state: SpriteAnimationState<TClipName>): SpriteAnimationState<TClipName>;
|
|
41
|
+
/** Restart the current clip from its beginning. */
|
|
42
|
+
export declare function resetSpriteAnimation<TClipName extends string>(state: SpriteAnimationState<TClipName>): SpriteAnimationState<TClipName>;
|
|
43
|
+
/** Set a finite positive speed multiplier. */
|
|
44
|
+
export declare function setSpriteAnimationSpeed<TClipName extends string>(state: SpriteAnimationState<TClipName>, speed: number): SpriteAnimationState<TClipName>;
|
|
45
|
+
//# sourceMappingURL=spriteAnimationState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spriteAnimationState.d.ts","sourceRoot":"","sources":["../../../../src/sprites/spriteAnimationState.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAiB,CAAC;AAG7D,wDAAwD;AACxD,MAAM,WAAW,oBAAoB,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM;IACrE,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,oEAAoE;IACpE,QAAQ,CAA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,SAAS,MAAM,EAC3D,KAAK,EAAE,oBAAoB,CAAC,SAAS,CAAC,GACrC,oBAAoB,CAAC,SAAS,CAAC,CAGjC;AAED,8CAA8C;AAC9C,wBAAgB,uBAAuB,CAAC,SAAS,SAAS,MAAM,EAC9D,KAAK,EAAE,oBAAoB,CAAC,SAAS,CAAC,EACtC,KAAK,EAAE,MAAM,GACZ,oBAAoB,CAAC,SAAS,CAAC,CAIjC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createGameSessionWithDriver } from './core/session/createGameSession.js';
|
|
2
|
+
import { createAnimationFrameDriver } from './core/frameDriver.js';
|
|
3
|
+
import type { FrameDriver, FrameHandle } from './core/frameDriver.js';
|
|
4
|
+
import type { SessionDiagnostics } from './core/session/diagnostics.js';
|
|
5
|
+
export { createAnimationFrameDriver, createGameSessionWithDriver };
|
|
6
|
+
export type { FrameDriver, FrameHandle, SessionDiagnostics };
|
|
7
|
+
/**
|
|
8
|
+
* Deterministic animation-frame driver for headless tests.
|
|
9
|
+
*
|
|
10
|
+
* Frames are fired manually with explicit timestamps, so games can be driven
|
|
11
|
+
* with a fixed step and exact wall-clock schedules in Node without a
|
|
12
|
+
* simulator.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ManualFrameDriver implements FrameDriver {
|
|
15
|
+
#private;
|
|
16
|
+
/** Number of currently scheduled callbacks. */
|
|
17
|
+
get pendingCount(): number;
|
|
18
|
+
requestFrame(callback: (timestampMs: number) => void): FrameHandle;
|
|
19
|
+
cancelFrame(handle: FrameHandle): void;
|
|
20
|
+
/** Fire the next pending callback with the given timestamp. */
|
|
21
|
+
fireNext(timestampMs: number): FrameHandle;
|
|
22
|
+
/**
|
|
23
|
+
* Fire a specific handle even if it was already fired, simulating a stale
|
|
24
|
+
* callback racing with a lifecycle change.
|
|
25
|
+
*/
|
|
26
|
+
fireCancelled(handle: FrameHandle, timestampMs: number): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAkC,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA4B,CAAC;AAErE,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;AAE7D;;;;;;GAMG;AACH,qBAAa,iBAAkB,YAAW,WAAW;;IAKnD,+CAA+C;IAC/C,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,YAAY,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,GAAG,WAAW;IAQlE,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAItC,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW;IAW1C;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;CAO9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/viewport2d/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAS,CAAC;AAC1G,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,WAAQ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Point2D } from '../geometry/types.js';
|
|
2
|
+
import type { ResolvedViewport2D, SurfaceSize, Viewport } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve an authored viewport configuration against an actual surface size.
|
|
5
|
+
*
|
|
6
|
+
* Returns `undefined` until both surface dimensions are positive — a
|
|
7
|
+
* zero-sized layout is normal before the first layout pass. Invalid authored
|
|
8
|
+
* sizes throw a `RangeError` naming the invalid dimension. The result is
|
|
9
|
+
* immutable plain data with no platform dependencies.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveViewport2D(config: Viewport, surfaceSize: SurfaceSize): ResolvedViewport2D | undefined;
|
|
12
|
+
/** Convert a logical/world point into surface coordinates. */
|
|
13
|
+
export declare function worldToSurface(viewport: ResolvedViewport2D, point: Point2D): Point2D;
|
|
14
|
+
/** Convert a surface point into logical/world coordinates. */
|
|
15
|
+
export declare function surfaceToWorld(viewport: ResolvedViewport2D, point: Point2D): Point2D;
|
|
16
|
+
/**
|
|
17
|
+
* Decide whether a surface point lies inside the interactive content area.
|
|
18
|
+
*
|
|
19
|
+
* For `fit` this rejects letterbox space so a pointer cannot begin there. For
|
|
20
|
+
* `fill` and `extend-world` the entire surface is interactive. Conversion
|
|
21
|
+
* itself remains mathematical everywhere; this operation decides whether a
|
|
22
|
+
* gesture may begin.
|
|
23
|
+
*/
|
|
24
|
+
export declare function containsSurfacePoint(viewport: ResolvedViewport2D, point: Point2D): boolean;
|
|
25
|
+
//# sourceMappingURL=math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../src/viewport2d/math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAmB,CAAC;AACjD,OAAO,KAAK,EAAQ,kBAAkB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAS,CAAC;AAwB/E;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,QAAQ,EAChB,WAAW,EAAE,WAAW,GACvB,kBAAkB,GAAG,SAAS,CAoEhC;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAKpF;AAED,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAKpF;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAG1F"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** The logical size of the game viewport in design points. */
|
|
2
|
+
export interface LogicalSize {
|
|
3
|
+
/** Logical width in points. */
|
|
4
|
+
readonly width: number;
|
|
5
|
+
/** Logical height in points. */
|
|
6
|
+
readonly height: number;
|
|
7
|
+
}
|
|
8
|
+
/** How the authored logical viewport maps onto the mounted surface. */
|
|
9
|
+
export type ViewportMode = 'fit' | 'fill' | 'extend-world';
|
|
10
|
+
/** The authored viewport configuration of a game. */
|
|
11
|
+
export interface Viewport {
|
|
12
|
+
/** The logical coordinate space the game is authored against. */
|
|
13
|
+
readonly logicalSize: LogicalSize;
|
|
14
|
+
/** How the authored viewport scales onto the mounted game surface. */
|
|
15
|
+
readonly mode: ViewportMode;
|
|
16
|
+
}
|
|
17
|
+
/** The actual mounted size of a game surface in React Native layout points. */
|
|
18
|
+
export interface SurfaceSize {
|
|
19
|
+
/** Surface width in points. */
|
|
20
|
+
readonly width: number;
|
|
21
|
+
/** Surface height in points. */
|
|
22
|
+
readonly height: number;
|
|
23
|
+
}
|
|
24
|
+
/** An axis-aligned rectangle in a coordinate space. */
|
|
25
|
+
export interface Rect {
|
|
26
|
+
/** Left edge. */
|
|
27
|
+
readonly x: number;
|
|
28
|
+
/** Top edge. */
|
|
29
|
+
readonly y: number;
|
|
30
|
+
/** Width. */
|
|
31
|
+
readonly width: number;
|
|
32
|
+
/** Height. */
|
|
33
|
+
readonly height: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A resolved, immutable viewport mapping between logical/world coordinates
|
|
37
|
+
* and surface coordinates.
|
|
38
|
+
*
|
|
39
|
+
* The transformation is linear: `surface = world * scale + offset`. All
|
|
40
|
+
* fields are plain data and are safe to share between drawing and hit
|
|
41
|
+
* testing.
|
|
42
|
+
*/
|
|
43
|
+
export interface ResolvedViewport2D {
|
|
44
|
+
/** The surface size this viewport was resolved against. */
|
|
45
|
+
readonly surfaceSize: SurfaceSize;
|
|
46
|
+
/** The authored logical bounds: `{ x: 0, y: 0, width, height }`. */
|
|
47
|
+
readonly logicalBounds: Rect;
|
|
48
|
+
/** The portion of the logical/world space visible on the surface. */
|
|
49
|
+
readonly visibleLogicalBounds: Rect;
|
|
50
|
+
/** The surface region covered by visible world content. */
|
|
51
|
+
readonly contentBounds: Rect;
|
|
52
|
+
/** The one uniform scale from world units to surface points. */
|
|
53
|
+
readonly scale: number;
|
|
54
|
+
/** Horizontal translation offset in surface points. */
|
|
55
|
+
readonly offsetX: number;
|
|
56
|
+
/** Vertical translation offset in surface points. */
|
|
57
|
+
readonly offsetY: number;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/viewport2d/types.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,cAAc,CAAC;AAE3D,qDAAqD;AACrD,MAAM,WAAW,QAAQ;IACvB,iEAAiE;IACjE,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;CAC7B;AAED,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,uDAAuD;AACvD,MAAM,WAAW,IAAI;IACnB,iBAAiB;IACjB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa;IACb,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,cAAc;IACd,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,oEAAoE;IACpE,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,oBAAoB,EAAE,IAAI,CAAC;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC;IAC7B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rn-gamekit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A headless-first 2D game toolkit for React Native and Expo, built for mobile and tablet.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"react-native",
|
|
8
|
+
"expo",
|
|
9
|
+
"game-engine",
|
|
10
|
+
"game-development",
|
|
11
|
+
"2d",
|
|
12
|
+
"skia"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/OrekuD/react-native-gamekit#readme",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/OrekuD/react-native-gamekit.git",
|
|
18
|
+
"directory": "packages/gamekit"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/OrekuD/react-native-gamekit/issues"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"main": "./lib/module/index.js",
|
|
27
|
+
"source": "./src/index.ts",
|
|
28
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"react-native": "./src/index.ts",
|
|
32
|
+
"source": "./src/index.ts",
|
|
33
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
34
|
+
"default": "./lib/module/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./react": {
|
|
37
|
+
"react-native": "./src/react.ts",
|
|
38
|
+
"source": "./src/react.ts",
|
|
39
|
+
"types": "./lib/typescript/src/react.d.ts",
|
|
40
|
+
"default": "./lib/module/react.js"
|
|
41
|
+
},
|
|
42
|
+
"./package.json": "./package.json",
|
|
43
|
+
"./testing": {
|
|
44
|
+
"react-native": "./src/testing.ts",
|
|
45
|
+
"source": "./src/testing.ts",
|
|
46
|
+
"types": "./lib/typescript/src/testing.d.ts",
|
|
47
|
+
"default": "./lib/module/testing.js"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"react-native": "./src/index.ts",
|
|
51
|
+
"files": [
|
|
52
|
+
"lib",
|
|
53
|
+
"src",
|
|
54
|
+
"README.md",
|
|
55
|
+
"CHANGELOG.md",
|
|
56
|
+
"LICENSE"
|
|
57
|
+
],
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "bob build",
|
|
60
|
+
"clean": "del-cli lib",
|
|
61
|
+
"lint": "eslint .",
|
|
62
|
+
"typecheck": "tsc --noEmit",
|
|
63
|
+
"test": "node --import tsx --test test/*.test.ts",
|
|
64
|
+
"test:coverage": "node --import tsx --experimental-test-coverage --test test/*.test.ts",
|
|
65
|
+
"prepack": "bob build",
|
|
66
|
+
"pack:inspect": "pnpm pack --dry-run",
|
|
67
|
+
"bench:deepfreeze": "node --import tsx bench/deepFreeze.bench.ts",
|
|
68
|
+
"test:coverage:gate": "node scripts/coverage-gate.mjs",
|
|
69
|
+
"typecheck:assets": "tsc -p tsconfig.assets.json"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"@shopify/react-native-skia": "2.11.0",
|
|
73
|
+
"expo": "~57.0.10",
|
|
74
|
+
"expo-asset": "~57.0.8",
|
|
75
|
+
"react": "^19.2.3",
|
|
76
|
+
"react-native": "~0.86.2",
|
|
77
|
+
"react-native-gesture-handler": "~3.1.0",
|
|
78
|
+
"react-native-reanimated": "4.5.3",
|
|
79
|
+
"react-native-worklets": "0.10.3"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@shopify/react-native-skia": "2.11.0",
|
|
83
|
+
"@types/node": "^22.0.0",
|
|
84
|
+
"@types/react": "19.2.18",
|
|
85
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
86
|
+
"del-cli": "^7.0.0",
|
|
87
|
+
"eslint": "^9.39.0",
|
|
88
|
+
"expo": "57.0.10",
|
|
89
|
+
"expo-asset": "57.0.8",
|
|
90
|
+
"react": "19.2.3",
|
|
91
|
+
"react-dom": "19.2.3",
|
|
92
|
+
"react-native": "0.86.2",
|
|
93
|
+
"react-native-builder-bob": "^0.43.0",
|
|
94
|
+
"react-native-gesture-handler": "3.1.0",
|
|
95
|
+
"react-native-reanimated": "4.5.3",
|
|
96
|
+
"react-native-worklets": "0.10.3",
|
|
97
|
+
"react-test-renderer": "19.2.3",
|
|
98
|
+
"tsx": "^4.19.0",
|
|
99
|
+
"typescript": "catalog:",
|
|
100
|
+
"typescript-eslint": "^8.0.0"
|
|
101
|
+
},
|
|
102
|
+
"react-native-builder-bob": {
|
|
103
|
+
"source": "src",
|
|
104
|
+
"output": "lib",
|
|
105
|
+
"targets": [
|
|
106
|
+
[
|
|
107
|
+
"module",
|
|
108
|
+
{
|
|
109
|
+
"esm": true
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
[
|
|
113
|
+
"typescript",
|
|
114
|
+
{
|
|
115
|
+
"project": "tsconfig.build.json"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|