rn-gamekit 0.1.0 → 0.2.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 +68 -0
- package/README.md +95 -14
- package/lib/module/assets/defineAssets.js +28 -3
- package/lib/module/assets/defineAssets.js.map +1 -1
- package/lib/module/assets.js +11 -0
- package/lib/module/assets.js.map +1 -0
- package/lib/module/audio/createGameAudio.js +784 -0
- package/lib/module/audio/createGameAudio.js.map +1 -0
- package/lib/module/audio/errors.js +12 -0
- package/lib/module/audio/errors.js.map +1 -0
- package/lib/module/audio/index.js +5 -0
- package/lib/module/audio/index.js.map +1 -0
- package/lib/module/audio/resolver.js +37 -0
- package/lib/module/audio/resolver.js.map +1 -0
- package/lib/module/audio/types.js +4 -0
- package/lib/module/audio/types.js.map +1 -0
- package/lib/module/audio.js +9 -0
- package/lib/module/audio.js.map +1 -0
- package/lib/module/camera2d/bounds.js +59 -0
- package/lib/module/camera2d/bounds.js.map +1 -0
- package/lib/module/camera2d/extents.js +25 -0
- package/lib/module/camera2d/extents.js.map +1 -0
- package/lib/module/camera2d/follow.js +138 -0
- package/lib/module/camera2d/follow.js.map +1 -0
- package/lib/module/camera2d/index.js +20 -0
- package/lib/module/camera2d/index.js.map +1 -0
- package/lib/module/camera2d/interpolation.js +98 -0
- package/lib/module/camera2d/interpolation.js.map +1 -0
- package/lib/module/camera2d/shake.js +85 -0
- package/lib/module/camera2d/shake.js.map +1 -0
- package/lib/module/camera2d/transform.js +151 -0
- package/lib/module/camera2d/transform.js.map +1 -0
- package/lib/module/camera2d/types.js +4 -0
- package/lib/module/camera2d/types.js.map +1 -0
- package/lib/module/camera2d/validation.js +98 -0
- package/lib/module/camera2d/validation.js.map +1 -0
- package/lib/module/camera2d/visibility.js +138 -0
- package/lib/module/camera2d/visibility.js.map +1 -0
- package/lib/module/camera2d.js +9 -0
- package/lib/module/camera2d.js.map +1 -0
- package/lib/module/collision2d/colliders.js +266 -0
- package/lib/module/collision2d/colliders.js.map +1 -0
- package/lib/module/collision2d/debug.js +105 -0
- package/lib/module/collision2d/debug.js.map +1 -0
- package/lib/module/collision2d/filters.js +40 -0
- package/lib/module/collision2d/filters.js.map +1 -0
- package/lib/module/collision2d/index.js +12 -0
- package/lib/module/collision2d/index.js.map +1 -0
- package/lib/module/collision2d/intersections.js +67 -0
- package/lib/module/collision2d/intersections.js.map +1 -0
- package/lib/module/collision2d/manifolds.js +218 -0
- package/lib/module/collision2d/manifolds.js.map +1 -0
- package/lib/module/collision2d/segments.js +187 -0
- package/lib/module/collision2d/segments.js.map +1 -0
- package/lib/module/collision2d/spatialHash.js +167 -0
- package/lib/module/collision2d/spatialHash.js.map +1 -0
- package/lib/module/collision2d/sweeps.js +255 -0
- package/lib/module/collision2d/sweeps.js.map +1 -0
- package/lib/module/collision2d.js +9 -0
- package/lib/module/collision2d.js.map +1 -0
- package/lib/module/core/input/buttonPad.js +214 -0
- package/lib/module/core/input/buttonPad.js.map +1 -0
- package/lib/module/core/input/createInputBuffer.js +66 -14
- package/lib/module/core/input/createInputBuffer.js.map +1 -1
- package/lib/module/core/session/createGameSession.js +454 -50
- package/lib/module/core/session/createGameSession.js.map +1 -1
- package/lib/module/core/session/deepFreeze.js +92 -2
- package/lib/module/core/session/deepFreeze.js.map +1 -1
- package/lib/module/core/session/types.js +12 -0
- package/lib/module/core/session/types.js.map +1 -1
- package/lib/module/definition/defineGame.js +23 -0
- package/lib/module/definition/defineGame.js.map +1 -1
- package/lib/module/events/defineGameEvents.js +46 -0
- package/lib/module/events/defineGameEvents.js.map +1 -0
- package/lib/module/events/errors.js +16 -0
- package/lib/module/events/errors.js.map +1 -0
- package/lib/module/events/index.js +7 -0
- package/lib/module/events/index.js.map +1 -0
- package/lib/module/events/payload.js +219 -0
- package/lib/module/events/payload.js.map +1 -0
- package/lib/module/events/seed.js +33 -0
- package/lib/module/events/seed.js.map +1 -0
- package/lib/module/events/types.js +4 -0
- package/lib/module/events/types.js.map +1 -0
- package/lib/module/events.js +13 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/geometry/helpers.js +140 -0
- package/lib/module/geometry/helpers.js.map +1 -0
- package/lib/module/geometry/index.js +5 -0
- package/lib/module/geometry/index.js.map +1 -0
- package/lib/module/geometry/validation.js +104 -0
- package/lib/module/geometry/validation.js.map +1 -0
- package/lib/module/geometry.js +9 -0
- package/lib/module/geometry.js.map +1 -0
- package/lib/module/haptics/createGameHaptics.js +214 -0
- package/lib/module/haptics/createGameHaptics.js.map +1 -0
- package/lib/module/haptics/errors.js +12 -0
- package/lib/module/haptics/errors.js.map +1 -0
- package/lib/module/haptics/index.js +5 -0
- package/lib/module/haptics/index.js.map +1 -0
- package/lib/module/haptics/resolver.js +37 -0
- package/lib/module/haptics/resolver.js.map +1 -0
- package/lib/module/haptics/types.js +4 -0
- package/lib/module/haptics/types.js.map +1 -0
- package/lib/module/haptics.js +9 -0
- package/lib/module/haptics.js.map +1 -0
- package/lib/module/index.js +8 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/particles/createParticleSystem.js +481 -0
- package/lib/module/particles/createParticleSystem.js.map +1 -0
- package/lib/module/particles/defineParticleEffect.js +178 -0
- package/lib/module/particles/defineParticleEffect.js.map +1 -0
- package/lib/module/particles/errors.js +9 -0
- package/lib/module/particles/errors.js.map +1 -0
- package/lib/module/particles/index.js +8 -0
- package/lib/module/particles/index.js.map +1 -0
- package/lib/module/particles/sampling.js +121 -0
- package/lib/module/particles/sampling.js.map +1 -0
- package/lib/module/particles/types.js +4 -0
- package/lib/module/particles/types.js.map +1 -0
- package/lib/module/particles.js +4 -0
- package/lib/module/particles.js.map +1 -0
- package/lib/module/react/GameButtonPad.js +344 -0
- package/lib/module/react/GameButtonPad.js.map +1 -0
- package/lib/module/react/GamePointerInput.js +74 -16
- package/lib/module/react/GamePointerInput.js.map +1 -1
- package/lib/module/react/GameView.js +139 -60
- package/lib/module/react/GameView.js.map +1 -1
- package/lib/module/react/assets/createGameAssetStore.js +145 -95
- package/lib/module/react/assets/createGameAssetStore.js.map +1 -1
- package/lib/module/react/assets/useGameAssets.js +60 -35
- package/lib/module/react/assets/useGameAssets.js.map +1 -1
- package/lib/module/react/bindAppLifecycle.js +46 -17
- package/lib/module/react/bindAppLifecycle.js.map +1 -1
- package/lib/module/react/bindGameSession.js +13 -2
- package/lib/module/react/bindGameSession.js.map +1 -1
- package/lib/module/react/camera2d/GameLayer2D.js +50 -0
- package/lib/module/react/camera2d/GameLayer2D.js.map +1 -0
- package/lib/module/react/camera2d/defineGameCamera2D.js +30 -0
- package/lib/module/react/camera2d/defineGameCamera2D.js.map +1 -0
- package/lib/module/react/camera2d/usePresentedCameraBinding.js +177 -0
- package/lib/module/react/camera2d/usePresentedCameraBinding.js.map +1 -0
- package/lib/module/react/cleanupList.js +38 -0
- package/lib/module/react/cleanupList.js.map +1 -0
- package/lib/module/react/lifecycleSource.js +49 -0
- package/lib/module/react/lifecycleSource.js.map +1 -0
- package/lib/module/react/particles/ParticleView.js +308 -0
- package/lib/module/react/particles/ParticleView.js.map +1 -0
- package/lib/module/react/particles/culling.js +115 -0
- package/lib/module/react/particles/culling.js.map +1 -0
- package/lib/module/react/particles/index.js +7 -0
- package/lib/module/react/particles/index.js.map +1 -0
- package/lib/module/react/particles/spriteXForm.js +45 -0
- package/lib/module/react/particles/spriteXForm.js.map +1 -0
- package/lib/module/react/particles/useParticlePresentation.js +204 -0
- package/lib/module/react/particles/useParticlePresentation.js.map +1 -0
- package/lib/module/react/pointerBinding.js +55 -17
- package/lib/module/react/pointerBinding.js.map +1 -1
- package/lib/module/react/pointerCamera.js +28 -0
- package/lib/module/react/pointerCamera.js.map +1 -0
- package/lib/module/react/pointerCoalescer.js +16 -9
- package/lib/module/react/pointerCoalescer.js.map +1 -1
- package/lib/module/react/sprites/GameSprite.js +5 -17
- package/lib/module/react/sprites/GameSprite.js.map +1 -1
- package/lib/module/react/sprites/GameWorld2D.js +112 -9
- package/lib/module/react/sprites/GameWorld2D.js.map +1 -1
- package/lib/module/react/sprites/Sprite.js +48 -63
- package/lib/module/react/sprites/Sprite.js.map +1 -1
- package/lib/module/react/sprites/SpriteBatch.js +53 -28
- package/lib/module/react/sprites/SpriteBatch.js.map +1 -1
- package/lib/module/react/sprites/batchVisibility.js +58 -0
- package/lib/module/react/sprites/batchVisibility.js.map +1 -0
- package/lib/module/react/sprites/spriteSelection.js +103 -0
- package/lib/module/react/sprites/spriteSelection.js.map +1 -0
- package/lib/module/react/sprites/spriteTransform.js +46 -25
- package/lib/module/react/sprites/spriteTransform.js.map +1 -1
- package/lib/module/react/tilemap/TileMapLayer2D.js +217 -0
- package/lib/module/react/tilemap/TileMapLayer2D.js.map +1 -0
- package/lib/module/react/tilemap/tilePresentation.js +374 -0
- package/lib/module/react/tilemap/tilePresentation.js.map +1 -0
- package/lib/module/react/useGameSession.js +70 -0
- package/lib/module/react/useGameSession.js.map +1 -0
- package/lib/module/react/useGameSessionStatus.js +46 -0
- package/lib/module/react/useGameSessionStatus.js.map +1 -0
- package/lib/module/react/viewportBinding.js +5 -1
- package/lib/module/react/viewportBinding.js.map +1 -1
- package/lib/module/react.js +12 -1
- package/lib/module/react.js.map +1 -1
- package/lib/module/scene/defineScene.js +17 -0
- package/lib/module/scene/defineScene.js.map +1 -1
- package/lib/module/sprites/sampleSpriteClip.js +66 -6
- package/lib/module/sprites/sampleSpriteClip.js.map +1 -1
- package/lib/module/sprites/spriteAnimationState.js +10 -20
- package/lib/module/sprites/spriteAnimationState.js.map +1 -1
- package/lib/module/sprites.js +11 -0
- package/lib/module/sprites.js.map +1 -0
- package/lib/module/storage/adapters/asyncStorage.js +57 -0
- package/lib/module/storage/adapters/asyncStorage.js.map +1 -0
- package/lib/module/storage/adapters/memory.js +50 -0
- package/lib/module/storage/adapters/memory.js.map +1 -0
- package/lib/module/storage/errors.js +34 -0
- package/lib/module/storage/errors.js.map +1 -0
- package/lib/module/storage/index.js +11 -0
- package/lib/module/storage/index.js.map +1 -0
- package/lib/module/storage/schema.js +151 -0
- package/lib/module/storage/schema.js.map +1 -0
- package/lib/module/storage/serialization.js +249 -0
- package/lib/module/storage/serialization.js.map +1 -0
- package/lib/module/storage/store.js +387 -0
- package/lib/module/storage/store.js.map +1 -0
- package/lib/module/storage/types.js +16 -0
- package/lib/module/storage/types.js.map +1 -0
- package/lib/module/storage/validation.js +111 -0
- package/lib/module/storage/validation.js.map +1 -0
- package/lib/module/storage.js +4 -0
- package/lib/module/storage.js.map +1 -0
- package/lib/module/testing.js +4 -0
- package/lib/module/testing.js.map +1 -1
- package/lib/module/tilemap/chunkStats.js +27 -0
- package/lib/module/tilemap/chunkStats.js.map +1 -0
- package/lib/module/tilemap/definitions.js +308 -0
- package/lib/module/tilemap/definitions.js.map +1 -0
- package/lib/module/tilemap/errors.js +13 -0
- package/lib/module/tilemap/errors.js.map +1 -0
- package/lib/module/tilemap/index.js +10 -0
- package/lib/module/tilemap/index.js.map +1 -0
- package/lib/module/tilemap/movement.js +379 -0
- package/lib/module/tilemap/movement.js.map +1 -0
- package/lib/module/tilemap/queries.js +114 -0
- package/lib/module/tilemap/queries.js.map +1 -0
- package/lib/module/tilemap/tiledAdapter.js +141 -0
- package/lib/module/tilemap/tiledAdapter.js.map +1 -0
- package/lib/module/tilemap/types.js +4 -0
- package/lib/module/tilemap/types.js.map +1 -0
- package/lib/module/tilemap.js +4 -0
- package/lib/module/tilemap.js.map +1 -0
- package/lib/typescript/src/assets/defineAssets.d.ts +1 -1
- package/lib/typescript/src/assets/defineAssets.d.ts.map +1 -1
- package/lib/typescript/src/assets.d.ts +11 -0
- package/lib/typescript/src/assets.d.ts.map +1 -0
- package/lib/typescript/src/audio/createGameAudio.d.ts +5 -0
- package/lib/typescript/src/audio/createGameAudio.d.ts.map +1 -0
- package/lib/typescript/src/audio/errors.d.ts +6 -0
- package/lib/typescript/src/audio/errors.d.ts.map +1 -0
- package/lib/typescript/src/audio/index.d.ts +4 -0
- package/lib/typescript/src/audio/index.d.ts.map +1 -0
- package/lib/typescript/src/audio/resolver.d.ts +44 -0
- package/lib/typescript/src/audio/resolver.d.ts.map +1 -0
- package/lib/typescript/src/audio/types.d.ts +42 -0
- package/lib/typescript/src/audio/types.d.ts.map +1 -0
- package/lib/typescript/src/audio.d.ts +8 -0
- package/lib/typescript/src/audio.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/bounds.d.ts +25 -0
- package/lib/typescript/src/camera2d/bounds.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/extents.d.ts +17 -0
- package/lib/typescript/src/camera2d/extents.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/follow.d.ts +24 -0
- package/lib/typescript/src/camera2d/follow.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/index.d.ts +19 -0
- package/lib/typescript/src/camera2d/index.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/interpolation.d.ts +17 -0
- package/lib/typescript/src/camera2d/interpolation.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/shake.d.ts +20 -0
- package/lib/typescript/src/camera2d/shake.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/transform.d.ts +44 -0
- package/lib/typescript/src/camera2d/transform.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/types.d.ts +74 -0
- package/lib/typescript/src/camera2d/types.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/validation.d.ts +30 -0
- package/lib/typescript/src/camera2d/validation.d.ts.map +1 -0
- package/lib/typescript/src/camera2d/visibility.d.ts +47 -0
- package/lib/typescript/src/camera2d/visibility.d.ts.map +1 -0
- package/lib/typescript/src/camera2d.d.ts +7 -0
- package/lib/typescript/src/camera2d.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/colliders.d.ts +120 -0
- package/lib/typescript/src/collision2d/colliders.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/debug.d.ts +67 -0
- package/lib/typescript/src/collision2d/debug.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/filters.d.ts +28 -0
- package/lib/typescript/src/collision2d/filters.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/index.d.ts +17 -0
- package/lib/typescript/src/collision2d/index.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/intersections.d.ts +24 -0
- package/lib/typescript/src/collision2d/intersections.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/manifolds.d.ts +39 -0
- package/lib/typescript/src/collision2d/manifolds.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/segments.d.ts +24 -0
- package/lib/typescript/src/collision2d/segments.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/spatialHash.d.ts +50 -0
- package/lib/typescript/src/collision2d/spatialHash.d.ts.map +1 -0
- package/lib/typescript/src/collision2d/sweeps.d.ts +60 -0
- package/lib/typescript/src/collision2d/sweeps.d.ts.map +1 -0
- package/lib/typescript/src/collision2d.d.ts +7 -0
- package/lib/typescript/src/collision2d.d.ts.map +1 -0
- package/lib/typescript/src/core/input/buttonPad.d.ts +59 -0
- package/lib/typescript/src/core/input/buttonPad.d.ts.map +1 -0
- package/lib/typescript/src/core/input/createInputBuffer.d.ts +1 -1
- package/lib/typescript/src/core/input/createInputBuffer.d.ts.map +1 -1
- package/lib/typescript/src/core/input/types.d.ts +7 -0
- package/lib/typescript/src/core/input/types.d.ts.map +1 -1
- package/lib/typescript/src/core/session/createGameSession.d.ts +4 -2
- package/lib/typescript/src/core/session/createGameSession.d.ts.map +1 -1
- package/lib/typescript/src/core/session/deepFreeze.d.ts +21 -1
- package/lib/typescript/src/core/session/deepFreeze.d.ts.map +1 -1
- package/lib/typescript/src/core/session/diagnostics.d.ts +2 -0
- package/lib/typescript/src/core/session/diagnostics.d.ts.map +1 -1
- package/lib/typescript/src/core/session/types.d.ts +69 -4
- package/lib/typescript/src/core/session/types.d.ts.map +1 -1
- package/lib/typescript/src/definition/defineGame.d.ts +12 -1
- package/lib/typescript/src/definition/defineGame.d.ts.map +1 -1
- package/lib/typescript/src/definition/types.d.ts +10 -1
- package/lib/typescript/src/definition/types.d.ts.map +1 -1
- package/lib/typescript/src/events/defineGameEvents.d.ts +26 -0
- package/lib/typescript/src/events/defineGameEvents.d.ts.map +1 -0
- package/lib/typescript/src/events/errors.d.ts +12 -0
- package/lib/typescript/src/events/errors.d.ts.map +1 -0
- package/lib/typescript/src/events/index.d.ts +6 -0
- package/lib/typescript/src/events/index.d.ts.map +1 -0
- package/lib/typescript/src/events/payload.d.ts +21 -0
- package/lib/typescript/src/events/payload.d.ts.map +1 -0
- package/lib/typescript/src/events/seed.d.ts +3 -0
- package/lib/typescript/src/events/seed.d.ts.map +1 -0
- package/lib/typescript/src/events/types.d.ts +42 -0
- package/lib/typescript/src/events/types.d.ts.map +1 -0
- package/lib/typescript/src/events.d.ts +12 -0
- package/lib/typescript/src/events.d.ts.map +1 -0
- package/lib/typescript/src/geometry/helpers.d.ts +35 -0
- package/lib/typescript/src/geometry/helpers.d.ts.map +1 -0
- package/lib/typescript/src/geometry/index.d.ts +4 -0
- package/lib/typescript/src/geometry/index.d.ts.map +1 -0
- package/lib/typescript/src/geometry/types.d.ts +49 -0
- package/lib/typescript/src/geometry/types.d.ts.map +1 -1
- package/lib/typescript/src/geometry/validation.d.ts +44 -0
- package/lib/typescript/src/geometry/validation.d.ts.map +1 -0
- package/lib/typescript/src/geometry.d.ts +7 -0
- package/lib/typescript/src/geometry.d.ts.map +1 -0
- package/lib/typescript/src/haptics/createGameHaptics.d.ts +3 -0
- package/lib/typescript/src/haptics/createGameHaptics.d.ts.map +1 -0
- package/lib/typescript/src/haptics/errors.d.ts +6 -0
- package/lib/typescript/src/haptics/errors.d.ts.map +1 -0
- package/lib/typescript/src/haptics/index.d.ts +4 -0
- package/lib/typescript/src/haptics/index.d.ts.map +1 -0
- package/lib/typescript/src/haptics/resolver.d.ts +22 -0
- package/lib/typescript/src/haptics/resolver.d.ts.map +1 -0
- package/lib/typescript/src/haptics/types.d.ts +37 -0
- package/lib/typescript/src/haptics/types.d.ts.map +1 -0
- package/lib/typescript/src/haptics.d.ts +8 -0
- package/lib/typescript/src/haptics.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +10 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/particles/createParticleSystem.d.ts +5 -0
- package/lib/typescript/src/particles/createParticleSystem.d.ts.map +1 -0
- package/lib/typescript/src/particles/defineParticleEffect.d.ts +3 -0
- package/lib/typescript/src/particles/defineParticleEffect.d.ts.map +1 -0
- package/lib/typescript/src/particles/errors.d.ts +5 -0
- package/lib/typescript/src/particles/errors.d.ts.map +1 -0
- package/lib/typescript/src/particles/index.d.ts +6 -0
- package/lib/typescript/src/particles/index.d.ts.map +1 -0
- package/lib/typescript/src/particles/sampling.d.ts +54 -0
- package/lib/typescript/src/particles/sampling.d.ts.map +1 -0
- package/lib/typescript/src/particles/types.d.ts +292 -0
- package/lib/typescript/src/particles/types.d.ts.map +1 -0
- package/lib/typescript/src/particles.d.ts +2 -0
- package/lib/typescript/src/particles.d.ts.map +1 -0
- package/lib/typescript/src/react/GameButtonPad.d.ts +84 -0
- package/lib/typescript/src/react/GameButtonPad.d.ts.map +1 -0
- package/lib/typescript/src/react/GamePointerInput.d.ts.map +1 -1
- package/lib/typescript/src/react/GameView.d.ts +27 -1
- package/lib/typescript/src/react/GameView.d.ts.map +1 -1
- package/lib/typescript/src/react/assets/createGameAssetStore.d.ts.map +1 -1
- package/lib/typescript/src/react/assets/useGameAssets.d.ts.map +1 -1
- package/lib/typescript/src/react/bindAppLifecycle.d.ts +7 -1
- package/lib/typescript/src/react/bindAppLifecycle.d.ts.map +1 -1
- package/lib/typescript/src/react/bindGameSession.d.ts.map +1 -1
- package/lib/typescript/src/react/camera2d/GameLayer2D.d.ts +24 -0
- package/lib/typescript/src/react/camera2d/GameLayer2D.d.ts.map +1 -0
- package/lib/typescript/src/react/camera2d/defineGameCamera2D.d.ts +44 -0
- package/lib/typescript/src/react/camera2d/defineGameCamera2D.d.ts.map +1 -0
- package/lib/typescript/src/react/camera2d/usePresentedCameraBinding.d.ts +22 -0
- package/lib/typescript/src/react/camera2d/usePresentedCameraBinding.d.ts.map +1 -0
- package/lib/typescript/src/react/cleanupList.d.ts +21 -0
- package/lib/typescript/src/react/cleanupList.d.ts.map +1 -0
- package/lib/typescript/src/react/instrumentation.d.ts +33 -3
- package/lib/typescript/src/react/instrumentation.d.ts.map +1 -1
- package/lib/typescript/src/react/lifecycleSource.d.ts +21 -0
- package/lib/typescript/src/react/lifecycleSource.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/ParticleView.d.ts +65 -0
- package/lib/typescript/src/react/particles/ParticleView.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/culling.d.ts +70 -0
- package/lib/typescript/src/react/particles/culling.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/index.d.ts +7 -0
- package/lib/typescript/src/react/particles/index.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/spriteXForm.d.ts +28 -0
- package/lib/typescript/src/react/particles/spriteXForm.d.ts.map +1 -0
- package/lib/typescript/src/react/particles/useParticlePresentation.d.ts +48 -0
- package/lib/typescript/src/react/particles/useParticlePresentation.d.ts.map +1 -0
- package/lib/typescript/src/react/pointerBinding.d.ts +38 -8
- package/lib/typescript/src/react/pointerBinding.d.ts.map +1 -1
- package/lib/typescript/src/react/pointerCamera.d.ts +20 -0
- package/lib/typescript/src/react/pointerCamera.d.ts.map +1 -0
- package/lib/typescript/src/react/pointerCoalescer.d.ts +17 -1
- package/lib/typescript/src/react/pointerCoalescer.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/GameSprite.d.ts +3 -10
- package/lib/typescript/src/react/sprites/GameSprite.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/GameWorld2D.d.ts +51 -6
- package/lib/typescript/src/react/sprites/GameWorld2D.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/Sprite.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/SpriteBatch.d.ts +22 -1
- package/lib/typescript/src/react/sprites/SpriteBatch.d.ts.map +1 -1
- package/lib/typescript/src/react/sprites/batchVisibility.d.ts +28 -0
- package/lib/typescript/src/react/sprites/batchVisibility.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/spriteSelection.d.ts +58 -0
- package/lib/typescript/src/react/sprites/spriteSelection.d.ts.map +1 -0
- package/lib/typescript/src/react/sprites/spriteTransform.d.ts +27 -12
- package/lib/typescript/src/react/sprites/spriteTransform.d.ts.map +1 -1
- package/lib/typescript/src/react/tilemap/TileMapLayer2D.d.ts +69 -0
- package/lib/typescript/src/react/tilemap/TileMapLayer2D.d.ts.map +1 -0
- package/lib/typescript/src/react/tilemap/tilePresentation.d.ts +217 -0
- package/lib/typescript/src/react/tilemap/tilePresentation.d.ts.map +1 -0
- package/lib/typescript/src/react/useGameSession.d.ts +48 -0
- package/lib/typescript/src/react/useGameSession.d.ts.map +1 -0
- package/lib/typescript/src/react/useGameSessionStatus.d.ts +23 -0
- package/lib/typescript/src/react/useGameSessionStatus.d.ts.map +1 -0
- package/lib/typescript/src/react/viewportBinding.d.ts +5 -1
- package/lib/typescript/src/react/viewportBinding.d.ts.map +1 -1
- package/lib/typescript/src/react.d.ts +18 -1
- package/lib/typescript/src/react.d.ts.map +1 -1
- package/lib/typescript/src/scene/defineScene.d.ts +22 -2
- package/lib/typescript/src/scene/defineScene.d.ts.map +1 -1
- package/lib/typescript/src/scene/types.d.ts +24 -4
- package/lib/typescript/src/scene/types.d.ts.map +1 -1
- package/lib/typescript/src/sprites/sampleSpriteClip.d.ts +26 -2
- package/lib/typescript/src/sprites/sampleSpriteClip.d.ts.map +1 -1
- package/lib/typescript/src/sprites/spriteAnimationState.d.ts +6 -7
- package/lib/typescript/src/sprites/spriteAnimationState.d.ts.map +1 -1
- package/lib/typescript/src/sprites.d.ts +10 -0
- package/lib/typescript/src/sprites.d.ts.map +1 -0
- package/lib/typescript/src/storage/adapters/asyncStorage.d.ts +18 -0
- package/lib/typescript/src/storage/adapters/asyncStorage.d.ts.map +1 -0
- package/lib/typescript/src/storage/adapters/memory.d.ts +16 -0
- package/lib/typescript/src/storage/adapters/memory.d.ts.map +1 -0
- package/lib/typescript/src/storage/errors.d.ts +37 -0
- package/lib/typescript/src/storage/errors.d.ts.map +1 -0
- package/lib/typescript/src/storage/index.d.ts +11 -0
- package/lib/typescript/src/storage/index.d.ts.map +1 -0
- package/lib/typescript/src/storage/schema.d.ts +22 -0
- package/lib/typescript/src/storage/schema.d.ts.map +1 -0
- package/lib/typescript/src/storage/serialization.d.ts +23 -0
- package/lib/typescript/src/storage/serialization.d.ts.map +1 -0
- package/lib/typescript/src/storage/store.d.ts +3 -0
- package/lib/typescript/src/storage/store.d.ts.map +1 -0
- package/lib/typescript/src/storage/types.d.ts +69 -0
- package/lib/typescript/src/storage/types.d.ts.map +1 -0
- package/lib/typescript/src/storage/validation.d.ts +24 -0
- package/lib/typescript/src/storage/validation.d.ts.map +1 -0
- package/lib/typescript/src/storage.d.ts +2 -0
- package/lib/typescript/src/storage.d.ts.map +1 -0
- package/lib/typescript/src/testing.d.ts +1 -0
- package/lib/typescript/src/testing.d.ts.map +1 -1
- package/lib/typescript/src/tilemap/chunkStats.d.ts +14 -0
- package/lib/typescript/src/tilemap/chunkStats.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/definitions.d.ts +38 -0
- package/lib/typescript/src/tilemap/definitions.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/errors.d.ts +7 -0
- package/lib/typescript/src/tilemap/errors.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/index.d.ts +8 -0
- package/lib/typescript/src/tilemap/index.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/movement.d.ts +52 -0
- package/lib/typescript/src/tilemap/movement.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/queries.d.ts +21 -0
- package/lib/typescript/src/tilemap/queries.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/tiledAdapter.d.ts +32 -0
- package/lib/typescript/src/tilemap/tiledAdapter.d.ts.map +1 -0
- package/lib/typescript/src/tilemap/types.d.ts +127 -0
- package/lib/typescript/src/tilemap/types.d.ts.map +1 -0
- package/lib/typescript/src/tilemap.d.ts +2 -0
- package/lib/typescript/src/tilemap.d.ts.map +1 -0
- package/package.json +94 -4
- package/src/assets/defineAssets.ts +31 -5
- package/src/assets.ts +27 -0
- package/src/audio/createGameAudio.ts +749 -0
- package/src/audio/errors.ts +12 -0
- package/src/audio/index.ts +9 -0
- package/src/audio/resolver.ts +74 -0
- package/src/audio/types.ts +47 -0
- package/src/audio.ts +13 -0
- package/src/camera2d/bounds.ts +69 -0
- package/src/camera2d/extents.ts +25 -0
- package/src/camera2d/follow.ts +165 -0
- package/src/camera2d/index.ts +29 -0
- package/src/camera2d/interpolation.ts +113 -0
- package/src/camera2d/shake.ts +90 -0
- package/src/camera2d/transform.ts +148 -0
- package/src/camera2d/types.ts +73 -0
- package/src/camera2d/validation.ts +126 -0
- package/src/camera2d/visibility.ts +181 -0
- package/src/camera2d.ts +6 -0
- package/src/collision2d/colliders.ts +292 -0
- package/src/collision2d/debug.ts +133 -0
- package/src/collision2d/filters.ts +48 -0
- package/src/collision2d/index.ts +74 -0
- package/src/collision2d/intersections.ts +82 -0
- package/src/collision2d/manifolds.ts +191 -0
- package/src/collision2d/segments.ts +176 -0
- package/src/collision2d/spatialHash.ts +211 -0
- package/src/collision2d/sweeps.ts +269 -0
- package/src/collision2d.ts +6 -0
- package/src/core/input/buttonPad.ts +235 -0
- package/src/core/input/createInputBuffer.ts +95 -14
- package/src/core/input/types.ts +7 -0
- package/src/core/session/createGameSession.ts +480 -53
- package/src/core/session/deepFreeze.ts +104 -3
- package/src/core/session/diagnostics.ts +2 -0
- package/src/core/session/types.ts +77 -4
- package/src/definition/defineGame.ts +61 -3
- package/src/definition/types.ts +10 -0
- package/src/events/defineGameEvents.ts +46 -0
- package/src/events/errors.ts +14 -0
- package/src/events/index.ts +14 -0
- package/src/events/payload.ts +234 -0
- package/src/events/seed.ts +33 -0
- package/src/events/types.ts +53 -0
- package/src/events.ts +20 -0
- package/src/geometry/helpers.ts +136 -0
- package/src/geometry/index.ts +14 -0
- package/src/geometry/types.ts +54 -0
- package/src/geometry/validation.ts +131 -0
- package/src/geometry.ts +6 -0
- package/src/haptics/createGameHaptics.ts +214 -0
- package/src/haptics/errors.ts +12 -0
- package/src/haptics/index.ts +3 -0
- package/src/haptics/resolver.ts +58 -0
- package/src/haptics/types.ts +48 -0
- package/src/haptics.ts +7 -0
- package/src/index.ts +37 -1
- package/src/particles/createParticleSystem.ts +505 -0
- package/src/particles/defineParticleEffect.ts +164 -0
- package/src/particles/errors.ts +6 -0
- package/src/particles/index.ts +5 -0
- package/src/particles/sampling.ts +141 -0
- package/src/particles/types.ts +327 -0
- package/src/particles.ts +1 -0
- package/src/react/GameButtonPad.tsx +436 -0
- package/src/react/GamePointerInput.tsx +73 -8
- package/src/react/GameView.tsx +160 -61
- package/src/react/assets/createGameAssetStore.ts +140 -107
- package/src/react/assets/useGameAssets.ts +63 -31
- package/src/react/bindAppLifecycle.ts +55 -19
- package/src/react/bindGameSession.ts +12 -2
- package/src/react/camera2d/GameLayer2D.tsx +43 -0
- package/src/react/camera2d/defineGameCamera2D.ts +59 -0
- package/src/react/camera2d/usePresentedCameraBinding.ts +185 -0
- package/src/react/cleanupList.ts +48 -0
- package/src/react/instrumentation.ts +31 -3
- package/src/react/lifecycleSource.ts +58 -0
- package/src/react/particles/ParticleView.tsx +358 -0
- package/src/react/particles/culling.ts +145 -0
- package/src/react/particles/index.ts +6 -0
- package/src/react/particles/spriteXForm.ts +72 -0
- package/src/react/particles/useParticlePresentation.ts +261 -0
- package/src/react/pointerBinding.ts +74 -16
- package/src/react/pointerCamera.ts +33 -0
- package/src/react/pointerCoalescer.ts +36 -10
- package/src/react/sprites/GameSprite.tsx +4 -33
- package/src/react/sprites/GameWorld2D.tsx +113 -7
- package/src/react/sprites/Sprite.tsx +51 -72
- package/src/react/sprites/SpriteBatch.tsx +74 -22
- package/src/react/sprites/batchVisibility.ts +76 -0
- package/src/react/sprites/spriteSelection.ts +133 -0
- package/src/react/sprites/spriteTransform.ts +46 -26
- package/src/react/tilemap/TileMapLayer2D.tsx +274 -0
- package/src/react/tilemap/tilePresentation.ts +491 -0
- package/src/react/useGameSession.ts +90 -0
- package/src/react/useGameSessionStatus.ts +53 -0
- package/src/react/viewportBinding.ts +5 -1
- package/src/react.ts +18 -1
- package/src/scene/defineScene.ts +47 -5
- package/src/scene/types.ts +37 -3
- package/src/sprites/sampleSpriteClip.ts +82 -14
- package/src/sprites/spriteAnimationState.ts +29 -25
- package/src/sprites.ts +22 -0
- package/src/storage/adapters/asyncStorage.ts +77 -0
- package/src/storage/adapters/memory.ts +58 -0
- package/src/storage/errors.ts +88 -0
- package/src/storage/index.ts +18 -0
- package/src/storage/schema.ts +147 -0
- package/src/storage/serialization.ts +248 -0
- package/src/storage/store.ts +380 -0
- package/src/storage/types.ts +76 -0
- package/src/storage/validation.ts +102 -0
- package/src/storage.ts +1 -0
- package/src/testing.ts +4 -0
- package/src/tilemap/chunkStats.ts +24 -0
- package/src/tilemap/definitions.ts +327 -0
- package/src/tilemap/errors.ts +11 -0
- package/src/tilemap/index.ts +10 -0
- package/src/tilemap/movement.ts +368 -0
- package/src/tilemap/queries.ts +136 -0
- package/src/tilemap/tiledAdapter.ts +165 -0
- package/src/tilemap/types.ts +119 -0
- package/src/tilemap.ts +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ordered, transactional release list for multi-stage setup (GS-REACT-02).
|
|
3
|
+
*
|
|
4
|
+
* Platform-neutral: no React import, so the headless binders and the React
|
|
5
|
+
* adapter share it. Stages register their release as they complete; a setup
|
|
6
|
+
* failure releases everything acquired so far, and the final cleanup runs
|
|
7
|
+
* every release in reverse registration order, composing failures
|
|
8
|
+
* losslessly instead of stopping at the first one.
|
|
9
|
+
*/
|
|
10
|
+
export interface CleanupList {
|
|
11
|
+
/** Register a release for a completed setup stage. */
|
|
12
|
+
add(release: () => void): void;
|
|
13
|
+
/**
|
|
14
|
+
* Run every registered release in reverse order. A lone failure rethrows
|
|
15
|
+
* unwrapped; several compose into an `AggregateError` in run order. The
|
|
16
|
+
* list drains, so releasing twice is a no-op.
|
|
17
|
+
*/
|
|
18
|
+
releaseAll(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare function createCleanupList(): CleanupList;
|
|
21
|
+
//# sourceMappingURL=cleanupList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanupList.d.ts","sourceRoot":"","sources":["../../../../src/react/cleanupList.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,GAAG,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,UAAU,IAAI,IAAI,CAAC;CACpB;AAED,wBAAgB,iBAAiB,IAAI,WAAW,CA2B/C"}
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
* binding); pass a plain JS callback.
|
|
17
17
|
*/
|
|
18
18
|
import type { CoalescedPointerEvent } from './pointerCoalescer.js';
|
|
19
|
+
import type { CameraCut2D } from '../camera2d.js';
|
|
20
|
+
import type { ResolvedViewport2D } from '../viewport2d/index.js';
|
|
19
21
|
/** Raw touch kinds as observed by the manual gesture callbacks. */
|
|
20
22
|
export type PointerStageKind = 'down' | 'move' | 'up' | 'cancel';
|
|
21
23
|
/** Pointer pipeline instrumentation (UI runtime callbacks). */
|
|
@@ -30,6 +32,31 @@ export interface GamePointerInstrumentation {
|
|
|
30
32
|
* counted but never sampled.
|
|
31
33
|
*/
|
|
32
34
|
readonly onDispatchResult?: (seq: number, atMs: number, accepted: boolean) => void;
|
|
35
|
+
/**
|
|
36
|
+
* RN runtime: the CAUSE of a rejected packet (T12-RF7) — layout-epoch
|
|
37
|
+
* staleness (rejected before dispatch) or binding staleness (generation
|
|
38
|
+
* mismatch or a disposed binding). One boolean cannot attribute causes.
|
|
39
|
+
*/
|
|
40
|
+
readonly onDispatchRejected?: (cause: 'layout-epoch' | 'binding', seq: number, atMs: number) => void;
|
|
41
|
+
/**
|
|
42
|
+
* RN runtime: one ACCEPTED surface -> world conversion (T12-TF3), with
|
|
43
|
+
* the exact inputs and output of the authoritative binding — surface
|
|
44
|
+
* point, resolved mounted viewport, event-time presented camera cut, and
|
|
45
|
+
* the delivered world coordinate. Lab-only diagnostics; never a second
|
|
46
|
+
* gameplay transform.
|
|
47
|
+
*/
|
|
48
|
+
readonly onPointerSample?: (sample: {
|
|
49
|
+
readonly surface: {
|
|
50
|
+
readonly x: number;
|
|
51
|
+
readonly y: number;
|
|
52
|
+
};
|
|
53
|
+
readonly viewport: ResolvedViewport2D;
|
|
54
|
+
readonly camera: CameraCut2D | undefined;
|
|
55
|
+
readonly world: {
|
|
56
|
+
readonly x: number;
|
|
57
|
+
readonly y: number;
|
|
58
|
+
};
|
|
59
|
+
}) => void;
|
|
33
60
|
/** The trailing-flush sampler mounted (true) or unmounted (false). */
|
|
34
61
|
readonly onSamplerChanged?: (mounted: boolean) => void;
|
|
35
62
|
}
|
|
@@ -38,9 +65,12 @@ export interface GameViewInstrumentation {
|
|
|
38
65
|
/** A commit was presented to the canvas frame shared value. */
|
|
39
66
|
readonly onPresentCommit?: (revision: number, atMs: number) => void;
|
|
40
67
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
68
|
+
* The first UI frame that observed a new commit revision (the alpha
|
|
69
|
+
* clock's reset detects it), delivered ON THE RN RUNTIME: `GameView`
|
|
70
|
+
* detects the revision inside its UI frame callback and deliberately
|
|
71
|
+
* `scheduleOnRN`s this callback, so it must run on JS, never as a
|
|
72
|
+
* worklet. Skia GPU presentation is not proven by this hook, so latency
|
|
73
|
+
* consumers must name the stage honestly.
|
|
44
74
|
*/
|
|
45
75
|
readonly onUiRevisionObserved?: (revision: number, atMs: number) => void;
|
|
46
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../src/react/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../src/react/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAe,CAAC;AAExD,mEAAmE;AACnE,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;AAEjE,+DAA+D;AAC/D,MAAM,WAAW,0BAA0B;IACzC,uDAAuD;IACvD,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxF,yEAAyE;IACzE,QAAQ,CAAC,WAAW,CAAC,EAAE,CACrB,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,EACnC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;IACV;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACnF;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAC5B,KAAK,EAAE,cAAc,GAAG,SAAS,EACjC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,KACT,IAAI,CAAC;IACV;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE;QAClC,QAAQ,CAAC,OAAO,EAAE;YAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7D,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;QACtC,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;QACzC,QAAQ,CAAC,KAAK,EAAE;YAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC5D,KAAK,IAAI,CAAC;IACX,sEAAsE;IACtE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD;AAED,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,+DAA+D;IAC/D,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE;;;;;;;OAOG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { GameLifecycleSource, GameSession, GameSessionStatus } from '../core/session/types.js';
|
|
2
|
+
import type { InputMap, SceneMap } from '../definition/types.js';
|
|
3
|
+
export type { GameLifecycleSource, GameSessionStatus };
|
|
4
|
+
/**
|
|
5
|
+
* Create the read-only lifecycle source for one session. The returned value
|
|
6
|
+
* is a frozen plain value with exactly `getStatus` and `subscribe`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createGameLifecycleSource<TScenes extends SceneMap, TInput extends InputMap>(session: GameSession<TScenes, TInput>): GameLifecycleSource;
|
|
9
|
+
/** Supply the owning session's lifecycle source to a renderer subtree. */
|
|
10
|
+
export declare const GameLifecycleProvider: import("react").Provider<GameLifecycleSource | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* Read the lifecycle source provided by the surrounding `GameView`.
|
|
13
|
+
*
|
|
14
|
+
* `undefined` means the consumer is mounted outside a `GameView` — a
|
|
15
|
+
* legitimate state for screens that drive presentation without a session
|
|
16
|
+
* (they pass no lifecycle to `useParticlePresentation` and keep manual pause
|
|
17
|
+
* independent). Inside a `GameView` the value is always present and is
|
|
18
|
+
* replaced together with the session.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useGameLifecycleSource(): GameLifecycleSource | undefined;
|
|
21
|
+
//# sourceMappingURL=lifecycleSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycleSource.d.ts","sourceRoot":"","sources":["../../../../src/react/lifecycleSource.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EAClB,MAAM,0BAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAqB,CAAC;AAE9D,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,CAAC;AAIvD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,QAAQ,EAAE,MAAM,SAAS,QAAQ,EACzF,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,GACpC,mBAAmB,CAWrB;AAID,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,2DAAgC,CAAC;AAEnE;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,IAAI,mBAAmB,GAAG,SAAS,CAExE"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
2
|
+
import type { SkImage } from '@shopify/react-native-skia';
|
|
3
|
+
import type { ParticleEmissionRecord, ParticleSystem, ParticleUiRegistry } from '../../particles/types.js';
|
|
4
|
+
export interface ParticleViewProps {
|
|
5
|
+
readonly system: ParticleSystem;
|
|
6
|
+
readonly effect: string;
|
|
7
|
+
/** Surface size: px for screen space, world units for world space. */
|
|
8
|
+
readonly width: number;
|
|
9
|
+
readonly height: number;
|
|
10
|
+
/**
|
|
11
|
+
* The presentation handle from `useParticlePresentation`: a scalar
|
|
12
|
+
* active-time clock plus the bounded emission registry. Views are pure
|
|
13
|
+
* readers and NEVER advance the system clock (T15-F1).
|
|
14
|
+
*/
|
|
15
|
+
readonly presentation: {
|
|
16
|
+
readonly clock: SharedValue<number>;
|
|
17
|
+
readonly registry: SharedValue<ParticleUiRegistry>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Sprite source for `kind: 'sprite'` effects — the decoded sheet resolved
|
|
21
|
+
* once at bind time by the caller. Required for sprite effects; a missing
|
|
22
|
+
* source is a structured render error (T15-F3).
|
|
23
|
+
*/
|
|
24
|
+
readonly spriteSource?: {
|
|
25
|
+
readonly image: SkImage;
|
|
26
|
+
readonly frame: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Presentation-only particle renderer.
|
|
36
|
+
*
|
|
37
|
+
* Topology is CONSTANT per effect regardless of capacity (T15-RF5): exactly
|
|
38
|
+
* one React node (`Picture` for shapes, `Atlas` for sprites) plus a single
|
|
39
|
+
* UI-runtime derived worklet that walks the effect's emission records and
|
|
40
|
+
* computes analytic transforms from the scalar active-time clock. No per-slot
|
|
41
|
+
* data crosses the runtime boundary per frame (T15-SF1).
|
|
42
|
+
*
|
|
43
|
+
* Coordinate ownership (GS-PARTICLE-02): `space: 'world'` effects sample in
|
|
44
|
+
* world units and must mount inside world space (no parent transform);
|
|
45
|
+
* `space: 'screen'` effects sample in surface pixels and must mount inside
|
|
46
|
+
* screen space. World culling uses the presented camera when one exists
|
|
47
|
+
* and the resolved viewport bounds otherwise; zoom applies through the
|
|
48
|
+
* camera, and there is no parallax factor on particles by design.
|
|
49
|
+
*/
|
|
50
|
+
export declare function ParticleView({ system, effect, width, height, presentation, spriteSource, }: ParticleViewProps): import("react").JSX.Element;
|
|
51
|
+
/**
|
|
52
|
+
* Analytic transform for one emission at the given ACTIVE time.
|
|
53
|
+
*
|
|
54
|
+
* T15-TF3: opacity honors the definition's fade policy — `fadeOut: true`
|
|
55
|
+
* ramps `1 -> t`, `fadeOut: false` stays fully opaque for the whole life.
|
|
56
|
+
*/
|
|
57
|
+
export declare function sampleEmission(e: ParticleEmissionRecord, now: number, gravityX: number, gravityY: number, fadeOut: boolean): {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
rotation: number;
|
|
61
|
+
scale: number;
|
|
62
|
+
opacity: number;
|
|
63
|
+
alive: boolean;
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=ParticleView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParticleView.d.ts","sourceRoot":"","sources":["../../../../../src/react/particles/ParticleView.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAW,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAEV,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EACnB,MAAM,0BAAuB,CAAC;AAY/B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE;QACrB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACpC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;KACpD,CAAC;IACF;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE;QACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QACxB,QAAQ,CAAC,KAAK,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KACzE,CAAC;CACH;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,MAAM,EACN,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,GACb,EAAE,iBAAiB,+BAsEnB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,sBAAsB,EACzB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,GACf;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAgB5F"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ParticleEffectDefinition } from '../../particles/types.js';
|
|
2
|
+
export interface WorldAabb {
|
|
3
|
+
readonly minX: number;
|
|
4
|
+
readonly minY: number;
|
|
5
|
+
readonly maxX: number;
|
|
6
|
+
readonly maxY: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const PARTICLE_CULL_PADDING = 16;
|
|
9
|
+
/**
|
|
10
|
+
* The world region visible through the PRESENTED camera (T15-RF2).
|
|
11
|
+
*
|
|
12
|
+
* The logical viewport rectangle is rotated/zoomed by the camera, so its
|
|
13
|
+
* axis-aligned world bounds are the center plus the rotated half-extents:
|
|
14
|
+
*
|
|
15
|
+
* ex = |hx·cosθ| + |hy·sinθ|, ey = |hx·sinθ| + |hy·cosθ|
|
|
16
|
+
*
|
|
17
|
+
* which is the exact AABB of the rotated view rect. Padding is applied in
|
|
18
|
+
* world units. Worklet-safe; shared by the shape Picture and Atlas paths so
|
|
19
|
+
* their culling results cannot diverge.
|
|
20
|
+
*/
|
|
21
|
+
export declare function cameraVisibleWorldBounds(camera: SharedCamera | null, viewport: SharedViewport | null, pad: number): WorldAabb | undefined;
|
|
22
|
+
export declare function screenVisibleBounds(width: number, height: number, pad: number): WorldAabb;
|
|
23
|
+
/**
|
|
24
|
+
* Viewport-only world bounds for presentation without a presented camera
|
|
25
|
+
* (GS-PARTICLE-02): the tile layer's viewport-only path — the resolved
|
|
26
|
+
* logical bounds expanded by world-unit padding. World particles inside an
|
|
27
|
+
* ordinary viewport-only GameWorld2D render instead of failing closed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function viewportWorldBounds(viewport: SharedViewport | null, pad: number): WorldAabb | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Circle-vs-bounds visibility (GS-PARTICLE-02): the particle's
|
|
32
|
+
* conservative extent (bounding radius from geometry and scale endpoints)
|
|
33
|
+
* expands the bounds, so partially crossing shapes stay visible while
|
|
34
|
+
* fully outside shapes cull. Extra overscan stays in the bounds padding —
|
|
35
|
+
* never folded into the shape extent. A missing bounds still hides.
|
|
36
|
+
*/
|
|
37
|
+
export declare function visibleInBounds(x: number, y: number, extent: number, b: WorldAabb | undefined): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Conservative per-effect cull extent (GS-PARTICLE-02): the bounding
|
|
40
|
+
* radius of the authored geometry times the largest scale endpoint, so
|
|
41
|
+
* rotation can never push drawn pixels past the culled region. Circles
|
|
42
|
+
* use radius; rectangles and sprites use half the diagonal; absent
|
|
43
|
+
* dimensions fall back to the render defaults. The legacy scale range
|
|
44
|
+
* contributes its maximum; definitions without scale use 1.
|
|
45
|
+
*/
|
|
46
|
+
export declare function maxParticleExtent(definition: ParticleEffectDefinition): number;
|
|
47
|
+
interface SharedCamera {
|
|
48
|
+
readonly value?: {
|
|
49
|
+
readonly camera?: {
|
|
50
|
+
readonly center: {
|
|
51
|
+
readonly x: number;
|
|
52
|
+
readonly y: number;
|
|
53
|
+
};
|
|
54
|
+
readonly zoom: number;
|
|
55
|
+
readonly rotationRadians: number;
|
|
56
|
+
};
|
|
57
|
+
} | undefined;
|
|
58
|
+
}
|
|
59
|
+
interface SharedViewport {
|
|
60
|
+
readonly value?: {
|
|
61
|
+
readonly visibleLogicalBounds?: {
|
|
62
|
+
readonly x: number;
|
|
63
|
+
readonly y: number;
|
|
64
|
+
readonly width: number;
|
|
65
|
+
readonly height: number;
|
|
66
|
+
};
|
|
67
|
+
} | undefined;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=culling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"culling.d.ts","sourceRoot":"","sources":["../../../../../src/react/particles/culling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAAuB,CAAC;AACtE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,GAAG,IAAI,EAC3B,QAAQ,EAAE,cAAc,GAAG,IAAI,EAC/B,GAAG,EAAE,MAAM,GACV,SAAS,GAAG,SAAS,CAiBvB;AAED,wBAAgB,mBAAmB,CACjC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{ useParticlePresentation } from './useParticlePresentation.js';
|
|
4
|
+
export type { ParticlePresentation, SessionStatus } from './useParticlePresentation.js';
|
|
5
|
+
export { particleSpriteXform, assertUniformParticleSpriteRatio } from './spriteXForm.js';
|
|
6
|
+
export { cameraVisibleWorldBounds, screenVisibleBounds, visibleInBounds, PARTICLE_CULL_PADDING } from './culling.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/particles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA2B,CAAC;AACpE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,8BAA2B,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,gCAAgC,EAAE,MAAM,kBAAe,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,cAAW,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ParticleSpriteXformInput {
|
|
2
|
+
/** Sampled CENTER position (surface or world units). */
|
|
3
|
+
readonly x: number;
|
|
4
|
+
readonly y: number;
|
|
5
|
+
/** Sampled rotation in radians. */
|
|
6
|
+
readonly rotation: number;
|
|
7
|
+
/** Sampled uniform scale (scaleOverLife domain). */
|
|
8
|
+
readonly scale: number;
|
|
9
|
+
/** Authored draw size (definition particle.size). */
|
|
10
|
+
readonly drawWidth: number;
|
|
11
|
+
readonly drawHeight: number;
|
|
12
|
+
/** Source frame size in sheet pixels. */
|
|
13
|
+
readonly frameWidth: number;
|
|
14
|
+
readonly frameHeight: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ParticleSpriteXform {
|
|
17
|
+
readonly scos: number;
|
|
18
|
+
readonly ssin: number;
|
|
19
|
+
readonly tx: number;
|
|
20
|
+
readonly ty: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function particleSpriteXform(input: ParticleSpriteXformInput): ParticleSpriteXform;
|
|
23
|
+
/**
|
|
24
|
+
* Validate that the authored size ratio matches the source frame ratio so
|
|
25
|
+
* uniform-scale Atlas drawing preserves the intended aspect.
|
|
26
|
+
*/
|
|
27
|
+
export declare function assertUniformParticleSpriteRatio(drawWidth: number, drawHeight: number, frameWidth: number, frameHeight: number): void;
|
|
28
|
+
//# sourceMappingURL=spriteXForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spriteXForm.d.ts","sourceRoot":"","sources":["../../../../../src/react/particles/spriteXForm.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,mBAAmB,CAgBxF;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,IAAI,CAQN"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
2
|
+
import type { GameLifecycleSource, GameSessionStatus } from '../../core/session/types.js';
|
|
3
|
+
import type { ParticleSystem, ParticleUiRegistry } from '../../particles/types.js';
|
|
4
|
+
export type SessionStatus = GameSessionStatus;
|
|
5
|
+
/**
|
|
6
|
+
* What the presentation hook hands to views (T15-SF1): a SCALAR active-time
|
|
7
|
+
* clock written every running frame, plus the bounded emission registry
|
|
8
|
+
* transferred only when membership changes. No per-frame bulk arrays cross
|
|
9
|
+
* the runtime boundary.
|
|
10
|
+
*/
|
|
11
|
+
export interface ParticlePresentation {
|
|
12
|
+
readonly clock: SharedValue<number>;
|
|
13
|
+
readonly registry: SharedValue<ParticleUiRegistry>;
|
|
14
|
+
/** Imperative manual-pause control, independent of the session source. */
|
|
15
|
+
setManualPaused(paused: boolean): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Own THE exclusive presentation clock for one system (T15-F1/T15-RF3).
|
|
19
|
+
*
|
|
20
|
+
* Per-frame runtime work is ONE scalar write (`clock.value`); the bounded
|
|
21
|
+
* emission registry is transferred only when membership changes (T15-SF1).
|
|
22
|
+
*
|
|
23
|
+
* Pause sources are applied through ONE effect-owned control so transitions
|
|
24
|
+
* stop/start the scheduler immediately — including while the driver is idle
|
|
25
|
+
* or asleep (T15-SF3). Scheduling runs only when the system is running AND
|
|
26
|
+
* at least one particle is active; it fully stops otherwise and restarts
|
|
27
|
+
* from resume/wake transitions.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useParticlePresentation(system: ParticleSystem, options?: {
|
|
30
|
+
/**
|
|
31
|
+
* The owning session's lifecycle source (T20.3) — the preferred way to
|
|
32
|
+
* follow a session. Supplied by `GameView` through
|
|
33
|
+
* `useGameLifecycleSource()`. When set, it takes precedence over the
|
|
34
|
+
* legacy `sessionStatus`/`sessionSubscribe` options.
|
|
35
|
+
*/
|
|
36
|
+
readonly lifecycle?: GameLifecycleSource;
|
|
37
|
+
/** Legacy reader: read the owning session's status each frame / on change. */
|
|
38
|
+
readonly sessionStatus?: () => SessionStatus;
|
|
39
|
+
/** Legacy reactive subscription for session status changes. */
|
|
40
|
+
readonly sessionSubscribe?: (listener: (status: SessionStatus) => void) => () => void;
|
|
41
|
+
/** Independent user/lab pause reader; a running session cannot cancel it. */
|
|
42
|
+
readonly manualPaused?: () => boolean;
|
|
43
|
+
/** Injectable scheduler for deterministic headless/mounted tests. */
|
|
44
|
+
readonly schedule?: (tick: () => void) => () => void;
|
|
45
|
+
/** Injectable clock for deterministic deltas in tests. */
|
|
46
|
+
readonly now?: () => number;
|
|
47
|
+
}): ParticlePresentation;
|
|
48
|
+
//# sourceMappingURL=useParticlePresentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useParticlePresentation.d.ts","sourceRoot":"","sources":["../../../../../src/react/particles/useParticlePresentation.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,6BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EACnB,MAAM,0BAAuB,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACnD,0EAA0E;IAC1E,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CACxC;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,cAAc,EACtB,OAAO,CAAC,EAAE;IACR;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IACzC,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,aAAa,CAAC;IAC7C,+DAA+D;IAC/D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,KACtC,MAAM,IAAI,CAAC;IAChB,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC;IACtC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IACrD,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CAC7B,GACA,oBAAoB,CA2LtB"}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
import type { CameraCut2D } from '../camera2d.js';
|
|
1
2
|
import type { InputController } from '../core/input/types.js';
|
|
2
3
|
import type { Point2D } from '../geometry/types.js';
|
|
3
4
|
import { type ResolvedViewport2D } from '../viewport2d/index.js';
|
|
5
|
+
/** One accepted surface -> world conversion with its exact inputs (T12-TF3). */
|
|
6
|
+
export interface PointerSample2D {
|
|
7
|
+
readonly surface: {
|
|
8
|
+
readonly x: number;
|
|
9
|
+
readonly y: number;
|
|
10
|
+
};
|
|
11
|
+
readonly viewport: ResolvedViewport2D;
|
|
12
|
+
readonly camera: CameraCut2D | undefined;
|
|
13
|
+
readonly world: {
|
|
14
|
+
readonly x: number;
|
|
15
|
+
readonly y: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
4
18
|
import type { CoalescedPointerEvent } from './pointerCoalescer.js';
|
|
5
19
|
/**
|
|
6
20
|
* A coalesced pointer event stamped with the binding epoch it was scheduled
|
|
@@ -8,6 +22,12 @@ import type { CoalescedPointerEvent } from './pointerCoalescer.js';
|
|
|
8
22
|
* replacement carry the old epoch and are rejected on the RN runtime, so a
|
|
9
23
|
* stale begin cannot reacquire input with old coordinates and a stale
|
|
10
24
|
* terminal edge cannot release a newer capture that reused the pointer id.
|
|
25
|
+
*
|
|
26
|
+
* T12-F4: the packet also carries the presented camera cut sampled AT
|
|
27
|
+
* EVENT TIME on the UI runtime. JS inverts through that stamp — never a
|
|
28
|
+
* later lazy read — so the world coordinate matches the camera under the
|
|
29
|
+
* finger when the touch happened, even while the camera follows, zooms,
|
|
30
|
+
* rotates, or shakes.
|
|
11
31
|
*/
|
|
12
32
|
export type PointerPacket = CoalescedPointerEvent & {
|
|
13
33
|
/** Monotonic adapter-owned binding generation (F3 follow-up). */
|
|
@@ -18,6 +38,8 @@ export type PointerPacket = CoalescedPointerEvent & {
|
|
|
18
38
|
readonly seq: number;
|
|
19
39
|
/** UI-runtime timestamp of the forward (F1 latency causality). */
|
|
20
40
|
readonly atMs: number;
|
|
41
|
+
/** The presented camera cut at event time; absent for no-camera games. */
|
|
42
|
+
readonly camera?: CameraCut2D | undefined;
|
|
21
43
|
};
|
|
22
44
|
/** The identity a pointer binding is scoped to. */
|
|
23
45
|
export interface PointerBindingIdentity<TName extends string> {
|
|
@@ -27,6 +49,12 @@ export interface PointerBindingIdentity<TName extends string> {
|
|
|
27
49
|
readonly action: TName;
|
|
28
50
|
/** Identity token for the viewport provider (changes on layout owner swaps). */
|
|
29
51
|
readonly viewport: unknown;
|
|
52
|
+
/**
|
|
53
|
+
* Identity token for the presented camera provider (T12.4). Changes when
|
|
54
|
+
* the camera surface is replaced, so a fresh binding generation stamps
|
|
55
|
+
* packets under the new camera owner.
|
|
56
|
+
*/
|
|
57
|
+
readonly camera: unknown;
|
|
30
58
|
}
|
|
31
59
|
/** A binding plus the identity it was created for. */
|
|
32
60
|
export interface PointerBindingEntry<TName extends string> {
|
|
@@ -45,16 +73,18 @@ export declare function createPointerBinding<TName extends string>(identity: Poi
|
|
|
45
73
|
* Platform-neutral pointer binding seam.
|
|
46
74
|
*
|
|
47
75
|
* It converts gesture positions from surface coordinates into logical world
|
|
48
|
-
* coordinates through the current resolved viewport
|
|
76
|
+
* coordinates through the current resolved viewport (T12.4: and through the
|
|
77
|
+
* currently presented camera when the game has one), rejects begins that
|
|
49
78
|
* start in `fit` letterbox space, and forwards semantic events into the
|
|
50
|
-
* session input buffer.
|
|
79
|
+
* session input buffer. Containment always happens BEFORE camera inversion:
|
|
80
|
+
* letterbox space is rejected regardless of the camera. The high-level `handleTouches*` methods mirror the
|
|
51
81
|
* adapter's touch dispatch (including forwarding the final up position) so
|
|
52
82
|
* the full adapter behavior is testable without mounting native gesture
|
|
53
83
|
* views. Ownership and neutralization live in the input buffer.
|
|
54
84
|
*/
|
|
55
85
|
export declare class PointerBinding<TActionName extends string> {
|
|
56
86
|
#private;
|
|
57
|
-
constructor(action: TActionName, input: InputController<TActionName>, getViewport: () => ResolvedViewport2D | undefined, generation: number);
|
|
87
|
+
constructor(action: TActionName, input: InputController<TActionName>, getViewport: () => ResolvedViewport2D | undefined, generation: number, onSample?: (sample: PointerSample2D) => void);
|
|
58
88
|
/**
|
|
59
89
|
* The monotonic adapter-owned generation this binding belongs to (F3).
|
|
60
90
|
* Generations never reset to zero, so a replacement binding and the
|
|
@@ -78,24 +108,24 @@ export declare class PointerBinding<TActionName extends string> {
|
|
|
78
108
|
* Returns `false` when the layout is invalid or the point starts in
|
|
79
109
|
* letterbox space; the gesture must be rejected and never becomes the owner.
|
|
80
110
|
*/
|
|
81
|
-
begin(pointerId: number, surfacePoint: Point2D): boolean;
|
|
111
|
+
begin(pointerId: number, surfacePoint: Point2D, camera?: CameraCut2D): boolean;
|
|
82
112
|
/** Move a pointer. Conversion remains unbounded outside content bounds. */
|
|
83
|
-
move(pointerId: number, surfacePoint: Point2D): void;
|
|
113
|
+
move(pointerId: number, surfacePoint: Point2D, camera?: CameraCut2D): void;
|
|
84
114
|
/** End a pointer. The owning pointer is released by the input buffer. */
|
|
85
115
|
end(pointerId: number): void;
|
|
86
116
|
/** Cancel the active pointer (gesture cancellation, layout change, unmount). */
|
|
87
117
|
cancel(): void;
|
|
88
118
|
/** Handle a touch-down gesture event with a surface position. */
|
|
89
|
-
handleTouchesDown(pointerId: number, x: number, y: number): boolean;
|
|
119
|
+
handleTouchesDown(pointerId: number, x: number, y: number, camera?: CameraCut2D): boolean;
|
|
90
120
|
/** Handle a touch-move gesture event with a surface position. */
|
|
91
|
-
handleTouchesMove(pointerId: number, x: number, y: number): void;
|
|
121
|
+
handleTouchesMove(pointerId: number, x: number, y: number, camera?: CameraCut2D): void;
|
|
92
122
|
/**
|
|
93
123
|
* Handle a touch-up gesture event with its final surface position.
|
|
94
124
|
*
|
|
95
125
|
* The final position is forwarded before ownership ends so the documented
|
|
96
126
|
* release frame contains the actual point where the pointer lifted.
|
|
97
127
|
*/
|
|
98
|
-
handleTouchesUp(pointerId: number, x: number, y: number): void;
|
|
128
|
+
handleTouchesUp(pointerId: number, x: number, y: number, camera?: CameraCut2D): void;
|
|
99
129
|
/** Handle a platform touch cancellation. */
|
|
100
130
|
handleTouchesCancelled(): void;
|
|
101
131
|
/** Stop forwarding events. Safe to call repeatedly. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointerBinding.d.ts","sourceRoot":"","sources":["../../../../src/react/pointerBinding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAmB,CAAC;AACjD,OAAO,EAAwC,KAAK,kBAAkB,EAAE,MAAM,wBAAe,CAAC;AAC9F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAoB,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"pointerBinding.d.ts","sourceR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rB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO;IAeV,2EAA2E;IAC3E,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI;IAW1E,yEAAyE;IACzE,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAO5B,gFAAgF;IAChF,MAAM,IAAI,IAAI;IAOd,iEAAiE;IACjE,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO;IAIzF,iEAAiE;IACjE,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI;IAItF;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI;IAKpF,4CAA4C;IAC5C,sBAAsB,IAAI,IAAI;IAI9B,uDAAuD;IACvD,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event-time camera selection for pointer packets (T12-SF1, T12-TF1).
|
|
3
|
+
*
|
|
4
|
+
* Internal module (not part of the public barrel): the ONE rule that pairs
|
|
5
|
+
* a forwarded pointer event with the presented camera at the event's own
|
|
6
|
+
* native sample. `GamePointerInput` and the focused tests import the same
|
|
7
|
+
* function, so the test can never drift from production.
|
|
8
|
+
*/
|
|
9
|
+
import type { CameraCut2D } from '../camera2d.js';
|
|
10
|
+
import type { CoalescedPointerEvent } from './pointerCoalescer.js';
|
|
11
|
+
/** A move's explicit capture: `captured: true` even when the value is
|
|
12
|
+
* undefined, so a captured-undefined camera is distinguishable from "no
|
|
13
|
+
* stamp" and never falls back to a later presentation (T12-SF1). */
|
|
14
|
+
export interface PointerCameraCapture2D {
|
|
15
|
+
readonly captured: true;
|
|
16
|
+
readonly value: CameraCut2D | undefined;
|
|
17
|
+
}
|
|
18
|
+
/** The event-time camera for one forwarded event (worklet-safe). */
|
|
19
|
+
export declare function packetCameraFor(forwarded: CoalescedPointerEvent, presented: CameraCut2D | undefined): CameraCut2D | undefined;
|
|
20
|
+
//# sourceMappingURL=pointerCamera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointerCamera.d.ts","sourceRoot":"","sources":["../../../../src/react/pointerCamera.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAoB,CAAC;AAEhE;;oEAEoE;AACpE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;CACzC;AAED,oEAAoE;AACpE,wBAAgB,eAAe,CAC7B,SAAS,EAAE,qBAAqB,EAChC,SAAS,EAAE,WAAW,GAAG,SAAS,GACjC,WAAW,GAAG,SAAS,CASzB"}
|
|
@@ -31,6 +31,13 @@ export type CoalescedPointerEvent = {
|
|
|
31
31
|
readonly pointerId: number;
|
|
32
32
|
readonly x: number;
|
|
33
33
|
readonly y: number;
|
|
34
|
+
/**
|
|
35
|
+
* Opaque event-time stamp (T12-RF3): captured with the native sample
|
|
36
|
+
* that produced this move and carried through deferral, so the
|
|
37
|
+
* presenter pairs coordinates and presentation state from the SAME
|
|
38
|
+
* native sample, never from a later flush frame.
|
|
39
|
+
*/
|
|
40
|
+
readonly stamp?: unknown;
|
|
34
41
|
} | {
|
|
35
42
|
readonly kind: 'end';
|
|
36
43
|
readonly pointerId: number;
|
|
@@ -59,6 +66,7 @@ interface ActivePointer {
|
|
|
59
66
|
readonly pendingMove: {
|
|
60
67
|
readonly x: number;
|
|
61
68
|
readonly y: number;
|
|
69
|
+
readonly stamp?: unknown;
|
|
62
70
|
} | undefined;
|
|
63
71
|
}
|
|
64
72
|
/** Explicit coalescer state stored in one UI-runtime SharedValue. */
|
|
@@ -68,11 +76,19 @@ export interface PointerCoalescerState {
|
|
|
68
76
|
}
|
|
69
77
|
/** One native touch input consumed by the pure coalescer reducer. */
|
|
70
78
|
export type PointerCoalescerInput = {
|
|
71
|
-
readonly kind: 'down' | '
|
|
79
|
+
readonly kind: 'down' | 'up';
|
|
72
80
|
readonly pointerId: number;
|
|
73
81
|
readonly x: number;
|
|
74
82
|
readonly y: number;
|
|
75
83
|
readonly nowMs: number;
|
|
84
|
+
} | {
|
|
85
|
+
readonly kind: 'move';
|
|
86
|
+
readonly pointerId: number;
|
|
87
|
+
readonly x: number;
|
|
88
|
+
readonly y: number;
|
|
89
|
+
readonly nowMs: number;
|
|
90
|
+
/** Event-time stamp paired with this native sample (T12-RF3). */
|
|
91
|
+
readonly stamp?: unknown;
|
|
76
92
|
} | {
|
|
77
93
|
readonly kind: 'cancel';
|
|
78
94
|
readonly nowMs: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointerCoalescer.d.ts","sourceRoot":"","sources":["../../../../src/react/pointerCoalescer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9F;
|
|
1
|
+
{"version":3,"file":"pointerCoalescer.d.ts","sourceRoot":"","sources":["../../../../src/react/pointerCoalescer.ts"],"names":[],"mappings":"AA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C,EAAE,OAAO,CAAC;CAC1B,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/B,+EAA+E;AAC/E,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACnD;AAED,qDAAqD;AACrD,wBAAgB,2BAA2B,CACzC,iBAAiB,EAAE,MAAM,GACxB,qBAAqB,CAGvB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE,qBAAqB,GAC3B,0BAA0B,CAiH5B;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,GAAG,gBAAgB,CAuBlF"}
|
|
@@ -12,6 +12,9 @@ import type { CommitFrame } from '../../core/session/types.js';
|
|
|
12
12
|
import type { SceneSnapshot } from '../../scene/types.js';
|
|
13
13
|
import type { SceneMap } from '../../definition/types.js';
|
|
14
14
|
import type { LoadedImage, LoadedSpriteSheet } from '../../assets/types.js';
|
|
15
|
+
import { spriteFrameNameForClip } from '../../sprites/sampleSpriteClip.js';
|
|
16
|
+
/** Re-exported from the single sampler contract (GS-ANIMATION-01). */
|
|
17
|
+
export { spriteFrameNameForClip };
|
|
15
18
|
/** Interpolation context for the select mapper. */
|
|
16
19
|
export interface GameSpriteSelectContext<TScenes extends SceneMap, TSceneName extends Extract<keyof TScenes, string>> {
|
|
17
20
|
/** The previous commit's snapshot for the selected scene. */
|
|
@@ -61,15 +64,5 @@ export interface GameSpriteProps<TScenes extends SceneMap, TSceneName extends Ex
|
|
|
61
64
|
/** Worklet mapper from the scene snapshots to presentation values. */
|
|
62
65
|
readonly select: (context: GameSpriteSelectContext<TScenes, TSceneName>) => GameSpriteSelection;
|
|
63
66
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Select the frame name for a clip + elapsed time (loop/once semantics).
|
|
66
|
-
* Reads the descriptor's animation table; the result is resolved against
|
|
67
|
-
* the frame rectangles by the caller. Reuses the pure sampler's semantics.
|
|
68
|
-
*/
|
|
69
|
-
export declare function spriteFrameNameForClip(animations: Readonly<Record<string, {
|
|
70
|
-
readonly frames: readonly string[];
|
|
71
|
-
readonly frameDurationMs: number;
|
|
72
|
-
readonly mode: 'loop' | 'once';
|
|
73
|
-
}>>, clip: string, elapsedMs: number): string;
|
|
74
67
|
export declare function GameSprite<TScenes extends SceneMap, TSceneName extends Extract<keyof TScenes, string>>({ scene, commit, alpha, source, anchor, select, }: GameSpriteProps<TScenes, TSceneName>): import("react").JSX.Element;
|
|
75
68
|
//# sourceMappingURL=GameSprite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameSprite.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/GameSprite.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"GameSprite.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/GameSprite.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAmB,KAAK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