@drincs/pixi-vn 1.8.24 → 1.9.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/README.md +23 -1
- package/dist/{ContainerMemory-D2HtgX7w.d.cts → ContainerMemory-BpDgacyr.d.cts} +2 -15
- package/dist/{ContainerMemory-D2HtgX7w.d.ts → ContainerMemory-BpDgacyr.d.ts} +2 -15
- package/dist/{HistoryChoiceMenuOption-BMsYentw.d.cts → HistoryChoiceMenuOption-BxMSXnyI.d.cts} +10 -1
- package/dist/{HistoryChoiceMenuOption-DQ-pnuPU.d.ts → HistoryChoiceMenuOption-hSI4SHV-.d.ts} +10 -1
- package/dist/{HistoryGameState-CmjUtlkV.d.ts → HistoryGameState-C8ATx9K6.d.ts} +1 -1
- package/dist/{HistoryGameState-C28NcKKl.d.cts → HistoryGameState-CGfvq5iL.d.cts} +1 -1
- package/dist/{HistoryStep-G9dUn0Lf.d.cts → HistoryStep-WGB6nA4N.d.cts} +5 -0
- package/dist/{HistoryStep-G9dUn0Lf.d.ts → HistoryStep-WGB6nA4N.d.ts} +5 -0
- package/dist/{OpenedLabel-DLfFuZgk.d.ts → OpenedLabel-CmRdzTXP.d.ts} +1 -1
- package/dist/{OpenedLabel-BxfL31aQ.d.cts → OpenedLabel-Cmd675NI.d.cts} +1 -1
- package/dist/SoundGameState-C_6ZsQX6.d.cts +186 -0
- package/dist/SoundGameState-C_6ZsQX6.d.ts +186 -0
- package/dist/{StorageGameState-CtjNJpvE.d.cts → StorageGameState-C3PGrFPr.d.cts} +2 -2
- package/dist/{StorageGameState-BJy57o6K.d.ts → StorageGameState-jAexrJLj.d.ts} +2 -2
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +265 -24
- package/dist/canvas.d.ts +265 -24
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.mjs +1 -1
- package/dist/chunk-HD353M4B.mjs +1 -0
- package/dist/chunk-I7DOUH5V.mjs +1 -0
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +51 -15
- package/dist/history.d.ts +51 -15
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +53 -34
- package/dist/index.d.ts +53 -34
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +2 -2
- package/dist/narration.d.cts +211 -52
- package/dist/narration.d.ts +211 -52
- package/dist/narration.mjs +2 -2
- package/dist/pixi/browser.js +115 -115
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +313 -6
- package/dist/sound.d.ts +313 -6
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +50 -3
- package/dist/storage.d.ts +50 -3
- package/dist/storage.mjs +1 -1
- package/dist/vite.cjs +2 -2
- package/dist/vite.mjs +2 -2
- package/package.json +2 -1
- package/dist/SoundManagerInterface-Dd0b88_N.d.cts +0 -436
- package/dist/SoundManagerInterface-Dd0b88_N.d.ts +0 -436
- package/dist/chunk-GIYMPXBT.mjs +0 -1
- package/dist/chunk-IWAXXFXE.mjs +0 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<a target="_blank" href="https://discord.gg/E95FZWakzp" rel="noopener noreferrer nofollow"><img alt="Discord" src="https://img.shields.io/discord/1263071210011496501?color=7289da&label=discord"></a>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
|
-
Pixi’VN is a very versatile and powerful
|
|
13
|
+
Pixi’VN is a very versatile and powerful story-driven engine. It is based on JavaScript/TypeScript and [PixiJS](https://pixijs.com/).
|
|
14
14
|
|
|
15
15
|
It provides the following features:
|
|
16
16
|
|
|
@@ -135,3 +135,25 @@ body {
|
|
|
135
135
|
overflow: hidden;
|
|
136
136
|
}
|
|
137
137
|
```
|
|
138
|
+
|
|
139
|
+
## Agent Skills
|
|
140
|
+
|
|
141
|
+
Pixi'VN ships a set of [Agent Skills](https://www.skills.sh/) that teach AI coding assistants (like Claude Code) how to correctly use each part of the engine. If you use Claude Code, you can install all of them into your project with:
|
|
142
|
+
|
|
143
|
+
```npm
|
|
144
|
+
npx skills add DRincs-Productions/pixi-vn
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This installs every skill below and prompts you to pick which ones to keep. To install only specific ones, add `--skill <name>` (repeat the flag to install several, e.g. `--skill canvas --skill sound`). Use `--list` instead of installing to just see what's available. Available skills:
|
|
148
|
+
|
|
149
|
+
- `getting-started` — installing the package and initializing the `Game`
|
|
150
|
+
- `assets` — local vs. online assets, the manifest/bundle/alias system, and loading strategy
|
|
151
|
+
- `canvas` — images, sprites, text, video, transitions and effects
|
|
152
|
+
- `characters` — defining and registering characters
|
|
153
|
+
- `history` — going back/rewinding and reading the narration backlog
|
|
154
|
+
- `narration` — labels, dialogue and choices
|
|
155
|
+
- `saves` — exporting/restoring game state and persisting save files
|
|
156
|
+
- `sound` — music, sound effects and audio channels
|
|
157
|
+
- `storage` — game variables, flags and stored classes
|
|
158
|
+
- `ui` — mounting HTML/PixiJS UI layers over the canvas, screen navigation, theming, and connecting UI to storage
|
|
159
|
+
- `migration` — upgrading an existing project to the current version
|
|
@@ -82,19 +82,6 @@ interface TickerHistory<TArgs extends TickerArgs> {
|
|
|
82
82
|
paused?: boolean;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
type PauseType = {
|
|
86
|
-
/**
|
|
87
|
-
* The type of the value
|
|
88
|
-
*/
|
|
89
|
-
type: "pause";
|
|
90
|
-
/**
|
|
91
|
-
* Duration in seconds
|
|
92
|
-
*/
|
|
93
|
-
duration: number;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
type RepeatType = "repeat";
|
|
97
|
-
|
|
98
85
|
interface TickersStep<TArgs extends TickerArgs> {
|
|
99
86
|
/**
|
|
100
87
|
* Ticker class name
|
|
@@ -124,7 +111,7 @@ interface TickersSequence {
|
|
|
124
111
|
/**
|
|
125
112
|
* The steps of the tickers
|
|
126
113
|
*/
|
|
127
|
-
steps:
|
|
114
|
+
steps: TickersStep<any>[];
|
|
128
115
|
}
|
|
129
116
|
|
|
130
117
|
/**
|
|
@@ -389,4 +376,4 @@ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends Con
|
|
|
389
376
|
elements: CanvasBaseItemMemory[];
|
|
390
377
|
}
|
|
391
378
|
|
|
392
|
-
export { type AdditionalPositionsExtensionProps as A, type CanvasBaseItemMemory as C, type ListenerExtensionMemory as L, type OnEventsHandlers as O, type
|
|
379
|
+
export { type AdditionalPositionsExtensionProps as A, type CanvasBaseItemMemory as C, type ListenerExtensionMemory as L, type OnEventsHandlers as O, type TickerArgs as T, type Ticker as a, CanvasBaseItem as b, type TickerInfo as c, type TickersSequence as d, type CanvasGameState as e, type ContainerChild as f, type ListenerExtension as g, type AdditionalPositionsExtension as h, type ContainerMemory as i, type TickerHistory as j, addListenerHandler as k, analizePositionsExtensionProps as l };
|
|
@@ -82,19 +82,6 @@ interface TickerHistory<TArgs extends TickerArgs> {
|
|
|
82
82
|
paused?: boolean;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
type PauseType = {
|
|
86
|
-
/**
|
|
87
|
-
* The type of the value
|
|
88
|
-
*/
|
|
89
|
-
type: "pause";
|
|
90
|
-
/**
|
|
91
|
-
* Duration in seconds
|
|
92
|
-
*/
|
|
93
|
-
duration: number;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
type RepeatType = "repeat";
|
|
97
|
-
|
|
98
85
|
interface TickersStep<TArgs extends TickerArgs> {
|
|
99
86
|
/**
|
|
100
87
|
* Ticker class name
|
|
@@ -124,7 +111,7 @@ interface TickersSequence {
|
|
|
124
111
|
/**
|
|
125
112
|
* The steps of the tickers
|
|
126
113
|
*/
|
|
127
|
-
steps:
|
|
114
|
+
steps: TickersStep<any>[];
|
|
128
115
|
}
|
|
129
116
|
|
|
130
117
|
/**
|
|
@@ -389,4 +376,4 @@ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends Con
|
|
|
389
376
|
elements: CanvasBaseItemMemory[];
|
|
390
377
|
}
|
|
391
378
|
|
|
392
|
-
export { type AdditionalPositionsExtensionProps as A, type CanvasBaseItemMemory as C, type ListenerExtensionMemory as L, type OnEventsHandlers as O, type
|
|
379
|
+
export { type AdditionalPositionsExtensionProps as A, type CanvasBaseItemMemory as C, type ListenerExtensionMemory as L, type OnEventsHandlers as O, type TickerArgs as T, type Ticker as a, CanvasBaseItem as b, type TickerInfo as c, type TickersSequence as d, type CanvasGameState as e, type ContainerChild as f, type ListenerExtension as g, type AdditionalPositionsExtension as h, type ContainerMemory as i, type TickerHistory as j, addListenerHandler as k, analizePositionsExtensionProps as l };
|
package/dist/{HistoryChoiceMenuOption-BMsYentw.d.cts → HistoryChoiceMenuOption-BxMSXnyI.d.cts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as StorageElementType } from './StorageElementType-C7ETezlL.cjs';
|
|
2
|
-
import { D as DialogueInterface } from './HistoryStep-
|
|
2
|
+
import { D as DialogueInterface } from './HistoryStep-WGB6nA4N.cjs';
|
|
3
3
|
|
|
4
4
|
type CloseType = "close";
|
|
5
5
|
|
|
@@ -26,6 +26,15 @@ interface NarrationHistory {
|
|
|
26
26
|
* The input value of the player
|
|
27
27
|
*/
|
|
28
28
|
inputValue?: StorageElementType;
|
|
29
|
+
/**
|
|
30
|
+
* The number of labels that were opened (via {@link NarrationManagerInterface.call} or {@link NarrationManagerInterface.jump}) when this step ran.
|
|
31
|
+
*
|
|
32
|
+
* This is the size of the label call-stack at this step, and can be used to split a page into paragraphs:
|
|
33
|
+
* every time this number increases compared to the previous step, a `call` opened a new paragraph. A `jump`
|
|
34
|
+
* instead starts a whole new page, so it is already reflected by {@link HistoryManagerInterface.currentLabelHistory}
|
|
35
|
+
* starting over.
|
|
36
|
+
*/
|
|
37
|
+
openedLabelsNumber?: number;
|
|
29
38
|
}
|
|
30
39
|
|
|
31
40
|
/**
|
package/dist/{HistoryChoiceMenuOption-DQ-pnuPU.d.ts → HistoryChoiceMenuOption-hSI4SHV-.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as StorageElementType } from './StorageElementType-C7ETezlL.js';
|
|
2
|
-
import { D as DialogueInterface } from './HistoryStep-
|
|
2
|
+
import { D as DialogueInterface } from './HistoryStep-WGB6nA4N.js';
|
|
3
3
|
|
|
4
4
|
type CloseType = "close";
|
|
5
5
|
|
|
@@ -26,6 +26,15 @@ interface NarrationHistory {
|
|
|
26
26
|
* The input value of the player
|
|
27
27
|
*/
|
|
28
28
|
inputValue?: StorageElementType;
|
|
29
|
+
/**
|
|
30
|
+
* The number of labels that were opened (via {@link NarrationManagerInterface.call} or {@link NarrationManagerInterface.jump}) when this step ran.
|
|
31
|
+
*
|
|
32
|
+
* This is the size of the label call-stack at this step, and can be used to split a page into paragraphs:
|
|
33
|
+
* every time this number increases compared to the previous step, a `call` opened a new paragraph. A `jump`
|
|
34
|
+
* instead starts a whole new page, so it is already reflected by {@link HistoryManagerInterface.currentLabelHistory}
|
|
35
|
+
* starting over.
|
|
36
|
+
*/
|
|
37
|
+
openedLabelsNumber?: number;
|
|
29
38
|
}
|
|
30
39
|
|
|
31
40
|
/**
|
|
@@ -91,6 +91,11 @@ interface HistoryStep {
|
|
|
91
91
|
* The input value of the player
|
|
92
92
|
*/
|
|
93
93
|
inputValue?: StorageElementType;
|
|
94
|
+
/**
|
|
95
|
+
* Whether this step requested an input from the player (regardless of whether a
|
|
96
|
+
* default value was provided, unlike {@link inputValue} which is only set when one is).
|
|
97
|
+
*/
|
|
98
|
+
isRequiredInput?: boolean;
|
|
94
99
|
/**
|
|
95
100
|
* The choice made by the player
|
|
96
101
|
*/
|
|
@@ -91,6 +91,11 @@ interface HistoryStep {
|
|
|
91
91
|
* The input value of the player
|
|
92
92
|
*/
|
|
93
93
|
inputValue?: StorageElementType;
|
|
94
|
+
/**
|
|
95
|
+
* Whether this step requested an input from the player (regardless of whether a
|
|
96
|
+
* default value was provided, unlike {@link inputValue} which is only set when one is).
|
|
97
|
+
*/
|
|
98
|
+
isRequiredInput?: boolean;
|
|
94
99
|
/**
|
|
95
100
|
* The choice made by the player
|
|
96
101
|
*/
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { PlayerOptions, Player, ToneAudioNode, ReverbOptions, FeedbackDelayOptions, FreeverbOptions, DelayOptions, PingPongDelayOptions, GateOptions, AutoFilterOptions, BiquadFilterOptions, OnePoleFilterOptions, FeedbackCombFilterOptions, FilterOptions, ChorusOptions, PhaserOptions, TremoloOptions, VibratoOptions, CompressorOptions, MidSideCompressorOptions, MultibandCompressorOptions, LimiterOptions, GreaterThanOptions, GreaterThanZeroOptions, DistortionOptions, BitCrusherOptions, Panner3DOptions, AutoPannerOptions, StereoWidenerOptions } from 'tone';
|
|
2
|
+
|
|
3
|
+
interface MediaInterface extends Pick<Player, "blockTime" | "disposed" | "loaded" | "loop" | "loopEnd" | "loopStart" | "mute" | "now" | "playbackRate" | "reverse" | "restart" | "start" | "stop" | "chain" | "disconnect" | "volume" | "state"> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the sound is currently paused.
|
|
6
|
+
*/
|
|
7
|
+
paused: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use {@link mute} instead.
|
|
10
|
+
*/
|
|
11
|
+
muted: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use {@link playbackRate} instead.
|
|
14
|
+
*/
|
|
15
|
+
speed: number;
|
|
16
|
+
}
|
|
17
|
+
interface MediaMemory extends Partial<Omit<PlayerOptions, "url" | "volume">> {
|
|
18
|
+
/**
|
|
19
|
+
* The volume of this sound in the linear range [0, 1], where 0 is silence
|
|
20
|
+
* and 1 is full volume. Stored and restored in linear form; converted
|
|
21
|
+
* to/from Tone.js decibels internally.
|
|
22
|
+
*/
|
|
23
|
+
volume?: number;
|
|
24
|
+
elapsed: number | undefined;
|
|
25
|
+
paused: boolean;
|
|
26
|
+
delay?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface SoundOptions extends Pick<Partial<PlayerOptions>, "loop" | "autostart" | "fadeIn" | "fadeOut" | "mute" | "loopEnd" | "loopStart" | "reverse" | "playbackRate"> {
|
|
30
|
+
/**
|
|
31
|
+
* The volume of this sound in the linear range [0, 1], where 0 is silence
|
|
32
|
+
* and 1 is full volume. This is converted to decibels internally before
|
|
33
|
+
* being passed to the Tone.js Player.
|
|
34
|
+
*/
|
|
35
|
+
volume?: number;
|
|
36
|
+
/**
|
|
37
|
+
* A collection of audio filters/effects to apply to this sound.
|
|
38
|
+
*
|
|
39
|
+
* Install "tone" for the full list of available filters.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import * as Tone from "tone";
|
|
44
|
+
*
|
|
45
|
+
* const filters = [new Tone.FeedbackDelay("8n", 0.5)];
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
filters?: ToneAudioNode[];
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Use {@link playbackRate} instead.
|
|
51
|
+
*/
|
|
52
|
+
speed?: number;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated Use {@link mute} instead.
|
|
55
|
+
*/
|
|
56
|
+
muted?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface SoundPlayOptions extends SoundOptions {
|
|
59
|
+
/**
|
|
60
|
+
* The delay in seconds before playback starts. If specified, playback is
|
|
61
|
+
* scheduled to begin after the delay has elapsed rather than starting
|
|
62
|
+
* immediately in a paused state.
|
|
63
|
+
*/
|
|
64
|
+
delay?: number;
|
|
65
|
+
/**
|
|
66
|
+
* The offset in seconds from the start of the sound at which to begin playback.
|
|
67
|
+
*/
|
|
68
|
+
elapsed?: number;
|
|
69
|
+
}
|
|
70
|
+
interface SoundPlayOptionsWithChannel extends SoundPlayOptions {
|
|
71
|
+
/**
|
|
72
|
+
* The alias of the audio channel to play the sound on. If the channel does
|
|
73
|
+
* not exist it will be created automatically.
|
|
74
|
+
* Defaults to `SoundManagerInterface.defaultChannelAlias` ("general").
|
|
75
|
+
*/
|
|
76
|
+
channel?: string;
|
|
77
|
+
}
|
|
78
|
+
interface ChannelOptions extends Pick<SoundPlayOptions, "filters" | "muted" | "volume"> {
|
|
79
|
+
/**
|
|
80
|
+
* Whether this channel is a background channel.
|
|
81
|
+
* Background channels are special: media playing on them is not stopped
|
|
82
|
+
* when a scene changes, but continues in the background.
|
|
83
|
+
*/
|
|
84
|
+
background?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* The stereo pan position for this channel in the range [-1, 1].
|
|
87
|
+
* -1 is full left, 0 is centre, 1 is full right.
|
|
88
|
+
* Defaults to 0.
|
|
89
|
+
*/
|
|
90
|
+
pan?: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type SoundFilterMemory = ({
|
|
94
|
+
filterType: "ReverbFilter";
|
|
95
|
+
} & Omit<Partial<ReverbOptions>, "context">) | ({
|
|
96
|
+
filterType: "FeedbackDelayFilter";
|
|
97
|
+
} & Omit<Partial<FeedbackDelayOptions>, "context">) | ({
|
|
98
|
+
filterType: "FreeverbFilter";
|
|
99
|
+
} & Omit<Partial<FreeverbOptions>, "context">) | ({
|
|
100
|
+
filterType: "DelayFilter";
|
|
101
|
+
} & Omit<Partial<DelayOptions>, "context">) | ({
|
|
102
|
+
filterType: "PingPongDelayFilter";
|
|
103
|
+
} & Omit<Partial<PingPongDelayOptions>, "context">) | ({
|
|
104
|
+
filterType: "GateFilter";
|
|
105
|
+
} & Omit<Partial<GateOptions>, "context">) | ({
|
|
106
|
+
filterType: "AutoFilterFilter";
|
|
107
|
+
} & Omit<Partial<AutoFilterOptions>, "context">) | ({
|
|
108
|
+
filterType: "BiquadFilterFilter";
|
|
109
|
+
} & Omit<Partial<BiquadFilterOptions>, "context">) | ({
|
|
110
|
+
filterType: "OnePoleFilterFilter";
|
|
111
|
+
} & Omit<Partial<OnePoleFilterOptions>, "context" | "frequency">) | ({
|
|
112
|
+
filterType: "FeedbackCombFilterFilter";
|
|
113
|
+
} & Omit<Partial<FeedbackCombFilterOptions>, "context">) | ({
|
|
114
|
+
filterType: "CustomFilter";
|
|
115
|
+
} & Omit<Partial<FilterOptions>, "context">) | ({
|
|
116
|
+
filterType: "ChorusFilter";
|
|
117
|
+
} & Omit<Partial<ChorusOptions>, "context">) | ({
|
|
118
|
+
filterType: "PhaserFilter";
|
|
119
|
+
} & Omit<Partial<PhaserOptions>, "context">) | ({
|
|
120
|
+
filterType: "TremoloFilter";
|
|
121
|
+
} & Omit<Partial<TremoloOptions>, "context">) | ({
|
|
122
|
+
filterType: "VibratoFilter";
|
|
123
|
+
} & Omit<Partial<VibratoOptions>, "context">) | ({
|
|
124
|
+
filterType: "CompressorFilter";
|
|
125
|
+
} & Omit<Partial<CompressorOptions>, "context">) | ({
|
|
126
|
+
filterType: "MidSideCompressorFilter";
|
|
127
|
+
} & Omit<Partial<MidSideCompressorOptions>, "context">) | ({
|
|
128
|
+
filterType: "MultibandCompressorFilter";
|
|
129
|
+
} & Omit<Partial<MultibandCompressorOptions>, "context">) | ({
|
|
130
|
+
filterType: "LimiterFilter";
|
|
131
|
+
} & Omit<Partial<LimiterOptions>, "context">) | ({
|
|
132
|
+
filterType: "GreaterThanFilter";
|
|
133
|
+
} & Omit<Partial<GreaterThanOptions>, "context">) | ({
|
|
134
|
+
filterType: "GreaterThanZeroFilter";
|
|
135
|
+
} & Omit<Partial<GreaterThanZeroOptions>, "context">) | ({
|
|
136
|
+
filterType: "DistortionFilter";
|
|
137
|
+
} & Omit<Partial<DistortionOptions>, "context">) | ({
|
|
138
|
+
filterType: "BitCrusherFilter";
|
|
139
|
+
} & Omit<Partial<BitCrusherOptions>, "context">) | ({
|
|
140
|
+
filterType: "Panner3DFilter";
|
|
141
|
+
} & Omit<Partial<Panner3DOptions>, "context">) | ({
|
|
142
|
+
filterType: "AutoPannerFilter";
|
|
143
|
+
} & Omit<Partial<AutoPannerOptions>, "context">) | ({
|
|
144
|
+
filterType: "StereoWidenerFilter";
|
|
145
|
+
} & Omit<Partial<StereoWidenerOptions>, "context">);
|
|
146
|
+
|
|
147
|
+
interface ExportedSound {
|
|
148
|
+
options: SoundOptions;
|
|
149
|
+
filters?: SoundFilterMemory[];
|
|
150
|
+
}
|
|
151
|
+
interface SoundPlay {
|
|
152
|
+
stepIndex: number;
|
|
153
|
+
paused: boolean;
|
|
154
|
+
options?: SoundPlayOptions | string;
|
|
155
|
+
}
|
|
156
|
+
interface ExportedSoundPlay extends SoundPlay {
|
|
157
|
+
sound: ExportedSound;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Interface exported sounds
|
|
161
|
+
*/
|
|
162
|
+
interface SoundGameState {
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated
|
|
165
|
+
*/
|
|
166
|
+
soundsPlaying?: {
|
|
167
|
+
[key: string]: ExportedSoundPlay;
|
|
168
|
+
};
|
|
169
|
+
mediaInstances: {
|
|
170
|
+
[key: string]: {
|
|
171
|
+
channelAlias: string;
|
|
172
|
+
soundAlias: string;
|
|
173
|
+
stepCounter: number;
|
|
174
|
+
options: MediaMemory & {
|
|
175
|
+
filters?: SoundFilterMemory[];
|
|
176
|
+
delay?: number;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* @deprecated Use options.paused instead.
|
|
180
|
+
*/
|
|
181
|
+
paused?: boolean;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type { ChannelOptions as C, ExportedSound as E, MediaInterface as M, SoundGameState as S, SoundPlayOptions as a, SoundPlayOptionsWithChannel as b, MediaMemory as c, ExportedSoundPlay as d, SoundOptions as e, SoundPlay as f };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { PlayerOptions, Player, ToneAudioNode, ReverbOptions, FeedbackDelayOptions, FreeverbOptions, DelayOptions, PingPongDelayOptions, GateOptions, AutoFilterOptions, BiquadFilterOptions, OnePoleFilterOptions, FeedbackCombFilterOptions, FilterOptions, ChorusOptions, PhaserOptions, TremoloOptions, VibratoOptions, CompressorOptions, MidSideCompressorOptions, MultibandCompressorOptions, LimiterOptions, GreaterThanOptions, GreaterThanZeroOptions, DistortionOptions, BitCrusherOptions, Panner3DOptions, AutoPannerOptions, StereoWidenerOptions } from 'tone';
|
|
2
|
+
|
|
3
|
+
interface MediaInterface extends Pick<Player, "blockTime" | "disposed" | "loaded" | "loop" | "loopEnd" | "loopStart" | "mute" | "now" | "playbackRate" | "reverse" | "restart" | "start" | "stop" | "chain" | "disconnect" | "volume" | "state"> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the sound is currently paused.
|
|
6
|
+
*/
|
|
7
|
+
paused: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use {@link mute} instead.
|
|
10
|
+
*/
|
|
11
|
+
muted: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use {@link playbackRate} instead.
|
|
14
|
+
*/
|
|
15
|
+
speed: number;
|
|
16
|
+
}
|
|
17
|
+
interface MediaMemory extends Partial<Omit<PlayerOptions, "url" | "volume">> {
|
|
18
|
+
/**
|
|
19
|
+
* The volume of this sound in the linear range [0, 1], where 0 is silence
|
|
20
|
+
* and 1 is full volume. Stored and restored in linear form; converted
|
|
21
|
+
* to/from Tone.js decibels internally.
|
|
22
|
+
*/
|
|
23
|
+
volume?: number;
|
|
24
|
+
elapsed: number | undefined;
|
|
25
|
+
paused: boolean;
|
|
26
|
+
delay?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface SoundOptions extends Pick<Partial<PlayerOptions>, "loop" | "autostart" | "fadeIn" | "fadeOut" | "mute" | "loopEnd" | "loopStart" | "reverse" | "playbackRate"> {
|
|
30
|
+
/**
|
|
31
|
+
* The volume of this sound in the linear range [0, 1], where 0 is silence
|
|
32
|
+
* and 1 is full volume. This is converted to decibels internally before
|
|
33
|
+
* being passed to the Tone.js Player.
|
|
34
|
+
*/
|
|
35
|
+
volume?: number;
|
|
36
|
+
/**
|
|
37
|
+
* A collection of audio filters/effects to apply to this sound.
|
|
38
|
+
*
|
|
39
|
+
* Install "tone" for the full list of available filters.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import * as Tone from "tone";
|
|
44
|
+
*
|
|
45
|
+
* const filters = [new Tone.FeedbackDelay("8n", 0.5)];
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
filters?: ToneAudioNode[];
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Use {@link playbackRate} instead.
|
|
51
|
+
*/
|
|
52
|
+
speed?: number;
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated Use {@link mute} instead.
|
|
55
|
+
*/
|
|
56
|
+
muted?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface SoundPlayOptions extends SoundOptions {
|
|
59
|
+
/**
|
|
60
|
+
* The delay in seconds before playback starts. If specified, playback is
|
|
61
|
+
* scheduled to begin after the delay has elapsed rather than starting
|
|
62
|
+
* immediately in a paused state.
|
|
63
|
+
*/
|
|
64
|
+
delay?: number;
|
|
65
|
+
/**
|
|
66
|
+
* The offset in seconds from the start of the sound at which to begin playback.
|
|
67
|
+
*/
|
|
68
|
+
elapsed?: number;
|
|
69
|
+
}
|
|
70
|
+
interface SoundPlayOptionsWithChannel extends SoundPlayOptions {
|
|
71
|
+
/**
|
|
72
|
+
* The alias of the audio channel to play the sound on. If the channel does
|
|
73
|
+
* not exist it will be created automatically.
|
|
74
|
+
* Defaults to `SoundManagerInterface.defaultChannelAlias` ("general").
|
|
75
|
+
*/
|
|
76
|
+
channel?: string;
|
|
77
|
+
}
|
|
78
|
+
interface ChannelOptions extends Pick<SoundPlayOptions, "filters" | "muted" | "volume"> {
|
|
79
|
+
/**
|
|
80
|
+
* Whether this channel is a background channel.
|
|
81
|
+
* Background channels are special: media playing on them is not stopped
|
|
82
|
+
* when a scene changes, but continues in the background.
|
|
83
|
+
*/
|
|
84
|
+
background?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* The stereo pan position for this channel in the range [-1, 1].
|
|
87
|
+
* -1 is full left, 0 is centre, 1 is full right.
|
|
88
|
+
* Defaults to 0.
|
|
89
|
+
*/
|
|
90
|
+
pan?: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type SoundFilterMemory = ({
|
|
94
|
+
filterType: "ReverbFilter";
|
|
95
|
+
} & Omit<Partial<ReverbOptions>, "context">) | ({
|
|
96
|
+
filterType: "FeedbackDelayFilter";
|
|
97
|
+
} & Omit<Partial<FeedbackDelayOptions>, "context">) | ({
|
|
98
|
+
filterType: "FreeverbFilter";
|
|
99
|
+
} & Omit<Partial<FreeverbOptions>, "context">) | ({
|
|
100
|
+
filterType: "DelayFilter";
|
|
101
|
+
} & Omit<Partial<DelayOptions>, "context">) | ({
|
|
102
|
+
filterType: "PingPongDelayFilter";
|
|
103
|
+
} & Omit<Partial<PingPongDelayOptions>, "context">) | ({
|
|
104
|
+
filterType: "GateFilter";
|
|
105
|
+
} & Omit<Partial<GateOptions>, "context">) | ({
|
|
106
|
+
filterType: "AutoFilterFilter";
|
|
107
|
+
} & Omit<Partial<AutoFilterOptions>, "context">) | ({
|
|
108
|
+
filterType: "BiquadFilterFilter";
|
|
109
|
+
} & Omit<Partial<BiquadFilterOptions>, "context">) | ({
|
|
110
|
+
filterType: "OnePoleFilterFilter";
|
|
111
|
+
} & Omit<Partial<OnePoleFilterOptions>, "context" | "frequency">) | ({
|
|
112
|
+
filterType: "FeedbackCombFilterFilter";
|
|
113
|
+
} & Omit<Partial<FeedbackCombFilterOptions>, "context">) | ({
|
|
114
|
+
filterType: "CustomFilter";
|
|
115
|
+
} & Omit<Partial<FilterOptions>, "context">) | ({
|
|
116
|
+
filterType: "ChorusFilter";
|
|
117
|
+
} & Omit<Partial<ChorusOptions>, "context">) | ({
|
|
118
|
+
filterType: "PhaserFilter";
|
|
119
|
+
} & Omit<Partial<PhaserOptions>, "context">) | ({
|
|
120
|
+
filterType: "TremoloFilter";
|
|
121
|
+
} & Omit<Partial<TremoloOptions>, "context">) | ({
|
|
122
|
+
filterType: "VibratoFilter";
|
|
123
|
+
} & Omit<Partial<VibratoOptions>, "context">) | ({
|
|
124
|
+
filterType: "CompressorFilter";
|
|
125
|
+
} & Omit<Partial<CompressorOptions>, "context">) | ({
|
|
126
|
+
filterType: "MidSideCompressorFilter";
|
|
127
|
+
} & Omit<Partial<MidSideCompressorOptions>, "context">) | ({
|
|
128
|
+
filterType: "MultibandCompressorFilter";
|
|
129
|
+
} & Omit<Partial<MultibandCompressorOptions>, "context">) | ({
|
|
130
|
+
filterType: "LimiterFilter";
|
|
131
|
+
} & Omit<Partial<LimiterOptions>, "context">) | ({
|
|
132
|
+
filterType: "GreaterThanFilter";
|
|
133
|
+
} & Omit<Partial<GreaterThanOptions>, "context">) | ({
|
|
134
|
+
filterType: "GreaterThanZeroFilter";
|
|
135
|
+
} & Omit<Partial<GreaterThanZeroOptions>, "context">) | ({
|
|
136
|
+
filterType: "DistortionFilter";
|
|
137
|
+
} & Omit<Partial<DistortionOptions>, "context">) | ({
|
|
138
|
+
filterType: "BitCrusherFilter";
|
|
139
|
+
} & Omit<Partial<BitCrusherOptions>, "context">) | ({
|
|
140
|
+
filterType: "Panner3DFilter";
|
|
141
|
+
} & Omit<Partial<Panner3DOptions>, "context">) | ({
|
|
142
|
+
filterType: "AutoPannerFilter";
|
|
143
|
+
} & Omit<Partial<AutoPannerOptions>, "context">) | ({
|
|
144
|
+
filterType: "StereoWidenerFilter";
|
|
145
|
+
} & Omit<Partial<StereoWidenerOptions>, "context">);
|
|
146
|
+
|
|
147
|
+
interface ExportedSound {
|
|
148
|
+
options: SoundOptions;
|
|
149
|
+
filters?: SoundFilterMemory[];
|
|
150
|
+
}
|
|
151
|
+
interface SoundPlay {
|
|
152
|
+
stepIndex: number;
|
|
153
|
+
paused: boolean;
|
|
154
|
+
options?: SoundPlayOptions | string;
|
|
155
|
+
}
|
|
156
|
+
interface ExportedSoundPlay extends SoundPlay {
|
|
157
|
+
sound: ExportedSound;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Interface exported sounds
|
|
161
|
+
*/
|
|
162
|
+
interface SoundGameState {
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated
|
|
165
|
+
*/
|
|
166
|
+
soundsPlaying?: {
|
|
167
|
+
[key: string]: ExportedSoundPlay;
|
|
168
|
+
};
|
|
169
|
+
mediaInstances: {
|
|
170
|
+
[key: string]: {
|
|
171
|
+
channelAlias: string;
|
|
172
|
+
soundAlias: string;
|
|
173
|
+
stepCounter: number;
|
|
174
|
+
options: MediaMemory & {
|
|
175
|
+
filters?: SoundFilterMemory[];
|
|
176
|
+
delay?: number;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* @deprecated Use options.paused instead.
|
|
180
|
+
*/
|
|
181
|
+
paused?: boolean;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type { ChannelOptions as C, ExportedSound as E, MediaInterface as M, SoundGameState as S, SoundPlayOptions as a, SoundPlayOptionsWithChannel as b, MediaMemory as c, ExportedSoundPlay as d, SoundOptions as e, SoundPlay as f };
|
|
@@ -7,7 +7,7 @@ interface StorageGameStateItem<T = StorageElementType> {
|
|
|
7
7
|
/**
|
|
8
8
|
* Interface exported storage data
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
interface StorageGameState {
|
|
11
11
|
/**
|
|
12
12
|
* @deprecated
|
|
13
13
|
*/
|
|
@@ -22,6 +22,6 @@ type StorageGameState = {
|
|
|
22
22
|
*/
|
|
23
23
|
flags?: string[];
|
|
24
24
|
main: StorageGameStateItem[];
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
|
|
27
27
|
export type { StorageGameState as S };
|
|
@@ -7,7 +7,7 @@ interface StorageGameStateItem<T = StorageElementType> {
|
|
|
7
7
|
/**
|
|
8
8
|
* Interface exported storage data
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
interface StorageGameState {
|
|
11
11
|
/**
|
|
12
12
|
* @deprecated
|
|
13
13
|
*/
|
|
@@ -22,6 +22,6 @@ type StorageGameState = {
|
|
|
22
22
|
*/
|
|
23
23
|
flags?: string[];
|
|
24
24
|
main: StorageGameStateItem[];
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
|
|
27
27
|
export type { StorageGameState as S };
|