cubeforge 0.3.7 → 0.3.9
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 +59 -6
- package/dist/index.js +766 -111
- package/package.json +4 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,16 +2,17 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { CSSProperties, ReactNode } from 'react';
|
|
4
4
|
import { Plugin, EntityId, ECSWorld, ScriptUpdateFn, NavGrid, WorldSnapshot, EventBus } from '@cubeforge/core';
|
|
5
|
-
export { AssetProgress, Component, ECSWorld, Ease, EntityId, GameTimer, NavGrid, Plugin, PreloadManifest, ScriptUpdateFn, TransformComponent, TweenHandle, Vec2Like, WorldSnapshot, arrive, createTag, createTimer, createTransform, definePlugin, findByTag, flee, patrol, preloadManifest, seek, tween, wander } from '@cubeforge/core';
|
|
5
|
+
export { AssetProgress, Component, ECSWorld, Ease, EntityId, GameTimer, HotReloadablePlugin, NavGrid, Plugin, PreloadManifest, ScriptUpdateFn, TransformComponent, TweenHandle, Vec2Like, WorldSnapshot, arrive, createTag, createTimer, createTransform, definePlugin, findByTag, flee, hotReloadPlugin, patrol, preloadManifest, seek, tween, wander } from '@cubeforge/core';
|
|
6
|
+
import { ColliderShape } from '@cubeforge/physics';
|
|
7
|
+
export { BoxColliderComponent, CapsuleColliderComponent, CircleColliderComponent, ColliderShape, CompoundColliderComponent, RaycastHit, RigidBodyComponent, createCompoundCollider, overlapBox, overlapCircle, raycast, raycastAll, sweepBox } from '@cubeforge/physics';
|
|
6
8
|
import { InputManager, ActionBindings, InputContextName, PlayerInput, InputRecorderControls } from '@cubeforge/input';
|
|
7
9
|
export { ActionBindings, AxisBinding, InputContextName, InputManager, InputMap, InputRecorderControls, InputRecording, InputRecording as InputRecordingData, PlayerInput, createInputMap, createInputRecorder, createPlayerInput, globalInputContext } from '@cubeforge/input';
|
|
8
10
|
import { EngineState } from '@cubeforge/context';
|
|
9
11
|
export { EngineState, useCircleEnter, useCircleExit, useCircleStay, useCollisionEnter, useCollisionExit, useCollisionStay, useTriggerEnter, useTriggerExit, useTriggerStay } from '@cubeforge/context';
|
|
10
|
-
export { AISteering, AnimationClip, AnimationControllerResult, BindingControls, GameState as GameStateDefinition, GameStateMachineResult, HealthControls, HealthOptions, KinematicBodyControls, LevelTransitionControls, PathfindingControls, PlatformerControllerOptions, RestartControls, SaveControls, SaveOptions, TopDownMovementOptions, TransitionOptions, TransitionType, useAISteering, useAnimationController, useDamageZone, useDropThrough, useGameStateMachine, useHealth, useKinematicBody, useLevelTransition, usePathfinding, usePersistedBindings, usePlatformerController, useRestart, useSave, useTopDownMovement } from '@cubeforge/gameplay';
|
|
12
|
+
export { AISteering, AnimationClip, AnimationControllerResult, BindingControls, CutsceneControls, CutsceneStep, DialogueControls, DialogueLine, DialogueScript, GameState as GameStateDefinition, GameStateMachineResult, HealthControls, HealthOptions, KinematicBodyControls, LevelTransitionControls, PathfindingControls, PlatformerControllerOptions, RestartControls, SaveControls, SaveOptions, TopDownMovementOptions, TransitionOptions, TransitionType, useAISteering, useAnimationController, useCutscene, useDamageZone, useDialogue, useDropThrough, useGameStateMachine, useGameStore, useHealth, useKinematicBody, useLevelTransition, usePathfinding, usePersistedBindings, usePlatformerController, useRestart, useSave, useTopDownMovement } from '@cubeforge/gameplay';
|
|
11
13
|
export { AudioGroup, SoundControls, duck, getGroupVolume, setGroupMute, setGroupVolume, setMasterVolume, stopGroup, useSound } from '@cubeforge/audio';
|
|
12
14
|
export { DevToolsHandle } from '@cubeforge/devtools';
|
|
13
|
-
export { AnimationStateComponent, ParallaxLayerComponent, Particle, ParticlePoolComponent, RenderSystem, SpriteComponent, SquashStretchComponent, TextComponent, TrailComponent, createSprite } from '@cubeforge/renderer';
|
|
14
|
-
export { BoxColliderComponent, CapsuleColliderComponent, CircleColliderComponent, RaycastHit, RigidBodyComponent, overlapBox, overlapCircle, raycast, raycastAll, sweepBox } from '@cubeforge/physics';
|
|
15
|
+
export { AnimationStateComponent, NineSliceComponent, ParallaxLayerComponent, Particle, ParticlePoolComponent, RenderSystem, SpriteComponent, SquashStretchComponent, TextComponent, TrailComponent, createNineSlice, createSprite } from '@cubeforge/renderer';
|
|
15
16
|
|
|
16
17
|
interface GameControls {
|
|
17
18
|
pause(): void;
|
|
@@ -111,8 +112,10 @@ interface SpriteProps {
|
|
|
111
112
|
frame?: string;
|
|
112
113
|
tileX?: boolean;
|
|
113
114
|
tileY?: boolean;
|
|
115
|
+
tileSizeX?: number;
|
|
116
|
+
tileSizeY?: number;
|
|
114
117
|
}
|
|
115
|
-
declare function Sprite({ width, height, color, src, offsetX, offsetY, zIndex, visible, flipX, anchorX, anchorY, frameIndex, frameWidth, frameHeight, frameColumns, atlas, frame, tileX, tileY, }: SpriteProps): null;
|
|
118
|
+
declare function Sprite({ width, height, color, src, offsetX, offsetY, zIndex, visible, flipX, anchorX, anchorY, frameIndex, frameWidth, frameHeight, frameColumns, atlas, frame, tileX, tileY, tileSizeX, tileSizeY, }: SpriteProps): null;
|
|
116
119
|
|
|
117
120
|
interface TextProps {
|
|
118
121
|
text: string;
|
|
@@ -183,6 +186,15 @@ interface CapsuleColliderProps {
|
|
|
183
186
|
}
|
|
184
187
|
declare function CapsuleCollider({ width, height, offsetX, offsetY, isTrigger, layer, mask, }: CapsuleColliderProps): null;
|
|
185
188
|
|
|
189
|
+
interface CompoundColliderProps {
|
|
190
|
+
shapes: ColliderShape[];
|
|
191
|
+
isTrigger?: boolean;
|
|
192
|
+
layer?: string;
|
|
193
|
+
/** Which layers this collider interacts with. '*' = all (default). */
|
|
194
|
+
mask?: string | string[];
|
|
195
|
+
}
|
|
196
|
+
declare function CompoundCollider({ shapes, isTrigger, layer, mask, }: CompoundColliderProps): null;
|
|
197
|
+
|
|
186
198
|
interface ScriptProps {
|
|
187
199
|
/** Called once when the entity is mounted — use to attach extra components */
|
|
188
200
|
init?: (entityId: EntityId, world: ECSWorld) => void;
|
|
@@ -511,6 +523,47 @@ interface TrailProps {
|
|
|
511
523
|
*/
|
|
512
524
|
declare function Trail({ length, color, width }: TrailProps): null;
|
|
513
525
|
|
|
526
|
+
interface NineSliceProps {
|
|
527
|
+
/** Image source URL */
|
|
528
|
+
src: string;
|
|
529
|
+
/** Rendered width in pixels */
|
|
530
|
+
width: number;
|
|
531
|
+
/** Rendered height in pixels */
|
|
532
|
+
height: number;
|
|
533
|
+
/** Top border inset in source pixels (default 8) */
|
|
534
|
+
borderTop?: number;
|
|
535
|
+
/** Right border inset in source pixels (default 8) */
|
|
536
|
+
borderRight?: number;
|
|
537
|
+
/** Bottom border inset in source pixels (default 8) */
|
|
538
|
+
borderBottom?: number;
|
|
539
|
+
/** Left border inset in source pixels (default 8) */
|
|
540
|
+
borderLeft?: number;
|
|
541
|
+
/** Draw order (default 0) */
|
|
542
|
+
zIndex?: number;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Renders a 9-slice sprite that scales while preserving its border regions.
|
|
546
|
+
*
|
|
547
|
+
* Must be used inside an `<Entity>` with a `<Transform>`.
|
|
548
|
+
*
|
|
549
|
+
* @example
|
|
550
|
+
* ```tsx
|
|
551
|
+
* <Entity id="panel">
|
|
552
|
+
* <Transform x={200} y={150} />
|
|
553
|
+
* <NineSlice
|
|
554
|
+
* src="/ui/panel.png"
|
|
555
|
+
* width={300}
|
|
556
|
+
* height={200}
|
|
557
|
+
* borderTop={12}
|
|
558
|
+
* borderRight={12}
|
|
559
|
+
* borderBottom={12}
|
|
560
|
+
* borderLeft={12}
|
|
561
|
+
* />
|
|
562
|
+
* </Entity>
|
|
563
|
+
* ```
|
|
564
|
+
*/
|
|
565
|
+
declare function NineSlice({ src, width, height, borderTop, borderRight, borderBottom, borderLeft, zIndex, }: NineSliceProps): null;
|
|
566
|
+
|
|
514
567
|
interface AssetLoaderProps {
|
|
515
568
|
/** List of asset URLs to preload */
|
|
516
569
|
assets: string[];
|
|
@@ -898,4 +951,4 @@ interface PauseControls {
|
|
|
898
951
|
*/
|
|
899
952
|
declare function usePause(): PauseControls;
|
|
900
953
|
|
|
901
|
-
export { Animation, AssetLoader, type BoundInputMap, BoxCollider, Camera2D, type CameraControls, CameraZone, CapsuleCollider, Checkpoint, CircleCollider, type CoordinateHelpers, Entity, Game, type GameControls, type GamepadState, type InputContextControls, MovingPlatform, ParallaxLayer, ParticleEmitter, type ParticlePreset, type PauseControls, type PreloadState, RigidBody, ScreenFlash, type ScreenFlashHandle, Script, type SnapshotControls, Sprite, type SpriteAtlas, SquashStretch, Text, type TiledLayer, type TiledObject, Tilemap, Trail, Transform, type VirtualInputState, VirtualJoystick, type VirtualJoystickProps, World, createAtlas, useCamera, useCoordinates, useDestroyEntity, useEntity, useEvent, useEvents, useGame, useGamepad, useInput, useInputContext, useInputMap, useInputRecorder, useLocalMultiplayer, usePause, usePlayerInput, usePreload, useSnapshot, useVirtualInput };
|
|
954
|
+
export { Animation, AssetLoader, type BoundInputMap, BoxCollider, Camera2D, type CameraControls, CameraZone, CapsuleCollider, Checkpoint, CircleCollider, CompoundCollider, type CoordinateHelpers, Entity, Game, type GameControls, type GamepadState, type InputContextControls, MovingPlatform, NineSlice, ParallaxLayer, ParticleEmitter, type ParticlePreset, type PauseControls, type PreloadState, RigidBody, ScreenFlash, type ScreenFlashHandle, Script, type SnapshotControls, Sprite, type SpriteAtlas, SquashStretch, Text, type TiledLayer, type TiledObject, Tilemap, Trail, Transform, type VirtualInputState, VirtualJoystick, type VirtualJoystickProps, World, createAtlas, useCamera, useCoordinates, useDestroyEntity, useEntity, useEvent, useEvents, useGame, useGamepad, useInput, useInputContext, useInputMap, useInputRecorder, useLocalMultiplayer, usePause, usePlayerInput, usePreload, useSnapshot, useVirtualInput };
|