cubeforge 0.4.13 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +118 -2
- package/dist/index.js +541 -230
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -750,8 +750,30 @@ interface TilemapProps {
|
|
|
750
750
|
* row-run (legacy behaviour).
|
|
751
751
|
*/
|
|
752
752
|
mergeColliders?: boolean;
|
|
753
|
+
/**
|
|
754
|
+
* Array of tile GIDs (global IDs) to treat as solid, regardless of layer.
|
|
755
|
+
* When set, only tiles whose GID is in this array generate colliders in
|
|
756
|
+
* the collision layer. Without this, ALL non-zero tiles in the collision
|
|
757
|
+
* layer produce colliders.
|
|
758
|
+
*/
|
|
759
|
+
solidTiles?: number[];
|
|
760
|
+
/**
|
|
761
|
+
* When true, also scan visual layers for tiles whose GID matches
|
|
762
|
+
* `solidTiles` and auto-generate colliders from them — no separate
|
|
763
|
+
* collision layer required. Default: false.
|
|
764
|
+
*/
|
|
765
|
+
autoColliders?: boolean;
|
|
766
|
+
/**
|
|
767
|
+
* Per-tile-GID collider properties. Keys are tile GIDs.
|
|
768
|
+
* Example: `{ 6: { isTrigger: true }, 7: { oneWay: true } }`
|
|
769
|
+
*/
|
|
770
|
+
tileColliderProps?: Record<number, {
|
|
771
|
+
isTrigger?: boolean;
|
|
772
|
+
oneWay?: boolean;
|
|
773
|
+
layer?: string;
|
|
774
|
+
}>;
|
|
753
775
|
}
|
|
754
|
-
declare function Tilemap({ src, onSpawnObject, layerFilter, zIndex, collisionLayer, triggerLayer: triggerLayerName, onTileProperty, navGrid, mergeColliders, }: TilemapProps): React__default.ReactElement | null;
|
|
776
|
+
declare function Tilemap({ src, onSpawnObject, layerFilter, zIndex, collisionLayer, triggerLayer: triggerLayerName, onTileProperty, navGrid, mergeColliders, solidTiles, autoColliders, tileColliderProps: _tileColliderProps, }: TilemapProps): React__default.ReactElement | null;
|
|
755
777
|
|
|
756
778
|
interface ParallaxLayerProps {
|
|
757
779
|
/** Image URL to use as the background layer */
|
|
@@ -1832,6 +1854,100 @@ interface SceneManagerControls {
|
|
|
1832
1854
|
*/
|
|
1833
1855
|
declare function useSceneManager(initialScene: string): SceneManagerControls;
|
|
1834
1856
|
|
|
1857
|
+
type TransitionEffect = {
|
|
1858
|
+
type: 'fade';
|
|
1859
|
+
duration?: number;
|
|
1860
|
+
color?: string;
|
|
1861
|
+
} | {
|
|
1862
|
+
type: 'wipe';
|
|
1863
|
+
duration?: number;
|
|
1864
|
+
direction?: 'left' | 'right' | 'up' | 'down';
|
|
1865
|
+
color?: string;
|
|
1866
|
+
} | {
|
|
1867
|
+
type: 'circle-close';
|
|
1868
|
+
duration?: number;
|
|
1869
|
+
color?: string;
|
|
1870
|
+
} | {
|
|
1871
|
+
type: 'instant';
|
|
1872
|
+
};
|
|
1873
|
+
interface SceneTransitionControls {
|
|
1874
|
+
/** Currently active scene (after transition completes). */
|
|
1875
|
+
current: string;
|
|
1876
|
+
/** Full scene stack. */
|
|
1877
|
+
stack: string[];
|
|
1878
|
+
/** Push scene with transition. */
|
|
1879
|
+
push(scene: string, transition?: TransitionEffect): void;
|
|
1880
|
+
/** Pop top scene with transition. Returns popped scene name. */
|
|
1881
|
+
pop(transition?: TransitionEffect): string | undefined;
|
|
1882
|
+
/** Replace current scene with transition. */
|
|
1883
|
+
replace(scene: string, transition?: TransitionEffect): void;
|
|
1884
|
+
/** Reset to a single scene with transition. */
|
|
1885
|
+
reset(scene: string, transition?: TransitionEffect): void;
|
|
1886
|
+
/** Transition progress 0–1 (0 = no overlay, 1 = fully covered). */
|
|
1887
|
+
progress: number;
|
|
1888
|
+
/** Current transition phase. */
|
|
1889
|
+
phase: 'idle' | 'out' | 'in';
|
|
1890
|
+
/** Active transition effect (for overlay rendering). */
|
|
1891
|
+
activeTransition: TransitionEffect | null;
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Scene manager with built-in visual transitions.
|
|
1895
|
+
*
|
|
1896
|
+
* @example
|
|
1897
|
+
* const scenes = useSceneTransition('gameplay')
|
|
1898
|
+
* scenes.push('pause', { type: 'fade', duration: 0.4, color: '#000' })
|
|
1899
|
+
* scenes.replace('gameOver', { type: 'circle-close', duration: 0.6 })
|
|
1900
|
+
*
|
|
1901
|
+
* // Render the overlay component to see transitions:
|
|
1902
|
+
* <SceneTransitionOverlay controls={scenes} />
|
|
1903
|
+
*/
|
|
1904
|
+
declare function useSceneTransition(initialScene: string, defaultTransition?: TransitionEffect): SceneTransitionControls;
|
|
1905
|
+
|
|
1906
|
+
interface SceneTransitionOverlayProps {
|
|
1907
|
+
controls: SceneTransitionControls;
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* Renders the visual overlay during scene transitions.
|
|
1911
|
+
* Place this as a sibling after your scene content, inside the Game wrapper.
|
|
1912
|
+
*
|
|
1913
|
+
* @example
|
|
1914
|
+
* const scenes = useSceneTransition('gameplay')
|
|
1915
|
+
*
|
|
1916
|
+
* <div style={{ position: 'relative' }}>
|
|
1917
|
+
* {scenes.current === 'gameplay' && <GameplayScene />}
|
|
1918
|
+
* {scenes.current === 'pause' && <PauseMenu />}
|
|
1919
|
+
* <SceneTransitionOverlay controls={scenes} />
|
|
1920
|
+
* </div>
|
|
1921
|
+
*/
|
|
1922
|
+
declare function SceneTransitionOverlay({ controls }: SceneTransitionOverlayProps): React__default.DetailedReactHTMLElement<{
|
|
1923
|
+
style: {
|
|
1924
|
+
position: "absolute";
|
|
1925
|
+
inset: number;
|
|
1926
|
+
backgroundColor: string;
|
|
1927
|
+
WebkitMaskImage: `radial-gradient(circle ${number}vmax at 50% 50%, transparent 100%, black 100%)`;
|
|
1928
|
+
maskImage: `radial-gradient(circle ${number}vmax at 50% 50%, transparent 100%, black 100%)`;
|
|
1929
|
+
pointerEvents: "none";
|
|
1930
|
+
zIndex: number;
|
|
1931
|
+
};
|
|
1932
|
+
}, HTMLElement> | React__default.DetailedReactHTMLElement<{
|
|
1933
|
+
style: React__default.CSSProperties;
|
|
1934
|
+
}, HTMLElement> | null;
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* Freeze gameplay for a short duration — physics and scripts stop
|
|
1938
|
+
* but the last frame stays rendered. Creates impactful collision feedback.
|
|
1939
|
+
*
|
|
1940
|
+
* @example
|
|
1941
|
+
* const hitstop = useHitstop()
|
|
1942
|
+
*
|
|
1943
|
+
* useCollisionEnter(() => {
|
|
1944
|
+
* hitstop.freeze(0.08) // 80ms freeze on hit
|
|
1945
|
+
* })
|
|
1946
|
+
*/
|
|
1947
|
+
declare function useHitstop(): {
|
|
1948
|
+
freeze: (seconds: number) => void;
|
|
1949
|
+
};
|
|
1950
|
+
|
|
1835
1951
|
/**
|
|
1836
1952
|
* Returns a stable `InputBuffer` instance that persists across renders.
|
|
1837
1953
|
*
|
|
@@ -2106,4 +2222,4 @@ declare function useRemotePlayer(config: {
|
|
|
2106
2222
|
opts?: RemotePlayerOptions;
|
|
2107
2223
|
}): RemotePlayerControls;
|
|
2108
2224
|
|
|
2109
|
-
export { type AccessibilityControls, AnimatedSprite, type AnimatedSpriteProps, Animation, type AnimationSet, Animator, AssetLoader, type BoundInputMap, BoxCollider, Camera2D, type CameraControls, type CameraLookaheadOptions, CameraZone, CapsuleCollider, Checkpoint, Circle, CircleCollider, type ComboDetectorResult, CompoundCollider, ConvexCollider, type CoordinateHelpers, type CoroutineControls, type CoroutineFactory, type CoroutineYield, Entity, Game, type GameControls, type GamepadState, type GestureHandlers, type GestureOptions, Gradient, type HMRControls, HalfSpaceCollider, HeightFieldCollider, type InputContextControls, Joint, Line, Mask, MovingPlatform, type NetworkSyncOptions, NineSlice, ParallaxLayer, ParticleEmitter, type ParticlePreset, type PauseControls, type PinchEvent, Polygon, type PreloadState, type ProfilerData, type RemotePlayerControls, type RemotePlayerOptions, RigidBody, type SceneManagerControls, ScreenFlash, type ScreenFlashHandle, Script, SegmentCollider, type SnapshotControls, Sprite, type SpriteAtlas, SquashStretch, type SquashStretchControls, type SwipeEvent, Text, type TiledLayer, type TiledObject, Tilemap, type TimerControls, type TouchControls, Trail, Transform, TriMeshCollider, TriangleCollider, type VirtualInputState, VirtualJoystick, type VirtualJoystickProps, type Waypoint, World, createAtlas, defineAnimations, definePrefab, playClip, setAnimationState, setAnimatorParam, useAccessibility, useAudioListener, useCamera, useCameraLookahead, useComboDetector, useCoordinates, useCoroutine, useDestroyEntity, useEntity, useEvent, useEvents, useGame, useGamepad, useGamepadHaptics, useGestures, useHMR, useInput, useInputBuffer, useInputContext, useInputMap, useInputRecorder, useLocalMultiplayer, useNetworkSync, useParent, usePause, usePlayerInput, usePostProcess, usePreload, useProfiler, useRemotePlayer, useSceneManager, useSnapshot, useSquashStretch, useTimer, useTouch, useVirtualInput, useWebGLPostProcess, useWorldQuery, wait, waitFrames, waitUntil };
|
|
2225
|
+
export { type AccessibilityControls, AnimatedSprite, type AnimatedSpriteProps, Animation, type AnimationSet, Animator, AssetLoader, type BoundInputMap, BoxCollider, Camera2D, type CameraControls, type CameraLookaheadOptions, CameraZone, CapsuleCollider, Checkpoint, Circle, CircleCollider, type ComboDetectorResult, CompoundCollider, ConvexCollider, type CoordinateHelpers, type CoroutineControls, type CoroutineFactory, type CoroutineYield, Entity, Game, type GameControls, type GamepadState, type GestureHandlers, type GestureOptions, Gradient, type HMRControls, HalfSpaceCollider, HeightFieldCollider, type InputContextControls, Joint, Line, Mask, MovingPlatform, type NetworkSyncOptions, NineSlice, ParallaxLayer, ParticleEmitter, type ParticlePreset, type PauseControls, type PinchEvent, Polygon, type PreloadState, type ProfilerData, type RemotePlayerControls, type RemotePlayerOptions, RigidBody, type SceneManagerControls, type SceneTransitionControls, SceneTransitionOverlay, ScreenFlash, type ScreenFlashHandle, Script, SegmentCollider, type SnapshotControls, Sprite, type SpriteAtlas, SquashStretch, type SquashStretchControls, type SwipeEvent, Text, type TiledLayer, type TiledObject, Tilemap, type TimerControls, type TouchControls, Trail, Transform, type TransitionEffect, TriMeshCollider, TriangleCollider, type VirtualInputState, VirtualJoystick, type VirtualJoystickProps, type Waypoint, World, createAtlas, defineAnimations, definePrefab, playClip, setAnimationState, setAnimatorParam, useAccessibility, useAudioListener, useCamera, useCameraLookahead, useComboDetector, useCoordinates, useCoroutine, useDestroyEntity, useEntity, useEvent, useEvents, useGame, useGamepad, useGamepadHaptics, useGestures, useHMR, useHitstop, useInput, useInputBuffer, useInputContext, useInputMap, useInputRecorder, useLocalMultiplayer, useNetworkSync, useParent, usePause, usePlayerInput, usePostProcess, usePreload, useProfiler, useRemotePlayer, useSceneManager, useSceneTransition, useSnapshot, useSquashStretch, useTimer, useTouch, useVirtualInput, useWebGLPostProcess, useWorldQuery, wait, waitFrames, waitUntil };
|