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
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `GameWorld2D` — the viewport transform group (T7.6).
|
|
2
|
+
* `GameWorld2D` — the viewport + camera transform group (T7.6, T12.5).
|
|
3
3
|
*
|
|
4
|
-
* Applies the resolved viewport offset/scale
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Applies the resolved viewport offset/scale to all child sprites, and —
|
|
5
|
+
* when the game opts into a camera — composes the presented camera
|
|
6
|
+
* transform BEFORE the viewport. The group's element list maps world ->
|
|
7
|
+
* surface directly; `GameLayer2D` children consume the same camera through
|
|
8
|
+
* the world context and apply only their parallax correction, so layers
|
|
9
|
+
* never double-apply the camera.
|
|
7
10
|
*/
|
|
8
|
-
import type
|
|
11
|
+
import { type ReactNode } from 'react';
|
|
9
12
|
import { type SharedValue } from 'react-native-reanimated';
|
|
13
|
+
import type { CameraCut2D } from '../../camera2d.js';
|
|
10
14
|
import type { ResolvedViewport2D } from '../../viewport2d/types.js';
|
|
11
15
|
/**
|
|
12
16
|
* The viewport transform as a Skia element list:
|
|
@@ -21,9 +25,50 @@ export declare function viewportTransform(viewport: ResolvedViewport2D | undefin
|
|
|
21
25
|
} | {
|
|
22
26
|
readonly scaleY: number;
|
|
23
27
|
})[];
|
|
24
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The composed camera + viewport transform (T12.5).
|
|
30
|
+
*
|
|
31
|
+
* Skia applies the element list last-first, so the list below is the
|
|
32
|
+
* forward mapping `surface = viewport(L + rotate(P - C, -R) * Z)`:
|
|
33
|
+
* translate(-C) -> scale(Z) -> rotate(-R) -> translate(L) -> viewport.
|
|
34
|
+
*/
|
|
35
|
+
export declare function cameraViewportTransform2D(camera: CameraCut2D | undefined, viewport: ResolvedViewport2D | undefined): readonly ({
|
|
36
|
+
readonly translateX: number;
|
|
37
|
+
} | {
|
|
38
|
+
readonly translateY: number;
|
|
39
|
+
} | {
|
|
40
|
+
readonly scaleX: number;
|
|
41
|
+
} | {
|
|
42
|
+
readonly scaleY: number;
|
|
43
|
+
} | {
|
|
44
|
+
readonly rotate: number;
|
|
45
|
+
})[];
|
|
46
|
+
/**
|
|
47
|
+
* The parallax correction for one layer (T12.5).
|
|
48
|
+
*
|
|
49
|
+
* A layer with factor p draws with the camera whose effective center is
|
|
50
|
+
* `C' = L + (C - L) * p` per axis. Since zoom and rotation apply fully at
|
|
51
|
+
* every factor, the correction relative to the parent camera is exactly a
|
|
52
|
+
* translation by `(C - L) * (1 - p)` in world units.
|
|
53
|
+
*/
|
|
54
|
+
export declare function layerParallaxTransform2D(camera: CameraCut2D | undefined, viewport: ResolvedViewport2D | undefined, parallaxX: number, parallaxY: number): readonly ({
|
|
55
|
+
readonly translateX: number;
|
|
56
|
+
} | {
|
|
57
|
+
readonly translateY: number;
|
|
58
|
+
})[];
|
|
59
|
+
/** The camera + viewport context provided by `GameWorld2D`. */
|
|
60
|
+
export interface GameWorldContextValue {
|
|
61
|
+
readonly viewport: SharedValue<ResolvedViewport2D | undefined>;
|
|
62
|
+
readonly camera: SharedValue<CameraCut2D | undefined> | undefined;
|
|
63
|
+
}
|
|
64
|
+
export declare const GameWorldContext: import("react").Context<GameWorldContextValue | null>;
|
|
65
|
+
export declare function GameWorld2D({ viewport, camera, children, }: {
|
|
25
66
|
/** The resolved viewport shared value supplied to the renderer. */
|
|
26
67
|
readonly viewport: SharedValue<ResolvedViewport2D | undefined>;
|
|
68
|
+
/** The presented camera shared value (T12.5); absent keeps the viewport-only path. */
|
|
69
|
+
readonly camera?: SharedValue<CameraCut2D | undefined> | undefined;
|
|
27
70
|
readonly children: ReactNode;
|
|
28
71
|
}): import("react").JSX.Element;
|
|
72
|
+
/** Consume the world context; throws outside `GameWorld2D`. */
|
|
73
|
+
export declare function useGameWorldContext(): GameWorldContextValue;
|
|
29
74
|
//# sourceMappingURL=GameWorld2D.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameWorld2D.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/GameWorld2D.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GameWorld2D.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/GameWorld2D.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAAwB,CAAC;A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AAW,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACnE;AAED,eAAO,MAAM,gBAAgB,uDAAoD,CAAC;AAElF,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,EAAE;IACD,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IAC/D,sFAAsF;IACtF,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACnE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,+BAYA;AAED,+DAA+D;AAC/D,wBAAgB,mBAAmB,IAAI,qBAAqB,CAM3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sprite.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/Sprite.tsx"],"names":[],"mappings":"AAYA,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Sprite.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/Sprite.tsx"],"names":[],"mappings":"AAYA,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAoB,CAAC;AAWzE,OAAO,EAAE,sBAAsB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAmB,CAAC;AAEjF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAC5D,MAAM,MAAM,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O,CAAC,EAAE,uBAAuB,CAAC;CAC5C;AAED,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,KAAK,EACL,IAAI,EACJ,SAAa,EACb,CAAK,EACL,CAAK,EACL,QAAY,EACZ,KAAS,EACT,MAAuB,EACvB,KAAa,EACb,KAAa,EACb,OAAW,EACX,IAAI,EACJ,QAAQ,EACR,OAAc,GACf,EAAE,WAAW,+BA2Fb"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type SharedValue } from 'react-native-reanimated';
|
|
2
|
+
import type { CameraCut2D } from '../../camera2d.js';
|
|
3
|
+
import type { Aabb2D } from '../../geometry/types.js';
|
|
2
4
|
import type { CommitFrame } from '../../core/session/types.js';
|
|
5
|
+
import { batchVisibleBounds2D, intersectsBounds2D } from './batchVisibility.js';
|
|
6
|
+
import type { ResolvedViewport2D } from '../../viewport2d/types.js';
|
|
7
|
+
export { batchVisibleBounds2D, intersectsBounds2D };
|
|
3
8
|
import type { SceneSnapshot } from '../../scene/types.js';
|
|
4
9
|
import type { SceneMap } from '../../definition/types.js';
|
|
5
10
|
import type { LoadedImage, LoadedSpriteSheet } from '../../assets/types.js';
|
|
@@ -36,6 +41,22 @@ export interface SpriteBatchProps<TScenes extends SceneMap, TSceneName extends E
|
|
|
36
41
|
readonly x: number;
|
|
37
42
|
readonly y: number;
|
|
38
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Optional camera culling (T12.6): items whose authored world bounds fall
|
|
46
|
+
* outside the conservative visible region are hidden (zero-size slots)
|
|
47
|
+
* instead of drawn. Slot identity and capacity are unchanged; the
|
|
48
|
+
* simulation never knows culling happened. `bounds` maps an item to its
|
|
49
|
+
* world AABB and runs as a worklet on the UI runtime. A bounds record
|
|
50
|
+
* with non-finite values hides the item (fail-safe: invalid geometry is
|
|
51
|
+
* never drawn); padding must be finite and nonnegative (T12-F5).
|
|
52
|
+
*/
|
|
53
|
+
readonly cull?: {
|
|
54
|
+
readonly camera: SharedValue<CameraCut2D | undefined>;
|
|
55
|
+
readonly viewport: SharedValue<ResolvedViewport2D | undefined>;
|
|
56
|
+
readonly bounds: (item: TItem) => Aabb2D;
|
|
57
|
+
/** Optional world-space padding around the visible region. */
|
|
58
|
+
readonly padding?: number;
|
|
59
|
+
};
|
|
39
60
|
}
|
|
40
|
-
export declare function SpriteBatch<TScenes extends SceneMap, TSceneName extends Extract<keyof TScenes, string>, TItem>({ scene, commit, alpha, source, capacity, select, write, anchor, }: SpriteBatchProps<TScenes, TSceneName, TItem>): import("react").JSX.Element;
|
|
61
|
+
export declare function SpriteBatch<TScenes extends SceneMap, TSceneName extends Extract<keyof TScenes, string>, TItem>({ scene, commit, alpha, source, capacity, select, write, anchor, cull, }: SpriteBatchProps<TScenes, TSceneName, TItem>): import("react").JSX.Element;
|
|
41
62
|
//# sourceMappingURL=SpriteBatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpriteBatch.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/SpriteBatch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpriteBatch.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/SpriteBatch.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA0B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,sBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAAwB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAmB,CAAC;AACvD,OA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AAK,IAAI,CAAC;IAC9E,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7D;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE;QACd,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;QACtD,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;QAC/D,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC;QACzC,8DAA8D;QAC9D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAgBD,wBAAgB,WAAW,CACzB,OAAO,SAAS,QAAQ,EACxB,UAAU,SAAS,OAAO,CAAC,MAAM,OAAO,EAAE,MAAM,CAAC,EACjD,KAAK,EACL,EACA,KAAK,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAuB,EACvB,IAAI,GACL,EAAE,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,+BAiJ9C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Batch culling math (T12.6, T12-F5) — pure and worklet-safe, with no React
|
|
3
|
+
* imports, so the benchmark and headless tests can import them directly.
|
|
4
|
+
*/
|
|
5
|
+
import type { CameraCut2D } from '../../camera2d.js';
|
|
6
|
+
import type { Aabb2D } from '../../geometry/types.js';
|
|
7
|
+
import type { ResolvedViewport2D } from '../../viewport2d/types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Conservative visible bounds for batch culling (T12.6).
|
|
10
|
+
*
|
|
11
|
+
* Worklet-safe inline version of the headless `paddedCameraBounds2D` —
|
|
12
|
+
* the presented camera is already validated at the public boundary, so the
|
|
13
|
+
* per-frame path allocates nothing and validates nothing.
|
|
14
|
+
*/
|
|
15
|
+
export declare function batchVisibleBounds2D(camera: CameraCut2D | undefined, viewport: ResolvedViewport2D | undefined, padding: number): Aabb2D | undefined;
|
|
16
|
+
/** Axis-aligned intersection test, worklet-safe (no validation).
|
|
17
|
+
*
|
|
18
|
+
* Inclusive comparisons, matching the public `intersectsAabbAabb2D`
|
|
19
|
+
* contract (T12-F5): exact boundary contact IS an intersection, so a
|
|
20
|
+
* sprite touching the camera edge is never culled.
|
|
21
|
+
*
|
|
22
|
+
* T12-RF6 malformed-bounds fail-safe: any non-finite field or negative
|
|
23
|
+
* size in EITHER rect hides the item (returns false) before the
|
|
24
|
+
* intersection test — invalid geometry is never drawn. Scalar and
|
|
25
|
+
* allocation-free; no structured error construction on the UI path.
|
|
26
|
+
*/
|
|
27
|
+
export declare function intersectsBounds2D(first: Aabb2D, second: Aabb2D): boolean;
|
|
28
|
+
//# sourceMappingURL=batchVisibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batchVisibility.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/batchVisibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAAwB,CAAC;AAEjE;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,QAAQ,EAAE,kBAAkB,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAmBpB;AAcD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAWzE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared sprite frame selection (GS-ANIMATION-01).
|
|
3
|
+
*
|
|
4
|
+
* The single headless selection contract behind `Sprite`'s rect modifier
|
|
5
|
+
* and `GameSprite`'s frame-name derivation: an explicit frame wins,
|
|
6
|
+
* otherwise clip + elapsed time resolve through the pure sampler. Absent
|
|
7
|
+
* selection (nothing chosen yet) presents nothing without throwing;
|
|
8
|
+
* invalid clips and frames fail clearly instead of masking bad data.
|
|
9
|
+
*
|
|
10
|
+
* Headless-safe: only type imports plus the pure sampler, so the same
|
|
11
|
+
* functions execute identically in tests and on the UI runtime. Every
|
|
12
|
+
* function carries the worklet directive for UI execution; the reachable
|
|
13
|
+
* call graph is plain arithmetic plus plain `Error` construction
|
|
14
|
+
* (GS-ANIMATION-02).
|
|
15
|
+
*/
|
|
16
|
+
import type { LoadedImage, LoadedSpriteSheet } from '../../assets/types.js';
|
|
17
|
+
import type { SpriteFrameRect } from './spriteTransform.js';
|
|
18
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
19
|
+
/** A static value or a UI-runtime shared value carrying it. Shared-value
|
|
20
|
+
* payloads list both the exact and the undefined-extended shapes because
|
|
21
|
+
* shared values are invariant in their payload. */
|
|
22
|
+
export type SpriteSelectable<T> = T | SharedValue<T>;
|
|
23
|
+
/** Selection props as the Sprite/GameSprite call sites declare them. */
|
|
24
|
+
export type SpriteFrameProp = string | SharedValue<string> | SharedValue<string | undefined> | undefined;
|
|
25
|
+
export type SpriteClipProp = string | SharedValue<string> | undefined;
|
|
26
|
+
/** The discrete selection inputs for one sprite (all optional). */
|
|
27
|
+
export interface SpriteSelection {
|
|
28
|
+
/** The exact frame name; overrides clip + elapsedMs. */
|
|
29
|
+
readonly frame?: string;
|
|
30
|
+
/** The clip to select from the sprite sheet. */
|
|
31
|
+
readonly clip?: string;
|
|
32
|
+
/** Elapsed time within the clip in milliseconds. */
|
|
33
|
+
readonly elapsedMs?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the source rectangle for a selection.
|
|
37
|
+
*
|
|
38
|
+
* Returns `undefined` for absent selection (present nothing); throws for
|
|
39
|
+
* unknown clips and frames.
|
|
40
|
+
*/
|
|
41
|
+
export declare function selectSpriteFrameRect(source: LoadedImage | LoadedSpriteSheet, selection: SpriteSelection): SpriteFrameRect | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Materialize mixed static/shared selection props into one plain selection
|
|
44
|
+
* (GS-SPRITE-03): every worklet that resolves frames — rect, transform, and
|
|
45
|
+
* Group correction — starts from this single helper, so clip-driven frame
|
|
46
|
+
* changes reach every consumer coherently.
|
|
47
|
+
*/
|
|
48
|
+
export declare function materializeSpriteSelection(frame: SpriteFrameProp, clip: SpriteClipProp, elapsedMs: SpriteSelectable<number> | undefined): SpriteSelection;
|
|
49
|
+
/** A Skia rect-buffer entry (structural: only `setXYWH` is used). */
|
|
50
|
+
export interface SpriteRectBuffer {
|
|
51
|
+
setXYWH(x: number, y: number, width: number, height: number): void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Apply a selection to a rect-buffer entry: the component callback logic
|
|
55
|
+
* behind `Sprite`'s modifier, executed here so tests observe it directly.
|
|
56
|
+
*/
|
|
57
|
+
export declare function applySpriteFrameSelection(rect: SpriteRectBuffer, source: LoadedImage | LoadedSpriteSheet, selection: SpriteSelection): void;
|
|
58
|
+
//# sourceMappingURL=spriteSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spriteSelection.d.ts","sourceRoot":"","sources":["../../../../../src/react/sprites/spriteSelection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAA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 export declare function resolveSpriteFrameRect(source: LoadedImage | LoadedSprit
|
|
|
22
22
|
* `[0, 0, frameWidth, frameHeight]` in local space and the documented pivot
|
|
23
23
|
* order is:
|
|
24
24
|
*
|
|
25
|
-
* M = T(x, y) · R(rotation) ·
|
|
25
|
+
* M = T(x, y) · R(rotation) · S(scaleX, scaleY) · T(-anchor)
|
|
26
26
|
*
|
|
27
|
-
* i.e. scale and explicit flips happen around the anchor
|
|
28
|
-
* rotates around the anchor at the world
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* i.e. uniform scale and explicit flips happen around the anchor in the
|
|
28
|
+
* local frame, then the frame rotates around the anchor at the world
|
|
29
|
+
* position. The invariant: the anchor maps to `(x, y)` under every scale,
|
|
30
|
+
* rotation, and flip (GS-SPRITE-01).
|
|
31
|
+
*
|
|
32
|
+
* Split across Skia's retained primitives (the Atlas RSXform is innermost,
|
|
33
|
+
* the wrapping Group is outermost): the RSXform carries `T·R·S` with the
|
|
34
|
+
* pivot pre-compensated, so no-flip sprites need no Group transform at
|
|
35
|
+
* all; reflection — which an RSXform cannot express — is isolated in the
|
|
36
|
+
* Group as a mirror that fixes the world anchor
|
|
37
|
+
* (`T(x,y)·R·F·R⁻¹·T(−x,−y)`).
|
|
31
38
|
*/
|
|
32
39
|
import type { SharedValue } from 'react-native-reanimated';
|
|
33
40
|
/** A sprite's presentation input; numbers or UI-runtime animated values. */
|
|
@@ -56,7 +63,7 @@ export interface SpriteRsxform {
|
|
|
56
63
|
readonly tx: number;
|
|
57
64
|
readonly ty: number;
|
|
58
65
|
}
|
|
59
|
-
/** A Skia-compatible 3x3 transform element list. */
|
|
66
|
+
/** A Skia-compatible 3x3 transform element list (rotation in radians). */
|
|
60
67
|
export type SkiaTransformElement = {
|
|
61
68
|
readonly translateX: number;
|
|
62
69
|
} | {
|
|
@@ -65,17 +72,25 @@ export type SkiaTransformElement = {
|
|
|
65
72
|
readonly scaleX: number;
|
|
66
73
|
} | {
|
|
67
74
|
readonly scaleY: number;
|
|
75
|
+
} | {
|
|
76
|
+
readonly rotate: number;
|
|
68
77
|
};
|
|
69
78
|
/**
|
|
70
|
-
* The RSXform for the atlas path:
|
|
71
|
-
* compensated (`
|
|
72
|
-
*
|
|
79
|
+
* The RSXform for the atlas path: `T(x,y)·R·S` with the pivot
|
|
80
|
+
* pre-compensated (`t = p − s·R·pivot`), so the anchor lands exactly on
|
|
81
|
+
* `(x, y)` (GS-SPRITE-01/02). Uniform scale is encoded in the
|
|
82
|
+
* coefficients; the batch path shares this helper and needs no Group.
|
|
73
83
|
*/
|
|
74
84
|
export declare function computeSpriteRsxform(input: SpriteTransformInput): SpriteRsxform;
|
|
75
85
|
/**
|
|
76
|
-
* The
|
|
77
|
-
*
|
|
78
|
-
*
|
|
86
|
+
* The reflection part as a Skia transform element list, outermost first.
|
|
87
|
+
*
|
|
88
|
+
* Without flips the RSXform alone carries the transform, so the correction
|
|
89
|
+
* is empty (identity). With flips it is the anchor-fixing mirror
|
|
90
|
+
* `T(x,y)·R·F·R⁻¹·T(−x,−y)`: mirroring about the rotated anchor axes while
|
|
91
|
+
* the world anchor stays fixed. Depends on position and rotation (not just
|
|
92
|
+
* the pivot), so callers must derive it on the UI runtime from live values
|
|
93
|
+
* — never memoize it from stale React-render reads (GS-SPRITE-01).
|
|
79
94
|
*/
|
|
80
95
|
export declare function spriteGroupCorrection(input: SpriteTransformInput): readonly SkiaTransformElement[];
|
|
81
96
|
/** World position of the anchor point (for debugging and overlays). */
|
|
@@ -1 +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,C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B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB,CAMA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { SkImage } from '@shopify/react-native-skia';
|
|
2
|
+
import type { TileMap2D } from '../../tilemap/types.js';
|
|
3
|
+
export interface TileMapLayer2DProps {
|
|
4
|
+
/** The normalized immutable map. */
|
|
5
|
+
readonly map: TileMap2D;
|
|
6
|
+
/** Which layer to draw. */
|
|
7
|
+
readonly layer: string;
|
|
8
|
+
/**
|
|
9
|
+
* Decoded sheet plus resolved frame rectangles — resolve ONCE at bind
|
|
10
|
+
* time via the asset store. Frame dimensions must equal the map cell
|
|
11
|
+
* dimensions in v1.
|
|
12
|
+
*/
|
|
13
|
+
readonly source: {
|
|
14
|
+
readonly image: SkImage;
|
|
15
|
+
readonly frames: Readonly<Record<string, {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
}>>;
|
|
21
|
+
};
|
|
22
|
+
/** Surface size: px for screen space, world units for world space. */
|
|
23
|
+
readonly width: number;
|
|
24
|
+
readonly height: number;
|
|
25
|
+
/** Extra visible cells around the camera bounds. Default 1. */
|
|
26
|
+
readonly overscan?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Coherent parallax contract (T16-RF2): ONE factor drives BOTH the visual
|
|
29
|
+
* correction applied to this layer's Atlas AND the culling bounds —
|
|
30
|
+
* callers never wrap this component in an outer GameLayer2D to duplicate
|
|
31
|
+
* the factor.
|
|
32
|
+
*/
|
|
33
|
+
readonly parallax?: {
|
|
34
|
+
readonly x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Bounded zoom-out contract (T16-RF2): the slot buffer is sized for a
|
|
39
|
+
* camera zoomed out to AT MOST `1 / minZoom`. Presented cameras zooming
|
|
40
|
+
* below this bound are rejected — every slot hides and a one-shot RN-side
|
|
41
|
+
* diagnostic fires — rather than silently returning a partially filled
|
|
42
|
+
* region. Default 1 (no zoom-out headroom).
|
|
43
|
+
*/
|
|
44
|
+
readonly minZoom?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Stable-topology Atlas tile layer (T16.4, reworked per T16-F3/F4/RF1/RF2).
|
|
48
|
+
*
|
|
49
|
+
* One React node per layer. The slot buffer is sized from the passed
|
|
50
|
+
* surface bounds + minZoom + overscan + cell size — NOT from map
|
|
51
|
+
* dimensions. The worklet never touches the map value, `layer.data`, or a
|
|
52
|
+
* JS `Map`:
|
|
53
|
+
*
|
|
54
|
+
* - Frame rectangles are pre-resolved into a flat numeric table at bind
|
|
55
|
+
* time (validated: missing frames and cell/frame size mismatches throw
|
|
56
|
+
* structured bind errors).
|
|
57
|
+
* - A bounded window snapshot (ids sized by slot capacity) is built on JS
|
|
58
|
+
* and transferred via a shared value ONLY when the visible cell span
|
|
59
|
+
* outgrows the current window; requests cross to React through
|
|
60
|
+
* `scheduleOnRN` (Reanimated 4 / react-native-worklets), and camera
|
|
61
|
+
* interpolation inside the window is allocation-free scalar math.
|
|
62
|
+
* - Culling bounds derive from the presented camera (center/zoom/rotation)
|
|
63
|
+
* with the SAME parallax factor applied to the visual transform and the
|
|
64
|
+
* bounds; without a presented camera the viewport-only world path applies.
|
|
65
|
+
* - Culling here can never affect simulation: collision queries read full
|
|
66
|
+
* layer data through the private chunk index regardless of visibility.
|
|
67
|
+
*/
|
|
68
|
+
export declare function TileMapLayer2D({ map, layer, source, width, height, overscan, parallax, minZoom, }: TileMapLayer2DProps): import("react").JSX.Element;
|
|
69
|
+
//# sourceMappingURL=TileMapLayer2D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TileMapLayer2D.d.ts","sourceRoot":"","sources":["../../../../../src/react/tilemap/TileMapLayer2D.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAK1D,OAAO,KAAK,EAAE,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and UI-runtime worklets:
|
|
6
|
+
*
|
|
7
|
+
* - `buildFrameTable` runs ONCE on JS at bind time and produces a flat,
|
|
8
|
+
* worklet-safe numeric lookup (`frameFlat[id*4..id*4+3]`) — no `Map`,
|
|
9
|
+
* no objects, no per-frame lookups on the UI runtime.
|
|
10
|
+
* - `buildTileWindowSnapshot` runs on JS whenever the visible cell window
|
|
11
|
+
* or source binding changes and produces a BOUNDED snapshot sized by the
|
|
12
|
+
* viewport capacity, never by map dimensions.
|
|
13
|
+
* - `writeLayerVisibleBounds` / `fillTileSlots` are worklet-callable and
|
|
14
|
+
* allocation-free: camera interpolation inside the transferred window
|
|
15
|
+
* only reads scalars and pre-transferred arrays.
|
|
16
|
+
*
|
|
17
|
+
* Full map authority stays on the simulation side; the UI runtime never
|
|
18
|
+
* sees `layer.data`, the chunk index, or the map value itself.
|
|
19
|
+
*/
|
|
20
|
+
/** Flat numeric frame lookup: frameFlat[tileId*4] = x, [+1]=y, [+2]=w, [+3]=h. */
|
|
21
|
+
export type TileFrameTable = readonly number[];
|
|
22
|
+
/**
|
|
23
|
+
* Resolve every declared tile to sheet-frame rectangles ONCE at bind time.
|
|
24
|
+
*
|
|
25
|
+
* Throws a structured error when a referenced frame is missing from the
|
|
26
|
+
* bound sheet OR when its size differs from the map cell — v1 requires
|
|
27
|
+
* frame dimensions to equal cell dimensions (T16-F3).
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildFrameTable(tileset: TileSet2D, frames: Readonly<Record<string, {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
}>>, cellWidth: number, cellHeight: number): TileFrameTable;
|
|
35
|
+
/** Bounded visible-window snapshot transferred to the UI runtime. */
|
|
36
|
+
export interface TileWindowSnapshot {
|
|
37
|
+
/** Window origin in cell coordinates. */
|
|
38
|
+
readonly x0: number;
|
|
39
|
+
readonly y0: number;
|
|
40
|
+
/** Window extent in cells (ids.length === w*h). */
|
|
41
|
+
readonly w: number;
|
|
42
|
+
readonly h: number;
|
|
43
|
+
/** Row-major tile ids for the window; 0 = empty. */
|
|
44
|
+
readonly ids: readonly number[];
|
|
45
|
+
/** Flat frame lookup shared by all windows of one binding. */
|
|
46
|
+
readonly frameFlat: readonly number[];
|
|
47
|
+
/**
|
|
48
|
+
* Binding generation that published this window (GS-TILE-01). Stamp
|
|
49
|
+
* applied by the binding when it publishes; snapshots built directly
|
|
50
|
+
* (tests, initial empty) carry no generation and never satisfy a bound
|
|
51
|
+
* update. A generation mismatch means a same-size replacement or a
|
|
52
|
+
* remount happened: the window is ignored, never displayed.
|
|
53
|
+
*/
|
|
54
|
+
readonly gen?: number;
|
|
55
|
+
}
|
|
56
|
+
export declare const EMPTY_TILE_WINDOW: TileWindowSnapshot;
|
|
57
|
+
/**
|
|
58
|
+
* Build a bounded snapshot for the inclusive cell range [x0..x1]×[y0..y1].
|
|
59
|
+
* The range is clamped to the layer; the result size depends ONLY on the
|
|
60
|
+
* requested range (bounded by viewport capacity), never on map size.
|
|
61
|
+
*/
|
|
62
|
+
export declare function buildTileWindowSnapshot(map: TileMap2D, layerId: string, x0: number, y0: number, x1: number, y1: number, frameFlat: TileFrameTable): TileWindowSnapshot;
|
|
63
|
+
/** Whether the snapshot fully covers the inclusive cell range. */
|
|
64
|
+
export declare function windowCovers(snap: TileWindowSnapshot, x0: number, y0: number, x1: number, y1: number): boolean;
|
|
65
|
+
interface SharedLike<T> {
|
|
66
|
+
readonly value?: T;
|
|
67
|
+
}
|
|
68
|
+
export type SharedCameraRef = SharedLike<{
|
|
69
|
+
camera?: {
|
|
70
|
+
center: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
};
|
|
74
|
+
zoom: number;
|
|
75
|
+
rotationRadians: number;
|
|
76
|
+
};
|
|
77
|
+
} | undefined>;
|
|
78
|
+
export type SharedViewportRef = SharedLike<{
|
|
79
|
+
visibleLogicalBounds?: {
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
};
|
|
85
|
+
} | undefined>;
|
|
86
|
+
export interface LayerBounds {
|
|
87
|
+
minX: number;
|
|
88
|
+
minY: number;
|
|
89
|
+
maxX: number;
|
|
90
|
+
maxY: number;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Write the conservative world-space bounds visible through the PRESENTED
|
|
94
|
+
* camera into `out` (T16-F3, reworked per T16-RF2).
|
|
95
|
+
*
|
|
96
|
+
* - With a presented camera: the logical view rect is rotated/zoomed by the
|
|
97
|
+
* camera, so its axis-aligned world bounds are the center plus rotated
|
|
98
|
+
* half-extents; the GameLayer2D parallax model applies ONCE afterwards
|
|
99
|
+
* (effective layer center C′ = L + (C − L)·p; zoom and rotation apply
|
|
100
|
+
* fully at every factor). Padding is world units.
|
|
101
|
+
* - WITHOUT a presented camera, GameWorld2D's viewport-only path applies:
|
|
102
|
+
* the bounds are `viewport.visibleLogicalBounds` expanded by the padding.
|
|
103
|
+
*
|
|
104
|
+
* Worklet-callable and allocation-free on the steady path: scalars only,
|
|
105
|
+
* results written into the caller-owned `out` scratch object. Returns false
|
|
106
|
+
* when no viewport bounds exist yet.
|
|
107
|
+
*/
|
|
108
|
+
export declare function writeLayerVisibleBounds(camera: SharedCameraRef | null, viewport: SharedViewportRef | null, parallaxX: number, parallaxY: number, paddingWorld: number): LayerBounds | null;
|
|
109
|
+
/** Slot-buffer contract shared by the component and tests. */
|
|
110
|
+
export interface TileSlotBuffers {
|
|
111
|
+
readonly rects: readonly (SlotRect | undefined)[];
|
|
112
|
+
readonly xforms: readonly (SlotXform | undefined)[];
|
|
113
|
+
}
|
|
114
|
+
export interface SlotRect {
|
|
115
|
+
setXYWH(x: number, y: number, w: number, h: number): void;
|
|
116
|
+
}
|
|
117
|
+
export interface SlotXform {
|
|
118
|
+
set(scos: number, ssin: number, tx: number, ty: number): void;
|
|
119
|
+
}
|
|
120
|
+
export interface FillParams {
|
|
121
|
+
readonly cw: number;
|
|
122
|
+
readonly ch: number;
|
|
123
|
+
readonly originX: number;
|
|
124
|
+
readonly originY: number;
|
|
125
|
+
readonly layerWidth: number;
|
|
126
|
+
readonly layerHeight: number;
|
|
127
|
+
readonly capacity: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Fill Atlas slot buffers from the transferred window for the currently
|
|
131
|
+
* visible cell span (worklet-callable, T16-F3/F4).
|
|
132
|
+
*
|
|
133
|
+
* - Cell range derives from `bounds` (already camera+parallax+padding).
|
|
134
|
+
* - Tiles place UNROTATED at their CELL TOP-LEFT: the RSXform translation
|
|
135
|
+
* is the cell's world top-left corner.
|
|
136
|
+
* - Stale slots past the filled count are hidden atomically (zero-size).
|
|
137
|
+
* - Returns the filled slot count on success; returns -1 when the window
|
|
138
|
+
* does not cover the visible span (caller should request a new window)
|
|
139
|
+
* and -2 when the visible span exceeds the fixed capacity (caller must
|
|
140
|
+
* hide the whole layer and never claim partial success) — T16-SF2.
|
|
141
|
+
*/
|
|
142
|
+
export declare function fillTileSlots(snap: TileWindowSnapshot, bounds: LayerBounds, rects: readonly (SlotRect | undefined)[], xforms: readonly (SlotXform | undefined)[], params: FillParams): number;
|
|
143
|
+
/**
|
|
144
|
+
* Mint (or recall) the generation for one binding identity object. The
|
|
145
|
+
* component creates a fresh identity per binding-affecting prop change, so
|
|
146
|
+
* each binding gets a distinct generation with no counters in React state.
|
|
147
|
+
*/
|
|
148
|
+
export declare function bindingGeneration(binding: object): number;
|
|
149
|
+
/** Shared-value mirrors kept structural so headless fakes can drive updates. */
|
|
150
|
+
export interface TileWindowShared {
|
|
151
|
+
value: TileWindowSnapshot;
|
|
152
|
+
}
|
|
153
|
+
export interface TileNumberShared {
|
|
154
|
+
value: number;
|
|
155
|
+
}
|
|
156
|
+
export interface TileBooleanShared {
|
|
157
|
+
value: boolean;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Inputs for one tile-layer UI update (GS-TILE-01).
|
|
161
|
+
*
|
|
162
|
+
* Everything the update may touch is listed here: scalars, shared values,
|
|
163
|
+
* buffers, and callbacks. Map, layer, and frame-table objects are
|
|
164
|
+
* deliberately absent — the UI closure provably cannot capture layer data
|
|
165
|
+
* because it is never passed (scalar layer dims travel in `layerWidth` /
|
|
166
|
+
* `layerHeight`). The binding `generation` gates every window and request.
|
|
167
|
+
*/
|
|
168
|
+
export interface TileLayerUIParams {
|
|
169
|
+
readonly camera: SharedCameraRef | null;
|
|
170
|
+
readonly viewport: SharedViewportRef | null;
|
|
171
|
+
readonly window: TileWindowShared;
|
|
172
|
+
/** Generation of the in-flight request, or -1 when none is pending. */
|
|
173
|
+
readonly pendingGen: TileNumberShared;
|
|
174
|
+
readonly warnedCapacity: TileBooleanShared;
|
|
175
|
+
readonly capacityWarnPending: TileBooleanShared;
|
|
176
|
+
readonly rects: {
|
|
177
|
+
value: readonly (SlotRect | undefined)[];
|
|
178
|
+
};
|
|
179
|
+
readonly xforms: {
|
|
180
|
+
value: readonly (SlotXform | undefined)[];
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Publish a window for `gen` (JS side). Stale deliveries whose `gen`
|
|
184
|
+
* predates the publisher's binding are rejected before publishing; the
|
|
185
|
+
* update additionally refuses to display any window whose stamp differs
|
|
186
|
+
* from the live generation.
|
|
187
|
+
*/
|
|
188
|
+
readonly requestWindow: (gen: number, x0: number, y0: number, x1: number, y1: number) => void;
|
|
189
|
+
/** Bridge crossing to the JS side (scheduleOnRN in production). */
|
|
190
|
+
readonly scheduleOnRN: (fn: () => void) => void;
|
|
191
|
+
readonly onBeyondCapacity: () => void;
|
|
192
|
+
readonly generation: number;
|
|
193
|
+
readonly capacity: number;
|
|
194
|
+
readonly originX: number;
|
|
195
|
+
readonly originY: number;
|
|
196
|
+
readonly cw: number;
|
|
197
|
+
readonly ch: number;
|
|
198
|
+
readonly layerWidth: number;
|
|
199
|
+
readonly layerHeight: number;
|
|
200
|
+
readonly padWorld: number;
|
|
201
|
+
readonly px: number;
|
|
202
|
+
readonly py: number;
|
|
203
|
+
readonly minZoom: number;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* One tile-layer UI update: the body of the layer's derived value,
|
|
207
|
+
* extracted so binding identity, stale-request rejection, and capacity
|
|
208
|
+
* policy execute identically in tests and on the UI runtime (GS-TILE-01).
|
|
209
|
+
*
|
|
210
|
+
* Returns the filled slot count; -1 when a window was requested, -2 when
|
|
211
|
+
* the span exceeds capacity or zoom left the declared bounds, 0 when
|
|
212
|
+
* nothing is visible. A window whose generation stamp differs from the
|
|
213
|
+
* live binding is treated exactly like a missing window.
|
|
214
|
+
*/
|
|
215
|
+
export declare function updateTileLayerUI(params: TileLayerUIParams): number;
|
|
216
|
+
export {};
|
|
217
|
+
//# sourceMappingURL=tilePresentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tilePresentation.d.ts","sourceRoot":"","sources":["../../../../../src/react/tilemap/tilePresentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAqB,CAAC;AAGhE;;;;;;;;;;;;;;;;;GAiBG;AAEH,kFAAkF;AAClF,MAAM,MAAM,cAAc,GAAG,SAAS,MAAM,EAAE,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,EACzF,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,cAAc,CAuBhB;AAED,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM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