@kbve/laser 0.0.8 → 0.1.2
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/README.md +40 -10
- package/laser.es.js +872 -0
- package/package.json +54 -24
- package/src/index.d.ts +0 -19
- package/src/index.js +0 -37
- package/src/index.js.map +0 -1
- package/src/lib/animations/TypewriterComponent.d.ts +0 -8
- package/src/lib/animations/TypewriterComponent.js +0 -53
- package/src/lib/animations/TypewriterComponent.js.map +0 -1
- package/src/lib/constants.d.ts +0 -2
- package/src/lib/constants.js +0 -6
- package/src/lib/constants.js.map +0 -1
- package/src/lib/eventhandler.d.ts +0 -31
- package/src/lib/eventhandler.js +0 -45
- package/src/lib/eventhandler.js.map +0 -1
- package/src/lib/icon/CollapseIcon.d.ts +0 -4
- package/src/lib/icon/CollapseIcon.js +0 -10
- package/src/lib/icon/CollapseIcon.js.map +0 -1
- package/src/lib/icon/ExpandIcon.d.ts +0 -4
- package/src/lib/icon/ExpandIcon.js +0 -10
- package/src/lib/icon/ExpandIcon.js.map +0 -1
- package/src/lib/laser.d.ts +0 -1
- package/src/lib/laser.js +0 -8
- package/src/lib/laser.js.map +0 -1
- package/src/lib/localdb.d.ts +0 -55
- package/src/lib/localdb.js +0 -592
- package/src/lib/localdb.js.map +0 -1
- package/src/lib/minigame/dice/MinigameDice.d.ts +0 -4
- package/src/lib/minigame/dice/MinigameDice.js +0 -85
- package/src/lib/minigame/dice/MinigameDice.js.map +0 -1
- package/src/lib/phaser/map/mapdatabase.d.ts +0 -1
- package/src/lib/phaser/map/mapdatabase.js +0 -175
- package/src/lib/phaser/map/mapdatabase.js.map +0 -1
- package/src/lib/phaser/monster/bird.d.ts +0 -7
- package/src/lib/phaser/monster/bird.js +0 -44
- package/src/lib/phaser/monster/bird.js.map +0 -1
- package/src/lib/phaser/npc/chatbubble.d.ts +0 -10
- package/src/lib/phaser/npc/chatbubble.js +0 -78
- package/src/lib/phaser/npc/chatbubble.js.map +0 -1
- package/src/lib/phaser/npc/npcdatabase.d.ts +0 -59
- package/src/lib/phaser/npc/npcdatabase.js +0 -550
- package/src/lib/phaser/npc/npcdatabase.js.map +0 -1
- package/src/lib/phaser/npc/npchandler.d.ts +0 -21
- package/src/lib/phaser/npc/npchandler.js +0 -123
- package/src/lib/phaser/npc/npchandler.js.map +0 -1
- package/src/lib/phaser/npc/tooltipmenu.d.ts +0 -17
- package/src/lib/phaser/npc/tooltipmenu.js +0 -68
- package/src/lib/phaser/npc/tooltipmenu.js.map +0 -1
- package/src/lib/phaser/player/playercontroller.d.ts +0 -24
- package/src/lib/phaser/player/playercontroller.js +0 -219
- package/src/lib/phaser/player/playercontroller.js.map +0 -1
- package/src/lib/quadtree.d.ts +0 -23
- package/src/lib/quadtree.js +0 -123
- package/src/lib/quadtree.js.map +0 -1
- package/src/lib/regex.d.ts +0 -1
- package/src/lib/regex.js +0 -6
- package/src/lib/regex.js.map +0 -1
- package/src/lib/utils/debug.d.ts +0 -8
- package/src/lib/utils/debug.js +0 -46
- package/src/lib/utils/debug.js.map +0 -1
- package/src/lib/utils/loader.d.ts +0 -3
- package/src/lib/utils/loader.js +0 -87
- package/src/lib/utils/loader.js.map +0 -1
- package/src/lib/utils/ulid.d.ts +0 -1
- package/src/lib/utils/ulid.js +0 -38
- package/src/lib/utils/ulid.js.map +0 -1
- package/src/types.d.ts +0 -423
- package/src/types.js +0 -14
- package/src/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,22 +1,52 @@
|
|
|
1
1
|
# Laser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<a href="https://kbve.com" style="float: right;"><img width="150" height="50" title="KBVE logo" src="https://kbve.com/assets/images/brand/letter_logo.svg" /></a>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Laser is a lightweight integration layer for Phaser and React Three Fiber in React 19 applications.
|
|
6
|
+
It provides React hooks and components for embedding Phaser games and R3F scenes with a shared event bus, making it easy to build hybrid 2D/3D game UIs.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
- **Component-Based Architecture**: Utilize React's component-based architecture for structuring your game elements.
|
|
9
|
-
- **Easy Setup**: Quickly set up and start building your projects with minimal configuration.
|
|
10
|
-
- **Optimized Performance**: Efficiently manage and update your game state with React's rendering optimizations.
|
|
8
|
+
## Features
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
- **Phaser integration** — `<PhaserGame>` component with ref-based access, `usePhaserGame` context hook, and `usePhaserEvent` for subscribing to Phaser events
|
|
11
|
+
- **React Three Fiber integration** — `<Stage>` component and `useGameLoop` hook for frame-synced game logic
|
|
12
|
+
- **Shared event bus** — `LaserEventBus` for decoupled communication between Phaser and R3F layers
|
|
13
|
+
- **TypeScript-first** — Full type definitions with exported types for configs, events, and geometry primitives
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
## Install
|
|
15
16
|
|
|
16
17
|
```bash
|
|
17
|
-
|
|
18
|
+
npm install @kbve/laser
|
|
18
19
|
```
|
|
19
20
|
|
|
21
|
+
### Peer Dependencies
|
|
22
|
+
|
|
23
|
+
Laser requires the following peer dependencies (install the ones you need):
|
|
24
|
+
|
|
25
|
+
- `react` >= 18.0.0
|
|
26
|
+
- `react-dom` >= 18.0.0
|
|
27
|
+
- `phaser` >= 3.80.0 _(optional — only needed for Phaser features)_
|
|
28
|
+
- `three` >= 0.160.0 _(optional — only needed for R3F features)_
|
|
29
|
+
- `@react-three/fiber` >= 9.0.0 _(optional)_
|
|
30
|
+
- `@react-three/drei` >= 10.0.0 _(optional)_
|
|
31
|
+
|
|
20
32
|
## Usage
|
|
21
33
|
|
|
22
|
-
|
|
34
|
+
```tsx
|
|
35
|
+
import {
|
|
36
|
+
PhaserGame,
|
|
37
|
+
usePhaserEvent,
|
|
38
|
+
Stage,
|
|
39
|
+
useGameLoop,
|
|
40
|
+
laserEvents,
|
|
41
|
+
} from '@kbve/laser';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Support
|
|
45
|
+
|
|
46
|
+
For questions or help, reach out via our [Discord server](https://kbve.com/discord/).
|
|
47
|
+
|
|
48
|
+
[](https://kbve.com/discord/)
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|