@rpgjs/client 5.0.0-alpha.23 → 5.0.0-alpha.25
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/{index30.js → Game/AnimationManager.js} +1 -1
- package/dist/Game/AnimationManager.js.map +1 -0
- package/dist/{index24.js → Game/Event.js} +2 -2
- package/dist/Game/Event.js.map +1 -0
- package/dist/{index29.js → Game/Map.js} +6 -6
- package/dist/Game/Map.js.map +1 -0
- package/dist/{index22.js → Game/Object.js} +4 -4
- package/dist/Game/Object.js.map +1 -0
- package/dist/{index23.js → Game/Player.js} +2 -2
- package/dist/Game/Player.js.map +1 -0
- package/dist/{index9.js → Gui/Gui.js} +10 -11
- package/dist/{index9.js.map → Gui/Gui.js.map} +1 -1
- package/dist/{index19.js → Resource.js} +1 -1
- package/dist/Resource.js.map +1 -0
- package/dist/RpgClientEngine.d.ts +66 -115
- package/dist/{index2.js → RpgClientEngine.js} +234 -176
- package/dist/RpgClientEngine.js.map +1 -0
- package/dist/{index18.js → Sound.js} +1 -1
- package/dist/Sound.js.map +1 -0
- package/dist/{index35.js → components/animations/animation.ce.js} +3 -3
- package/dist/components/animations/animation.ce.js.map +1 -0
- package/dist/{index34.js → components/animations/hit.ce.js} +1 -1
- package/dist/components/animations/hit.ce.js.map +1 -0
- package/dist/{index12.js → components/animations/index.js} +3 -3
- package/dist/components/animations/index.js.map +1 -0
- package/dist/{index17.js → components/character.ce.js} +4 -4
- package/dist/components/character.ce.js.map +1 -0
- package/dist/{index51.js → components/dynamics/parse-value.js} +1 -1
- package/dist/components/dynamics/parse-value.js.map +1 -0
- package/dist/{index40.js → components/dynamics/text.ce.js} +2 -2
- package/dist/components/dynamics/text.ce.js.map +1 -0
- package/dist/{index11.js → components/gui/box.ce.js} +8 -8
- package/dist/components/gui/box.ce.js.map +1 -0
- package/dist/{index10.js → components/gui/dialogbox/index.ce.js} +4 -4
- package/dist/components/gui/dialogbox/index.ce.js.map +1 -0
- package/dist/{index52.js → components/gui/dialogbox/itemMenu.ce.js} +1 -1
- package/dist/components/gui/dialogbox/itemMenu.ce.js.map +1 -0
- package/dist/{index47.js → components/gui/dialogbox/selection.ce.js} +4 -4
- package/dist/components/gui/dialogbox/selection.ce.js.map +1 -0
- package/dist/components/gui/mobile/index.d.ts +1 -1
- package/dist/{index25.js → components/gui/mobile/index.js} +5 -5
- package/dist/components/gui/mobile/index.js.map +1 -0
- package/dist/components/gui/mobile/mobile.ce.js +17 -0
- package/dist/components/gui/mobile/mobile.ce.js.map +1 -0
- package/dist/{index13.js → components/prebuilt/hp-bar.ce.js} +1 -1
- package/dist/components/prebuilt/hp-bar.ce.js.map +1 -0
- package/dist/{index14.js → components/prebuilt/light-halo.ce.js} +2 -3
- package/dist/components/prebuilt/light-halo.ce.js.map +1 -0
- package/dist/{index26.js → components/scenes/canvas.ce.js} +6 -7
- package/dist/components/scenes/canvas.ce.js.map +1 -0
- package/dist/{index46.js → components/scenes/draw-map.ce.js} +3 -3
- package/dist/components/scenes/draw-map.ce.js.map +1 -0
- package/dist/{index16.js → components/scenes/event-layer.ce.js} +4 -4
- package/dist/components/scenes/event-layer.ce.js.map +1 -0
- package/dist/{index6.js → core/inject.js} +2 -2
- package/dist/core/inject.js.map +1 -0
- package/dist/{index5.js → core/setup.js} +4 -4
- package/dist/core/setup.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +25 -24
- package/dist/index.js.map +1 -1
- package/dist/{index8.js → module.js} +10 -5
- package/dist/module.js.map +1 -0
- package/dist/{index20.js → node_modules/.pnpm/@signe_di@2.6.0/node_modules/@signe/di/dist/index.js} +1 -1
- package/dist/node_modules/.pnpm/@signe_di@2.6.0/node_modules/@signe/di/dist/index.js.map +1 -0
- package/dist/{index45.js → node_modules/.pnpm/@signe_reactive@2.6.0/node_modules/@signe/reactive/dist/index.js} +216 -11
- package/dist/node_modules/.pnpm/@signe_reactive@2.6.0/node_modules/@signe/reactive/dist/index.js.map +1 -0
- package/dist/{index32.js → node_modules/.pnpm/@signe_room@2.6.0/node_modules/@signe/room/dist/index.js} +29 -30
- package/dist/node_modules/.pnpm/@signe_room@2.6.0/node_modules/@signe/room/dist/index.js.map +1 -0
- package/dist/{index42.js → node_modules/.pnpm/@signe_sync@2.6.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js} +1 -1
- package/dist/node_modules/.pnpm/@signe_sync@2.6.0/node_modules/@signe/sync/dist/chunk-7QVYU63E.js.map +1 -0
- package/dist/{index33.js → node_modules/.pnpm/@signe_sync@2.6.0/node_modules/@signe/sync/dist/client/index.js} +5 -5
- package/dist/node_modules/.pnpm/@signe_sync@2.6.0/node_modules/@signe/sync/dist/client/index.js.map +1 -0
- package/dist/{index28.js → node_modules/.pnpm/@signe_sync@2.6.0/node_modules/@signe/sync/dist/index.js} +3 -3
- package/dist/node_modules/.pnpm/@signe_sync@2.6.0/node_modules/@signe/sync/dist/index.js.map +1 -0
- package/dist/{index48.js → node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js} +1 -1
- package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js.map +1 -0
- package/dist/{index43.js → node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js} +2 -15
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js.map +1 -0
- package/dist/{index44.js → node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js} +2 -5
- package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js.map +1 -0
- package/dist/{index50.js → node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js} +813 -100
- package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js.map +1 -0
- package/dist/{index36.js → presets/animation.js} +1 -1
- package/dist/presets/animation.js.map +1 -0
- package/dist/{index39.js → presets/faceset.js} +1 -1
- package/dist/presets/faceset.js.map +1 -0
- package/dist/presets/index.js +14 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/{index37.js → presets/lpc.js} +1 -1
- package/dist/presets/lpc.js.map +1 -0
- package/dist/{index38.js → presets/rmspritesheet.js} +1 -1
- package/dist/presets/rmspritesheet.js.map +1 -0
- package/dist/{index27.js → services/AbstractSocket.js} +1 -1
- package/dist/services/AbstractSocket.js.map +1 -0
- package/dist/{index21.js → services/keyboardControls.js} +1 -1
- package/dist/services/keyboardControls.js.map +1 -0
- package/dist/{index7.js → services/loadMap.js} +2 -2
- package/dist/services/loadMap.js.map +1 -0
- package/dist/{index4.js → services/mmorpg.js} +6 -6
- package/dist/services/mmorpg.js.map +1 -0
- package/dist/services/standalone.d.ts +3 -0
- package/dist/{index3.js → services/standalone.js} +18 -12
- package/dist/services/standalone.js.map +1 -0
- package/package.json +9 -9
- package/src/Gui/Gui.ts +0 -1
- package/src/RpgClientEngine.ts +298 -182
- package/src/components/character.ce +2 -3
- package/src/components/gui/mobile/index.ts +1 -1
- package/src/components/gui/mobile/mobile.ce +73 -88
- package/src/components/prebuilt/light-halo.ce +2 -71
- package/src/components/scenes/canvas.ce +0 -10
- package/src/components/scenes/event-layer.ce +1 -0
- package/src/index.ts +2 -1
- package/src/module.ts +6 -1
- package/src/services/standalone.ts +16 -7
- package/vite.config.ts +4 -2
- package/dist/Game/TransitionManager.d.ts +0 -56
- package/dist/index10.js.map +0 -1
- package/dist/index11.js.map +0 -1
- package/dist/index12.js.map +0 -1
- package/dist/index13.js.map +0 -1
- package/dist/index14.js.map +0 -1
- package/dist/index15.js +0 -14
- package/dist/index15.js.map +0 -1
- package/dist/index16.js.map +0 -1
- package/dist/index17.js.map +0 -1
- package/dist/index18.js.map +0 -1
- package/dist/index19.js.map +0 -1
- package/dist/index2.js.map +0 -1
- package/dist/index20.js.map +0 -1
- package/dist/index21.js.map +0 -1
- package/dist/index22.js.map +0 -1
- package/dist/index23.js.map +0 -1
- package/dist/index24.js.map +0 -1
- package/dist/index25.js.map +0 -1
- package/dist/index26.js.map +0 -1
- package/dist/index27.js.map +0 -1
- package/dist/index28.js.map +0 -1
- package/dist/index29.js.map +0 -1
- package/dist/index3.js.map +0 -1
- package/dist/index30.js.map +0 -1
- package/dist/index31.js +0 -53
- package/dist/index31.js.map +0 -1
- package/dist/index32.js.map +0 -1
- package/dist/index33.js.map +0 -1
- package/dist/index34.js.map +0 -1
- package/dist/index35.js.map +0 -1
- package/dist/index36.js.map +0 -1
- package/dist/index37.js.map +0 -1
- package/dist/index38.js.map +0 -1
- package/dist/index39.js.map +0 -1
- package/dist/index4.js.map +0 -1
- package/dist/index40.js.map +0 -1
- package/dist/index41.js +0 -43
- package/dist/index41.js.map +0 -1
- package/dist/index42.js.map +0 -1
- package/dist/index43.js.map +0 -1
- package/dist/index44.js.map +0 -1
- package/dist/index45.js.map +0 -1
- package/dist/index46.js.map +0 -1
- package/dist/index47.js.map +0 -1
- package/dist/index48.js.map +0 -1
- package/dist/index49.js +0 -7
- package/dist/index49.js.map +0 -1
- package/dist/index5.js.map +0 -1
- package/dist/index50.js.map +0 -1
- package/dist/index51.js.map +0 -1
- package/dist/index52.js.map +0 -1
- package/dist/index53.js +0 -6
- package/dist/index53.js.map +0 -1
- package/dist/index54.js +0 -12
- package/dist/index54.js.map +0 -1
- package/dist/index55.js +0 -113
- package/dist/index55.js.map +0 -1
- package/dist/index56.js +0 -136
- package/dist/index56.js.map +0 -1
- package/dist/index57.js +0 -137
- package/dist/index57.js.map +0 -1
- package/dist/index58.js +0 -112
- package/dist/index58.js.map +0 -1
- package/dist/index59.js +0 -9
- package/dist/index59.js.map +0 -1
- package/dist/index6.js.map +0 -1
- package/dist/index7.js.map +0 -1
- package/dist/index8.js.map +0 -1
- package/src/Game/TransitionManager.ts +0 -75
|
@@ -1,95 +1,80 @@
|
|
|
1
1
|
<Container justifyContent="space-between" alignItems="flex-end" width="100%" height="100%">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
2
|
+
<!-- Gamepad buttons A and B (left side) -->
|
|
3
|
+
<Container justifyContent="flex-start" alignItems="flex-end" gap={20}>
|
|
4
|
+
<Container display="flex" direction="column" gap={20} margin={50}>
|
|
5
|
+
<!-- Button B (top) -->
|
|
6
|
+
|
|
7
|
+
<!-- Button A (bottom) -->
|
|
8
|
+
<Button
|
|
9
|
+
text="A"
|
|
10
|
+
shape="circle"
|
|
11
|
+
width={70}
|
|
12
|
+
height={70}
|
|
13
|
+
controls={controlsInstance}
|
|
14
|
+
controlName="action"
|
|
15
|
+
style={{
|
|
16
|
+
backgroundColor: {
|
|
17
|
+
normal: "#2ecc71",
|
|
18
|
+
hover: "#27ae60",
|
|
19
|
+
pressed: "#229954",
|
|
20
|
+
disabled: "#7f8c8d"
|
|
21
|
+
},
|
|
22
|
+
text: {
|
|
23
|
+
fontSize: 24,
|
|
24
|
+
fontFamily: "Arial Bold",
|
|
25
|
+
color: "#ffffff"
|
|
26
|
+
}
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
<Button
|
|
31
|
+
text="B"
|
|
32
|
+
shape="circle"
|
|
33
|
+
width={70}
|
|
34
|
+
height={70}
|
|
35
|
+
controls={controlsInstance}
|
|
36
|
+
controlName="back"
|
|
37
|
+
style={{
|
|
38
|
+
backgroundColor: {
|
|
39
|
+
normal: "#e74c3c",
|
|
40
|
+
hover: "#c0392b",
|
|
41
|
+
pressed: "#a93226",
|
|
42
|
+
disabled: "#7f8c8d"
|
|
43
|
+
},
|
|
44
|
+
text: {
|
|
45
|
+
fontSize: 24,
|
|
46
|
+
fontFamily: "Arial Bold",
|
|
47
|
+
color: "#ffffff"
|
|
48
|
+
}
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
</Container>
|
|
49
53
|
</Container>
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
|
|
55
|
+
<Container margin={100} alignItems="flex-end">
|
|
56
|
+
<Container>
|
|
57
|
+
<Joystick
|
|
58
|
+
controls={controlsInstance}
|
|
59
|
+
outerColor="#34495e"
|
|
60
|
+
innerColor="#3498db"
|
|
61
|
+
/>
|
|
62
|
+
</Container>
|
|
52
63
|
</Container>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<script>
|
|
56
|
-
import { effect } from 'canvasengine'
|
|
57
|
-
import { Joystick } from '@canvasengine/presets'
|
|
58
|
-
import { Button } from 'canvasengine'
|
|
59
|
-
import { inject } from '../../../core/inject'
|
|
60
|
-
import { RpgClientEngine } from '../../../RpgClientEngine'
|
|
64
|
+
</Container>
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
<script>
|
|
67
|
+
import { signal, mount } from 'canvasengine'
|
|
68
|
+
import { Button } from 'canvasengine'
|
|
69
|
+
import { inject } from '../../../core/inject'
|
|
70
|
+
import { RpgClientEngine } from '../../../RpgClientEngine'
|
|
71
|
+
import { Direction } from '@rpgjs/common'
|
|
64
72
|
|
|
65
|
-
const onChange = (event) => {
|
|
66
|
-
const control = inject('KeyboardControls')
|
|
67
|
-
if (lastDirection !== event.direction) {
|
|
68
|
-
if (lastDirection !== null) {
|
|
69
|
-
control.applyControl(lastDirection, true)
|
|
70
|
-
}
|
|
71
|
-
lastDirection = event.direction
|
|
72
|
-
control.applyControl(lastDirection)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const onEnd = () => {
|
|
77
|
-
const control = inject('KeyboardControls')
|
|
78
|
-
if (lastDirection !== null) {
|
|
79
|
-
control.applyControl(lastDirection, false)
|
|
80
|
-
lastDirection = null
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
73
|
|
|
84
|
-
const
|
|
85
|
-
if (client) {
|
|
86
|
-
client.processAction({ action: 'action' })
|
|
87
|
-
}
|
|
88
|
-
}
|
|
74
|
+
const controlsInstance = signal(null)
|
|
89
75
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
</script>
|
|
76
|
+
mount((element) => {
|
|
77
|
+
const control = inject('KeyboardControls')
|
|
78
|
+
controlsInstance.set(control)
|
|
79
|
+
})
|
|
80
|
+
</script>
|
|
@@ -1,71 +1,5 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Light Halo Component
|
|
3
|
-
|
|
4
|
-
A beautiful animated light halo effect that pulses and moves around sprites.
|
|
5
|
-
Creates a glowing light effect with smooth animations for size and opacity.
|
|
6
|
-
|
|
7
|
-
## Design
|
|
8
|
-
|
|
9
|
-
The halo uses a radial gradient to create a soft light effect that:
|
|
10
|
-
- Pulses in size (breathing effect)
|
|
11
|
-
- Fades in and out (opacity animation)
|
|
12
|
-
- Can be positioned relative to the sprite
|
|
13
|
-
- Uses blur and alpha for realistic light diffusion
|
|
14
|
-
|
|
15
|
-
## Props
|
|
16
|
-
|
|
17
|
-
All props are optional and have sensible defaults:
|
|
18
|
-
- `baseRadius` (number, default: 30) - Base radius in pixels
|
|
19
|
-
- `radiusVariation` (number, default: 10) - Pulse variation range
|
|
20
|
-
- `baseOpacity` (number, default: 0.6) - Base opacity (0-1)
|
|
21
|
-
- `opacityVariation` (number, default: 0.3) - Opacity fade range
|
|
22
|
-
- `sizeSpeed` (number, default: 0.002) - Size animation speed
|
|
23
|
-
- `opacitySpeed` (number, default: 0.003) - Opacity animation speed
|
|
24
|
-
- `lightColor` (number, default: 0xffffaa) - Light color (hex)
|
|
25
|
-
|
|
26
|
-
@example
|
|
27
|
-
```ts
|
|
28
|
-
import LightHalo from './light-halo.ce';
|
|
29
|
-
|
|
30
|
-
// Basic usage with defaults
|
|
31
|
-
export default defineModule<RpgClient>({
|
|
32
|
-
sprite: {
|
|
33
|
-
componentsBehind: [LightHalo]
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
// Custom configuration
|
|
38
|
-
export default defineModule<RpgClient>({
|
|
39
|
-
sprite: {
|
|
40
|
-
componentsBehind: [{
|
|
41
|
-
component: LightHalo,
|
|
42
|
-
props: {
|
|
43
|
-
baseRadius: 50,
|
|
44
|
-
radiusVariation: 15,
|
|
45
|
-
lightColor: 0xffaaaa,
|
|
46
|
-
baseOpacity: 0.8
|
|
47
|
-
}
|
|
48
|
-
}]
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
// Dynamic props based on sprite state
|
|
53
|
-
export default defineModule<RpgClient>({
|
|
54
|
-
sprite: {
|
|
55
|
-
componentsBehind: [{
|
|
56
|
-
component: LightHalo,
|
|
57
|
-
props: (object: RpgClientObject) => ({
|
|
58
|
-
baseRadius: 30 + (object.param.level() * 2),
|
|
59
|
-
lightColor: object.param.level() > 10 ? 0xffaa00 : 0xffffaa
|
|
60
|
-
})
|
|
61
|
-
}]
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
```
|
|
65
|
-
-->
|
|
66
|
-
|
|
67
1
|
<Container x={position.@x} y={position.@y}>
|
|
68
|
-
<Graphics draw={drawHalo}
|
|
2
|
+
<Graphics draw={drawHalo} />
|
|
69
3
|
</Container>
|
|
70
4
|
|
|
71
5
|
<script>
|
|
@@ -181,9 +115,7 @@ const drawHalo = (g) => {
|
|
|
181
115
|
const color = getLightColor();
|
|
182
116
|
|
|
183
117
|
if (opacity <= 0 || radius <= 0) return;
|
|
184
|
-
|
|
185
|
-
g.clear();
|
|
186
|
-
|
|
118
|
+
|
|
187
119
|
// Set blend mode to ADD for glowing light effect
|
|
188
120
|
g.blendMode = 'add';
|
|
189
121
|
|
|
@@ -209,7 +141,6 @@ const drawHalo = (g) => {
|
|
|
209
141
|
// ====================
|
|
210
142
|
// Animation loop
|
|
211
143
|
// ====================
|
|
212
|
-
|
|
213
144
|
tick(() => {
|
|
214
145
|
time.update(t => t + 1);
|
|
215
146
|
});
|
|
@@ -15,15 +15,6 @@
|
|
|
15
15
|
}
|
|
16
16
|
</Container>
|
|
17
17
|
}
|
|
18
|
-
<Container positionType="absolute" top={0} left={0} right={0} bottom={0}>
|
|
19
|
-
@for (transition of transitions) {
|
|
20
|
-
<Container>
|
|
21
|
-
@for (activeTransition of transition.current) {
|
|
22
|
-
<transition.component ...activeTransition />
|
|
23
|
-
}
|
|
24
|
-
</Container>
|
|
25
|
-
}
|
|
26
|
-
</Container>
|
|
27
18
|
</Canvas>
|
|
28
19
|
|
|
29
20
|
<script>
|
|
@@ -39,7 +30,6 @@
|
|
|
39
30
|
const gui = computed(() => {
|
|
40
31
|
return Object.values(guiService.gui()).filter((gui) => !gui.attachToSprite)
|
|
41
32
|
})
|
|
42
|
-
const transitions = engine.transitions
|
|
43
33
|
const worldWidth = computed(() => sceneData()?.width)
|
|
44
34
|
const worldHeight = computed(() => sceneData()?.height)
|
|
45
35
|
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
import { inject } from "../../core/inject";
|
|
18
18
|
import { RpgClientEngine } from "../../RpgClientEngine";
|
|
19
19
|
import Character from "../character.ce";
|
|
20
|
+
import LightHalo from "../prebuilt/light-halo.ce";
|
|
20
21
|
|
|
21
22
|
const engine = inject(RpgClientEngine);
|
|
22
23
|
const { children } = defineProps()
|
package/src/index.ts
CHANGED
|
@@ -21,4 +21,5 @@ export { Control } from "./services/keyboardControls";
|
|
|
21
21
|
export { RpgClientObject } from "./Game/Object";
|
|
22
22
|
export { RpgClientPlayer } from "./Game/Player";
|
|
23
23
|
export { RpgClientEvent } from "./Game/Event";
|
|
24
|
-
export { withMobile } from "./components/gui/mobile";
|
|
24
|
+
export { withMobile } from "./components/gui/mobile";
|
|
25
|
+
export * from "./services/AbstractSocket";
|
package/src/module.ts
CHANGED
|
@@ -159,8 +159,13 @@ export function provideClientModules(modules: RpgClientModule[]): FactoryProvide
|
|
|
159
159
|
const transitions = [...module.transitions];
|
|
160
160
|
module.transitions = {
|
|
161
161
|
load: (engine: RpgClientEngine) => {
|
|
162
|
+
const guiService = inject(engine.context, RpgGui) as RpgGui;
|
|
162
163
|
transitions.forEach((transition) => {
|
|
163
|
-
|
|
164
|
+
guiService.add({
|
|
165
|
+
name: transition.id,
|
|
166
|
+
component: transition.component,
|
|
167
|
+
data: transition.props || {}
|
|
168
|
+
});
|
|
164
169
|
});
|
|
165
170
|
},
|
|
166
171
|
};
|
|
@@ -22,6 +22,7 @@ class BridgeWebsocket extends AbstractWebsocket {
|
|
|
22
22
|
return server
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
private serverInstance: any;
|
|
25
26
|
|
|
26
27
|
constructor(protected context: Context, private server: any) {
|
|
27
28
|
super(context);
|
|
@@ -30,15 +31,15 @@ class BridgeWebsocket extends AbstractWebsocket {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
async connection(listeners?: (data: any) => void) {
|
|
33
|
-
|
|
34
|
-
await
|
|
35
|
-
this.context.set('server',
|
|
34
|
+
this.serverInstance = new this.server(this.room);
|
|
35
|
+
await this.serverInstance.onStart();
|
|
36
|
+
this.context.set('server', this.serverInstance)
|
|
36
37
|
return this._connection(listeners)
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
private async _connection(listeners?: (data: any) => void) {
|
|
40
|
-
|
|
41
|
-
this.socket = new ClientIo(
|
|
41
|
+
this.serverInstance = this.context.get('server')
|
|
42
|
+
this.socket = new ClientIo(this.serverInstance, 'player-client-id');
|
|
42
43
|
const url = new URL('http://localhost')
|
|
43
44
|
const request = new Request(url.toString(), {
|
|
44
45
|
method: 'GET',
|
|
@@ -47,7 +48,7 @@ class BridgeWebsocket extends AbstractWebsocket {
|
|
|
47
48
|
}
|
|
48
49
|
})
|
|
49
50
|
listeners?.(this.socket)
|
|
50
|
-
await
|
|
51
|
+
await this.serverInstance.onConnect(this.socket.conn as any, { request } as any);
|
|
51
52
|
this.room.clients.set(this.socket.id, this.socket);
|
|
52
53
|
return this.socket
|
|
53
54
|
}
|
|
@@ -114,6 +115,14 @@ class BridgeWebsocket extends AbstractWebsocket {
|
|
|
114
115
|
listeners?.(socket)
|
|
115
116
|
})
|
|
116
117
|
}
|
|
118
|
+
|
|
119
|
+
getServer() {
|
|
120
|
+
return this.serverInstance
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
getSocket() {
|
|
124
|
+
return this.socket
|
|
125
|
+
}
|
|
117
126
|
}
|
|
118
127
|
|
|
119
128
|
class UpdateMapStandaloneService extends UpdateMapService {
|
|
@@ -162,4 +171,4 @@ export function provideRpg(server: any) {
|
|
|
162
171
|
RpgGui,
|
|
163
172
|
RpgClientEngine,
|
|
164
173
|
];
|
|
165
|
-
}
|
|
174
|
+
}
|
package/vite.config.ts
CHANGED
|
@@ -19,9 +19,11 @@ export default defineConfig({
|
|
|
19
19
|
sourcemap: true,
|
|
20
20
|
minify: false,
|
|
21
21
|
lib: {
|
|
22
|
-
entry:
|
|
22
|
+
entry: {
|
|
23
|
+
index: 'src/index.ts'
|
|
24
|
+
},
|
|
23
25
|
formats: ['es'],
|
|
24
|
-
fileName:
|
|
26
|
+
fileName: (format, entryName) => `${entryName}.js`
|
|
25
27
|
},
|
|
26
28
|
rollupOptions: {
|
|
27
29
|
external: [/@rpgjs/, 'esbuild', 'canvasengine', '@canvasengine/presets', 'rxjs', 'pixi.js'],
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manages active transitions in the game
|
|
3
|
-
*
|
|
4
|
-
* This class handles the lifecycle of screen transitions, such as fade effects,
|
|
5
|
-
* slide transitions, or any custom transition components. It maintains a list
|
|
6
|
-
* of currently active transitions and provides methods to start and finish them.
|
|
7
|
-
*
|
|
8
|
-
* ## Design
|
|
9
|
-
*
|
|
10
|
-
* - Uses signals to track active transitions reactively
|
|
11
|
-
* - Each transition has a unique ID for identification
|
|
12
|
-
* - Transitions automatically remove themselves when finished via onFinish callback
|
|
13
|
-
* - Supports multiple simultaneous transitions if needed
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* const manager = new TransitionManager();
|
|
18
|
-
*
|
|
19
|
-
* // Start a fade transition
|
|
20
|
-
* manager.start('fade', { duration: 1000 });
|
|
21
|
-
*
|
|
22
|
-
* // Check active transitions
|
|
23
|
-
* console.log(manager.current()); // Array of active transitions
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export declare class TransitionManager {
|
|
27
|
-
/**
|
|
28
|
-
* Signal containing all currently active transitions
|
|
29
|
-
*
|
|
30
|
-
* Each transition object contains:
|
|
31
|
-
* - id: Unique identifier
|
|
32
|
-
* - props: Properties passed to the transition component
|
|
33
|
-
* - onFinish: Callback to remove the transition when complete
|
|
34
|
-
*/
|
|
35
|
-
current: import('canvasengine').WritableArraySignal<any[]>;
|
|
36
|
-
/**
|
|
37
|
-
* Start a new transition
|
|
38
|
-
*
|
|
39
|
-
* Creates a new transition instance with the given props and adds it to
|
|
40
|
-
* the active transitions list. The transition will be automatically removed
|
|
41
|
-
* when it calls its onFinish callback.
|
|
42
|
-
*
|
|
43
|
-
* @param props - Properties to pass to the transition component (must include onFinish)
|
|
44
|
-
* @returns The created transition object with id and onFinish callback
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```ts
|
|
48
|
-
* const transition = manager.start({
|
|
49
|
-
* duration: 1000,
|
|
50
|
-
* color: 'black',
|
|
51
|
-
* onFinish: () => console.log('Transition complete')
|
|
52
|
-
* });
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
start(props: any): any;
|
|
56
|
-
}
|
package/dist/index10.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index10.js","sources":["../src/components/gui/dialogbox/index.ce"],"sourcesContent":["<Container justifyContent=\"center\" alignItems=\"center\" width=\"100%\" height=\"100%\">\n <Container\n ref=\"dialogbox\"\n scale={{ x: scaleX }}\n anchor={[0.5, 0.5]}\n width={widthBox}\n height\n controls\n ...positionBox()\n >\n <Rect \n width={widthBox} \n height \n color={@dialogboxStyles.@backgroundColor} \n alpha={@dialogboxStyles.@backgroundOpacity} />\n <Container\n flexDirection=\"row\"\n width={widthBox}\n height\n alpha={contentOpacity}\n >\n <Container flexDirection=\"row\">\n <Container flexDirection=\"column\">\n <Text\n text\n color=\"#fff\"\n fontSize={18}\n margin\n typewriter\n style={textStyle}\n />\n @if (visibleSelection) {\n <Selection selectedIndex={0} items={choices} onSelect />\n }\n </Container>\n @if (face) {\n <Sprite sheet={@faceSheet(@face.@id, @face.@expression)} />\n }\n </Container>\n </Container>\n</Container> \n\n \n</Container>\n<script>\n import Selection from './selection.ce'\n\n import {\n animatedSignal,\n computed,\n effect,\n signal,\n trigger,\n mount\n } from \"canvasengine\";\n\n import { inject } from \"../../../core/inject\";\n import { RpgClientEngine } from \"../../../RpgClientEngine\";\n import BoxComponent from \"../box.ce\";\n\n const {\n message,\n choices: _choices,\n onFinish,\n onInteraction,\n face,\n position,\n typewriterEffect,\n autoClose\n } = defineProps();\n \n const client = inject(RpgClientEngine);\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const dialogboxStyles = client.globalConfig.box.styles ?? {\n backgroundColor: \"#1a1a2e\",\n backgroundOpacity: 0.9,\n }\n const dialogBoxTypewriterSound = client.globalConfig?.box?.sounds?.typewriter\n\n const sounds = client.sounds;\n\n client.stopProcessingInput = true;\n let isDestroyed = false;\n\n const texts = [message()]\n const height = signal(256);\n const margin = signal(40);\n const isTextCompleted = signal(false);\n\n const drawSpeaker = (g) => {\n g.beginFill(0xffa500); // Orange color\n g.lineStyle(2, 0x000000); // Black border\n g.moveTo(0, 0);\n g.lineTo(70, 0);\n g.lineTo(80, 15);\n g.lineTo(70, 30);\n g.lineTo(0, 30);\n g.lineTo(0, 0);\n g.endFill();\n };\n\n const border = signal({ width: 5, color: \"#595971\" });\n const shadow = signal({ color: \"#000\", blur: 10, offsetX: 10, offsetY: 10 });\n\n const contentOpacity = animatedSignal(0, {\n duration: 1000,\n });\n\n const scaleX = animatedSignal(0, {\n duration: 500,\n });\n\n const positionBox = computed(() => {\n if (position() === 'bottom') {\n return { positionType: 'absolute', bottom: 10 };\n }\n else if (position() === 'top') {\n return { positionType: 'absolute', top: 10 };\n }\n return {};\n });\n\n const widthBox = computed(() => {\n return 700;\n });\n\n scaleX.set(1);\n contentOpacity.set(1);\n\n const currentTextIndex = signal(0);\n const currentText = computed(() => texts?.[currentTextIndex()] ?? '');\n const isChoiceDisplayed = signal(false);\n\n const text = computed(() => {\n const current = currentText();\n return typeof current === \"string\" ? current : current.text;\n });\n\n const faceSheet = (graphicId, animationName) => {\n return {\n definition: client.getSpriteSheet(graphicId),\n playing: animationName,\n };\n }\n\n const choices = computed(() => {\n //const current = currentText();\n //return typeof current === \"string\" ? null : current.choices;\n return _choices;\n });\n\n const visibleSelection = computed(() => isChoiceDisplayed() && choices().length != 0)\n\n const triggerSkip = trigger();\n\n const typewriter = typewriterEffect() ? {\n speed: 0.3,\n skip: triggerSkip,\n sound: {\n src: sounds.get(dialogBoxTypewriterSound)?.src\n },\n onComplete: () => {\n isTextCompleted.set(true);\n if (autoClose()) {\n setTimeout(() => {\n onFinish();\n }, 1000);\n }\n }\n } : null;\n\n const textStyle = {\n wordWrap: true,\n wordWrapWidth: widthBox() - margin() * 2 - (face ? 256 : 0)\n }\n\n mount((element) => {\n const [dialogbox] = element.props.children\n return () => {\n dialogbox.directives.controls.onDestroy()\n isDestroyed = true;\n // Wait destroy is finished before start processing input\n setTimeout(() => {\n client.stopProcessingInput = false;\n }, 500)\n }\n })\n\n const controls = signal({\n next: {\n bind: keyboardControls.action,\n keyDown(e) {\n if (isDestroyed) return;\n if (isChoiceDisplayed()) {\n // If choices are displayed, do nothing (wait for selection)\n return;\n }\n\n // If text is still typing, just skip (fast forward) the animation\n if (!isTextCompleted()) {\n triggerSkip.start();\n isTextCompleted.set(true);\n }\n else {\n const isFinished = currentTextIndex() === texts.length - 1;\n currentTextIndex.update((index) => {\n if (index < texts.length - 1) {\n return index + 1;\n }\n return index;\n });\n isChoiceDisplayed.set(false);\n isTextCompleted.set(false);\n if (isFinished && onFinish) {\n onFinish();\n } \n }\n },\n },\n });\n\n const onSelect = (index) => {\n onFinish(index);\n }\n \n effect(() => {\n if (choices().length != 0) {\n isChoiceDisplayed.set(true);\n }\n });\n</script>"],"names":["Selection"],"mappings":";;;;;AAYqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,QAAQ,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,YAAY;AAC9D,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,EAAE;AAC5C,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC7D,YAAY,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;AAC5B,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;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,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,eAAe,EAAE,KAAK,EAAE,eAAe,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAACA,WAAS,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7xB,QAAQ,OAAO;AACf,MAAM;;;;"}
|
package/dist/index11.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index11.js","sources":["../src/components/gui/box.ce"],"sourcesContent":["<Container positionType=\"absolute\" top={top} left={left}>\n <Container\n anchor={[0.5, 0.5]}\n >\n <Rect width height color={_color} />\n <Container attach={child}></Container>\n </Container> \n</Container>\n\n<script>\n import { RpgClientEngine, inject } from \"../../index\";\n\n const { width, height, children, color, top, left } = defineProps();\n const engine = inject(RpgClientEngine)\n const child = children[0]\n const _color = computed(() => engine.globalConfig.gui?.windowColor || color?.() || \"#1a1a2e\")\n</script>"],"names":[],"mappings":";;;;;;;;;;;;;AAOqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,EAAE,GAAG,WAAW,EAAE,EAAE,KAAK,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,EAAE,CAAC,KAAK,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE,IAAI,GAAG,EAAE,CAAC,IAAI;AAC5I,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AACpC,IAAI,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;AACvB,IAAI,MAAM,GAAG,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,WAAW,MAAM,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,EAAE,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC;AAClN,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AACvM,QAAQ,OAAO;AACf,MAAM;;;;"}
|
package/dist/index12.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index12.js","sources":["../src/components/animations/index.ts"],"sourcesContent":["import Hit from \"./hit.ce\";\nimport Animation from \"./animation.ce\";\n\nexport const PrebuiltComponentAnimations = {\n Hit,\n Animation\n}"],"names":["Hit","Animation"],"mappings":";;;AAGO,MAAM,2BAAA,GAA8B;AAAA,OACvCA,WAAA;AAAA,aACAC;AACJ;;;;"}
|
package/dist/index13.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index13.js","sources":["../src/components/prebuilt/hp-bar.ce"],"sourcesContent":["<!-- \n HP Bar Component\n \n A beautiful, animated health bar component for displaying player HP above sprites.\n Features a gradient color based on HP level, smooth animations, and modern styling.\n \n ## Design\n \n The bar changes color dynamically based on HP percentage:\n - Green (#4ade80) when HP > 60% - Healthy state\n - Yellow (#facc15) when HP 30-60% - Caution state \n - Orange (#fb923c) when HP 15-30% - Danger state\n - Red (#ef4444) when HP < 15% - Critical state\n \n @example\n ```ts\n import HpBar from './hp-bar.ce';\n \n // In module configuration\n export default defineModule<RpgClient>({\n sprite: {\n componentsInFront: [HpBar]\n }\n })\n ```\n-->\n\n<Container x={position.@x} y={position.@y}>\n <!-- Background shadow for depth effect -->\n <Graphics draw={drawShadow} x={1} y={1} />\n \n <!-- Main background -->\n <Graphics draw={drawBackground} />\n \n <!-- HP fill bar -->\n <Graphics draw={drawFill} />\n \n <!-- Highlight overlay for 3D effect -->\n <Graphics draw={drawHighlight} />\n \n <!-- Border frame -->\n <Graphics draw={drawBorder} />\n</Container>\n\n<script>\nimport { computed, animatedSignal, effect } from \"canvasengine\";\n\nconst { object } = defineProps();\n\n// ====================\n// Configuration\n// ====================\n\n/** Total width of the HP bar in pixels */\nconst barWidth = 50;\n\n/** Total height of the HP bar in pixels */\nconst barHeight = 8;\n\n/** Border radius for rounded corners */\nconst borderRadius = 4;\n\n/** Inner border radius for the fill bar */\nconst innerRadius = 3;\n\n/** Padding between background and fill */\nconst padding = 1;\n\n/** Background color (dark theme) */\nconst bgColor = 0x16213e;\n\n/** Shadow color */\nconst shadowColor = 0x000000;\n\n/** Border color */\nconst borderColor = 0x4a5568;\n\n// ====================\n// Calculated dimensions\n// ====================\n\n/** Maximum fill width */\nconst maxFillWidth = barWidth - (padding * 2);\n\n/** Fill height */\nconst fillHeight = barHeight - (padding * 2);\n\n/** Highlight height (half of fill) */\nconst highlightHeight = Math.floor(fillHeight / 2);\n\n// ====================\n// Reactive HP values\n// ====================\n\n/** Gets hitbox dimensions for positioning */\nconst hitbox = object.hitbox;\n\n/**\n * Gets the current HP value from the player object\n * Uses hpSignal which is synchronized from the server\n */\nconst currentHp = computed(() => {\n return object.hpSignal?.() ?? 0;\n});\n\n/**\n * Gets the maximum HP value from player parameters\n * Reads from _param.maxHp which contains calculated stats\n */\nconst maxHp = computed(() => {\n const params = object._param?.() ?? {};\n return params.maxHp ?? 100;\n});\n\n/**\n * Calculates HP percentage (0 to 1)\n */\nconst hpPercent = computed(() => {\n const max = maxHp();\n if (max <= 0) return 0;\n const percent = currentHp() / max;\n return Math.max(0, Math.min(1, percent));\n});\n\n// ====================\n// Animated values\n// ====================\n\n/**\n * Animated percentage for smooth bar transitions\n */\nconst animatedPercent = animatedSignal(hpPercent(), {\n duration: 300,\n easing: 'easeOutCubic'\n});\n\n// Update animated value when HP changes\neffect(() => {\n const newPercent = hpPercent();\n animatedPercent.set(newPercent);\n});\n\n// ====================\n// Visual calculations\n// ====================\n\n/**\n * Position of the bar relative to the sprite\n */\nconst position = computed(() => ({\n x: (hitbox().w / 2) - (barWidth / 2),\n y: -barHeight - 8\n}));\n\n/**\n * Current width of the HP fill based on animated percentage\n */\nconst fillWidth = computed(() => {\n const percent = animatedPercent();\n const width = maxFillWidth * percent;\n // Ensure minimum visible width when HP > 0\n if (percent > 0 && width < innerRadius * 2) {\n return innerRadius * 2;\n }\n return Math.max(0, width);\n});\n\n/**\n * Determines HP bar color based on current HP percentage\n * Returns hex color number for PixiJS\n * \n * ## Color Thresholds\n * - Green (0x4ade80): HP > 60% - Healthy\n * - Yellow (0xfacc15): HP 30-60% - Caution\n * - Orange (0xfb923c): HP 15-30% - Danger\n * - Red (0xef4444): HP < 15% - Critical\n */\nconst hpColorHex = computed(() => {\n const percent = hpPercent();\n \n if (percent > 0.6) {\n return 0x4ade80; // Green - healthy\n } else if (percent > 0.3) {\n return 0xfacc15; // Yellow - caution\n } else if (percent > 0.15) {\n return 0xfb923c; // Orange - danger\n } else {\n return 0xef4444; // Red - critical\n }\n});\n\n// ====================\n// Drawing functions\n// ====================\n\n/**\n * Draws the shadow behind the HP bar for depth effect\n */\nconst drawShadow = (g) => {\n g.roundRect(0, 0, barWidth, barHeight, borderRadius);\n g.fill({ color: shadowColor, alpha: 0.3 });\n};\n\n/**\n * Draws the main background of the HP bar\n */\nconst drawBackground = (g) => {\n g.roundRect(0, 0, barWidth, barHeight, borderRadius);\n g.fill({ color: bgColor, alpha: 0.9 });\n};\n\n/**\n * Draws the HP fill bar with dynamic color\n */\nconst drawFill = (g) => {\n const width = fillWidth();\n if (width > 0) {\n g.roundRect(padding, padding, width, fillHeight, innerRadius);\n g.fill({ color: hpColorHex() });\n }\n};\n\n/**\n * Draws the highlight overlay for 3D effect\n */\nconst drawHighlight = (g) => {\n const width = fillWidth();\n if (width > 0) {\n g.roundRect(padding, padding, width, highlightHeight, innerRadius);\n g.fill({ color: 0xffffff, alpha: 0.25 });\n }\n};\n\n/**\n * Draws the border frame around the HP bar\n * \n * Uses PixiJS Graphics API to create a rounded rectangle stroke\n * that serves as a visual border for the bar.\n * \n * @param g - PixiJS Graphics object\n * \n * @example\n * ```html\n * <Graphics draw={drawBorder} />\n * ```\n */\nconst drawBorder = (g) => {\n g.roundRect(0, 0, barWidth, barHeight, borderRadius);\n g.stroke({ \n color: borderColor, \n width: 1,\n alpha: 0.7\n });\n};\n</script>\n"],"names":[],"mappings":";;AAOqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,MAAM,GAAG,WAAW,EAAE,CAAC,MAAM;AACzC,IAAI,QAAQ,GAAG,EAAE;AACjB,IAAI,SAAS,GAAG,CAAC;AACjB,IAAI,YAAY,GAAG,CAAC;AACpB,IAAI,WAAW,GAAG,CAAC;AACnB,IAAI,OAAO,GAAG,CAAC;AACf,IAAI,OAAO,GAAG,QAAQ;AACtB,IAAI,WAAW,GAAG,QAAQ;AAC1B,IAAI,WAAW,GAAG,QAAQ;AAC1B,IAAI,YAAY,GAAG,QAAQ,IAAI,OAAO,GAAG,CAAC,CAAC;AAC3C,IAAI,UAAU,GAAG,SAAS,IAAI,OAAO,GAAG,CAAC,CAAC;AAC1C,IAAI,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC;AAChD,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM;AAC1B,IAAI,SAAS,GAAG,QAAQ,CAAC,YAAY;AACrC,IAAI,IAAI,EAAE,EAAE,EAAE;AACd,IAAI,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,QAAQ,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,EAAE,GAAG,CAAC;AAChI,CAAC,CAAC;AACF,IAAI,KAAK,GAAG,QAAQ,CAAC,YAAY;AACjC,IAAI,IAAI,EAAE,E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I,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;AAC1S,QAAQ,OAAO;AACf,MAAM;;;;"}
|
package/dist/index14.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index14.js","sources":["../src/components/prebuilt/light-halo.ce"],"sourcesContent":["<!-- \n Light Halo Component\n \n A beautiful animated light halo effect that pulses and moves around sprites.\n Creates a glowing light effect with smooth animations for size and opacity.\n \n ## Design\n \n The halo uses a radial gradient to create a soft light effect that:\n - Pulses in size (breathing effect)\n - Fades in and out (opacity animation)\n - Can be positioned relative to the sprite\n - Uses blur and alpha for realistic light diffusion\n \n ## Props\n \n All props are optional and have sensible defaults:\n - `baseRadius` (number, default: 30) - Base radius in pixels\n - `radiusVariation` (number, default: 10) - Pulse variation range\n - `baseOpacity` (number, default: 0.6) - Base opacity (0-1)\n - `opacityVariation` (number, default: 0.3) - Opacity fade range\n - `sizeSpeed` (number, default: 0.002) - Size animation speed\n - `opacitySpeed` (number, default: 0.003) - Opacity animation speed\n - `lightColor` (number, default: 0xffffaa) - Light color (hex)\n \n @example\n ```ts\n import LightHalo from './light-halo.ce';\n \n // Basic usage with defaults\n export default defineModule<RpgClient>({\n sprite: {\n componentsBehind: [LightHalo]\n }\n })\n \n // Custom configuration\n export default defineModule<RpgClient>({\n sprite: {\n componentsBehind: [{\n component: LightHalo,\n props: {\n baseRadius: 50,\n radiusVariation: 15,\n lightColor: 0xffaaaa,\n baseOpacity: 0.8\n }\n }]\n }\n })\n \n // Dynamic props based on sprite state\n export default defineModule<RpgClient>({\n sprite: {\n componentsBehind: [{\n component: LightHalo,\n props: (object: RpgClientObject) => ({\n baseRadius: 30 + (object.param.level() * 2),\n lightColor: object.param.level() > 10 ? 0xffaa00 : 0xffffaa\n })\n }]\n }\n })\n ```\n-->\n\n<Container x={position.@x} y={position.@y}>\n <Graphics draw={drawHalo} />\n</Container>\n\n<script>\nimport { computed, signal, tick, mount } from \"canvasengine\";\nimport { BlurFilter } from \"pixi.js\";\n\n/**\n * Component props for LightHalo\n * \n * All props are signals (even static ones) and must be read with `()`.\n * Props are optional and will use default values if not provided.\n * \n * @property {Object} object - The sprite object (required)\n * @property {number|Signal<number>} [baseRadius] - Base radius of the light halo in pixels (default: 30)\n * @property {number|Signal<number>} [radiusVariation] - Radius variation range (halo will pulse between baseRadius ± radiusVariation) (default: 10)\n * @property {number|Signal<number>} [baseOpacity] - Base opacity of the light halo (0 to 1) (default: 0.6)\n * @property {number|Signal<number>} [opacityVariation] - Opacity variation range (halo will fade between baseOpacity ± opacityVariation) (default: 0.3)\n * @property {number|Signal<number>} [sizeSpeed] - Animation speed for size pulsing (higher = faster) (default: 0.002)\n * @property {number|Signal<number>} [opacitySpeed] - Animation speed for opacity fading (higher = faster) (default: 0.003)\n * @property {number|Signal<number>} [lightColor] - Color of the light halo (hex value, warm yellow-white by default: 0xffffaa)\n */\nconst { \n object, \n baseRadius,\n radiusVariation,\n baseOpacity,\n opacityVariation,\n sizeSpeed,\n opacitySpeed,\n lightColor\n} = defineProps();\n\n// ====================\n// Props with default values\n// ====================\n\nconst getBaseRadius = computed(() => baseRadius?.() ?? 30);\nconst getRadiusVariation = computed(() => radiusVariation?.() ?? 10);\nconst getBaseOpacity = computed(() => baseOpacity?.() ?? 0.6);\nconst getOpacityVariation = computed(() => opacityVariation?.() ?? 0.3);\nconst getSizeSpeed = computed(() => sizeSpeed?.() ?? 0.002);\nconst getOpacitySpeed = computed(() => opacitySpeed?.() ?? 0.003);\nconst getLightColor = computed(() => lightColor?.() ?? 0xffffaa);\n\n// ====================\n// Animation state\n// ====================\n\n/** Time counter for animations */\nconst time = signal(0);\n\n/**\n * Current radius of the halo with pulsing animation\n * Uses multiple sine waves for more organic movement\n */\nconst currentRadius = computed(() => {\n const t = time();\n const base = getBaseRadius();\n const variation = getRadiusVariation();\n const speed = getSizeSpeed();\n \n // Combine two sine waves for less predictable pulsing\n const pulse1 = Math.sin(t * speed);\n const pulse2 = Math.sin(t * speed * 1.5) * 0.5;\n const combinedPulse = (pulse1 + pulse2) / 1.5;\n \n return base + (combinedPulse * variation);\n});\n\n/**\n * Current opacity of the halo with fading animation\n * Includes a subtle flicker effect\n */\nconst currentOpacity = computed(() => {\n const t = time();\n const base = getBaseOpacity();\n const variation = getOpacityVariation();\n const speed = getOpacitySpeed();\n \n // Main breathing cycle\n const fade = Math.sin(t * speed);\n \n // Subtle high-frequency flicker (candle-like)\n const flicker = (Math.random() - 0.5) * 0.1;\n \n return Math.max(0, Math.min(1, base + (fade * variation) + flicker));\n});\n\n// ====================\n// Position calculations\n// ====================\n\nconst hitbox = object.hitbox;\n\nconst position = computed(() => ({\n x: hitbox().w / 2,\n y: hitbox().h / 2\n}));\n\n// ====================\n// Drawing function\n// ====================\n\n// Create filters once to avoid recreation on every frame\nconst blurFilter = new BlurFilter({ strength: 20, quality: 3 });\n\n/**\n * Draws the light halo effect with realistic diffusion\n */\nconst drawHalo = (g) => {\n const radius = currentRadius();\n const opacity = currentOpacity();\n const color = getLightColor();\n \n if (opacity <= 0 || radius <= 0) return;\n \n g.clear();\n \n // Set blend mode to ADD for glowing light effect\n g.blendMode = 'add';\n \n // Apply blur filter for soft light diffusion\n g.filters = [blurFilter];\n \n // Draw main light source\n // The blur filter will spread this out into a nice gradient\n g.circle(0, 0, radius);\n g.fill({ \n color: color, \n alpha: opacity \n });\n \n // Draw a smaller, brighter core\n g.circle(0, 0, radius * 0.4);\n g.fill({ \n color: 0xffffff, \n alpha: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CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,MAAM,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AACzI,QAAQ,OAAO;AACf,MAAM;;;;"}
|
package/dist/index15.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AnimationSpritesheetPreset } from './index36.js';
|
|
2
|
-
import { LPCSpritesheetPreset } from './index37.js';
|
|
3
|
-
import { RMSpritesheet } from './index38.js';
|
|
4
|
-
import { FacesetPreset } from './index39.js';
|
|
5
|
-
|
|
6
|
-
const Presets = {
|
|
7
|
-
RMSpritesheet,
|
|
8
|
-
LPCSpritesheetPreset,
|
|
9
|
-
AnimationSpritesheetPreset,
|
|
10
|
-
FacesetPreset
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export { Presets };
|
|
14
|
-
//# sourceMappingURL=index15.js.map
|
package/dist/index15.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index15.js","sources":["../src/presets/index.ts"],"sourcesContent":["import { AnimationSpritesheetPreset } from \"./animation\";\nimport { LPCSpritesheetPreset } from \"./lpc\";\nimport { RMSpritesheet } from \"./rmspritesheet\";\nimport { FacesetPreset } from \"./faceset\";\n\nexport const Presets = {\n RMSpritesheet,\n LPCSpritesheetPreset,\n AnimationSpritesheetPreset,\n FacesetPreset\n}"],"names":[],"mappings":";;;;;AAKO,MAAM,OAAA,GAAU;AAAA,EACnB,aAAA;AAAA,EACA,oBAAA;AAAA,EACA,0BAAA;AAAA,EACA;AACJ;;;;"}
|
package/dist/index16.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index16.js","sources":["../src/components/scenes/event-layer.ce"],"sourcesContent":["<Container sortableChildren={true}>\n @for ((event,id) of events) {\n <Character id={id} object={event} />\n }\n\n @for ((player,id) of players) {\n <Character id={id} object={player} />\n }\n\n @for (child of children) {\n <child />\n }\n</Container>\n\n<script>\n import { effect, signal } from 'canvasengine'\n import { inject } from \"../../core/inject\";\n import { RpgClientEngine } from \"../../RpgClientEngine\";\n import Character from \"../character.ce\";\n \n const engine = inject(RpgClientEngine);\n const { children } = defineProps()\n \n const players = engine.sceneMap.players\n const events = engine.sceneMap.events\n</script>"],"names":["Character"],"mappings":";;;;;AAQqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AAC5C,IAAI,QAAQ,GAAG,WAAW,EAAE,CAAC,QAAQ;AACrC,IAAI,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO;AACrC,IAAI,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC7B,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,CAACA,WAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAACA,WAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/O,QAAQ,OAAO;AACf,MAAM;;;;"}
|