@drincs/pixi-vn 1.5.13 → 1.5.18
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 +8 -3
- package/dist/canvas.cjs +3 -2
- package/dist/canvas.d.cts +46 -105
- package/dist/canvas.d.ts +46 -105
- package/dist/canvas.mjs +3 -2
- package/dist/characters.cjs +2 -1
- package/dist/characters.mjs +2 -1
- package/dist/chunk-46QBDRUK.mjs +2 -0
- package/dist/chunk-52EK6LYW.mjs +2 -0
- package/dist/chunk-INJYRMJ3.mjs +2 -0
- package/dist/{chunk-TTRUPDAB.mjs → chunk-JJFD2BVW.mjs} +2 -1
- package/dist/chunk-JJFD2BVW.mjs.map +1 -0
- package/dist/chunk-OXRIVLY2.mjs +2 -0
- package/dist/chunk-SOFV7YZ5.mjs +2 -0
- package/dist/chunk-XZMYXKAY.mjs +2 -0
- package/dist/core.cjs +1 -0
- package/dist/core.d.cts +399 -0
- package/dist/core.d.ts +399 -0
- package/dist/core.mjs +1 -0
- package/dist/history.cjs +2 -1
- package/dist/history.d.cts +1 -1
- package/dist/history.d.ts +1 -1
- package/dist/history.mjs +2 -1
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +9 -10
- package/dist/index.d.ts +9 -10
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -0
- package/dist/motion.cjs +2 -0
- package/dist/motion.cjs.map +1 -0
- package/dist/motion.d.cts +96 -0
- package/dist/motion.d.ts +96 -0
- package/dist/motion.mjs +2 -0
- package/dist/motion.mjs.map +1 -0
- package/dist/narration.cjs +3 -2
- package/dist/narration.mjs +3 -2
- package/dist/pixi/browser.js +170 -167
- package/dist/sound.cjs +2 -1
- package/dist/sound.mjs +2 -1
- package/dist/storage.cjs +2 -1
- package/dist/storage.mjs +2 -1
- package/dist/vite-listener.cjs +2 -1
- package/dist/vite-listener.cjs.map +1 -0
- package/dist/vite-listener.mjs +2 -1
- package/dist/vite-listener.mjs.map +1 -0
- package/dist/vite.cjs +2 -1
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.mjs +2 -1
- package/dist/vite.mjs.map +1 -0
- package/package.json +27 -10
- package/dist/chunk-6GO4XVS7.mjs +0 -1
- package/dist/chunk-6IVCTY6P.mjs +0 -1
- package/dist/chunk-GNJIUFU2.mjs +0 -1
- package/dist/chunk-HVEJJGVC.mjs +0 -1
- package/dist/chunk-XDBHD3IV.mjs +0 -1
- package/dist/chunk-XSN6P5JL.mjs +0 -0
- package/dist/unifier.cjs +0 -1
- package/dist/unifier.mjs +0 -1
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { StepLabelProps, StepLabelResult, GameStepState, HistoryInfo, CharacterInterface } from '@drincs/pixi-vn';
|
|
2
|
+
import { Container, UPDATE_PRIORITY } from 'pixi.js';
|
|
3
|
+
|
|
4
|
+
type ErrorCodeType = "obsolete_save" | "unknown_element" | "unregistered_element" | "not_json_serializable" | "not_implemented" | "invalid_usage" | "unhandled_error";
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
const __VITE__: boolean | undefined;
|
|
8
|
+
const __ROLLUP_PLUGIN__: boolean | undefined;
|
|
9
|
+
const __webpack_require__: unknown;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This class is used to create a canvas element to add into a Pixi Application.
|
|
14
|
+
* You can use {@link canvas.add()} to add this element into the application.
|
|
15
|
+
* This class should be implemented and the memory method should be overridden.
|
|
16
|
+
* You must use the {@link canvasComponentDecorator} to register the canvas in the game.
|
|
17
|
+
* In Ren'Py is a displayable.
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const CANVAS_EXAMPLE_ID = "CanvasExample";
|
|
21
|
+
*
|
|
22
|
+
* \@canvasComponentDecorator({
|
|
23
|
+
* name: CANVAS_EXAMPLE_ID,
|
|
24
|
+
* })
|
|
25
|
+
* export class CanvasExample extends Container implements CanvasBaseItem<Memory> {
|
|
26
|
+
* get memory(): Memory {
|
|
27
|
+
* return {
|
|
28
|
+
* pixivnId: CANVAS_EXAMPLE_ID,
|
|
29
|
+
* // ... other properties
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* async setMemory(value: Memory) {
|
|
33
|
+
* // ... set other properties
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare class CanvasBaseItem<T2 extends CanvasBaseItemMemory> {
|
|
39
|
+
constructor(..._options: any);
|
|
40
|
+
/**
|
|
41
|
+
* This method return the memory of the canvas element.
|
|
42
|
+
*/
|
|
43
|
+
get memory(): T2;
|
|
44
|
+
/**
|
|
45
|
+
* This method set the memory of the canvas element.
|
|
46
|
+
*/
|
|
47
|
+
setMemory(_value: T2): Promise<void> | void;
|
|
48
|
+
/**
|
|
49
|
+
* Get the id of the canvas element. This variable is used in the system to get the canvas element by id
|
|
50
|
+
*/
|
|
51
|
+
pixivnId: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Interface for the canvas base memory
|
|
56
|
+
*/
|
|
57
|
+
interface CanvasBaseItemMemory {
|
|
58
|
+
pixivnId: string;
|
|
59
|
+
zIndex?: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface CanvasBaseInterface<T2 extends CanvasBaseItemMemory> extends CanvasBaseItem<T2>, Container {
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Result of a {@link StepLabelType} execution.
|
|
67
|
+
*
|
|
68
|
+
* - `StepLabelResult`: a structured result consumed by the narration engine.
|
|
69
|
+
* - `void`: the step completed without returning an explicit result.
|
|
70
|
+
* - `string`: a simple token or message interpreted by higher-level logic.
|
|
71
|
+
*
|
|
72
|
+
* Prefer returning a well-typed {@link StepLabelResult} for anything that
|
|
73
|
+
* needs to be consumed programmatically. Use plain strings only where a
|
|
74
|
+
* lightweight, convention-based signal is sufficient and clearly documented
|
|
75
|
+
* by the surrounding game logic.
|
|
76
|
+
*/
|
|
77
|
+
type StepLabelResultType = StepLabelResult | void | string;
|
|
78
|
+
type StepLabelPropsType<T extends {} = {}> = StepLabelProps & T;
|
|
79
|
+
/**
|
|
80
|
+
* StepLabel is a function that will be executed as the game continues.
|
|
81
|
+
*/
|
|
82
|
+
type StepLabelType<T extends {} = {}> = (props: StepLabelPropsType<T>, info: {
|
|
83
|
+
/**
|
|
84
|
+
* The id of the label.
|
|
85
|
+
*/
|
|
86
|
+
labelId: string;
|
|
87
|
+
}) => StepLabelResultType | Promise<StepLabelResultType>;
|
|
88
|
+
|
|
89
|
+
type StorageElementPrimaryType = string | number | boolean | undefined | null | StorageElementPrimaryType[];
|
|
90
|
+
type StorageElementInternalType = StorageElementPrimaryType | Record<string | number | symbol, StorageElementPrimaryType> | StorageElementInternalType[];
|
|
91
|
+
/**
|
|
92
|
+
* StorageElementType are all the types that can be stored in the storage
|
|
93
|
+
*/
|
|
94
|
+
type StorageElementType = StorageElementInternalType | Record<string | number | symbol, StorageElementInternalType> | {
|
|
95
|
+
[key: string | number | symbol]: StorageElementType;
|
|
96
|
+
} | StorageObjectType[] | (StorageElementPrimaryType | StorageElementInternalType | StorageElementType)[];
|
|
97
|
+
/**
|
|
98
|
+
* StorageObjectType are all the types that can be stored in the storage
|
|
99
|
+
*/
|
|
100
|
+
type StorageObjectType = Record<string | number | symbol, StorageElementType>;
|
|
101
|
+
|
|
102
|
+
declare class GameUnifier {
|
|
103
|
+
static init(options: {
|
|
104
|
+
/**
|
|
105
|
+
* The navigate function.
|
|
106
|
+
* @param path The path to navigate to.
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
navigate?: (path: string) => void | Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* This function returns the current step counter. This counter corresponds to the total number of steps that have been executed so far.
|
|
112
|
+
*
|
|
113
|
+
* If your game engine does not have a history of steps, you can return 0.
|
|
114
|
+
*/
|
|
115
|
+
getStepCounter: () => number;
|
|
116
|
+
/**
|
|
117
|
+
* This function sets the current step counter.
|
|
118
|
+
*
|
|
119
|
+
* If your game engine does not have a history of steps, you can not set the step counter.
|
|
120
|
+
*/
|
|
121
|
+
setStepCounter: (value: number) => void;
|
|
122
|
+
/**
|
|
123
|
+
* This function returns the current state of the game step.
|
|
124
|
+
*
|
|
125
|
+
* If your game engine does not have a history of steps, you can return an empty object.
|
|
126
|
+
*/
|
|
127
|
+
getCurrentGameStepState: () => GameStepState;
|
|
128
|
+
/**
|
|
129
|
+
* This function restores the game step state.
|
|
130
|
+
*
|
|
131
|
+
* If your game engine does not have a history of steps, you can return a resolved promise.
|
|
132
|
+
*
|
|
133
|
+
* @param state The state to restore.
|
|
134
|
+
* @param navigate The function to navigate to the restored path.
|
|
135
|
+
*/
|
|
136
|
+
restoreGameStepState: (state: GameStepState, navigate: (path: string) => void | Promise<void>) => Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* This function returns the number of opened labels.
|
|
139
|
+
*
|
|
140
|
+
* If your game engine does not have a narration system, you can return 0.
|
|
141
|
+
*/
|
|
142
|
+
getOpenedLabels: () => number;
|
|
143
|
+
/**
|
|
144
|
+
* This function is called after the narration.continue() method is executed.
|
|
145
|
+
* It can be used to force the completion of the ticker in the game engine.
|
|
146
|
+
*/
|
|
147
|
+
onPreContinue?: () => Promise<void> | void;
|
|
148
|
+
/**
|
|
149
|
+
* This function is called to process the pending navigation requests (continue/back).
|
|
150
|
+
*/
|
|
151
|
+
processNavigationRequests: (navigationRequestsCount: number, props: StepLabelPropsType<any>) => {
|
|
152
|
+
newValue: number;
|
|
153
|
+
result: Promise<StepLabelResultType>;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* This function returns the value of a variable.
|
|
157
|
+
* @param key The key of the variable.
|
|
158
|
+
* @returns The value of the variable.
|
|
159
|
+
*/
|
|
160
|
+
getVariable: <T extends StorageElementType>(key: string) => T | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* This function sets the value of a variable.
|
|
163
|
+
* @param key The key of the variable.
|
|
164
|
+
* @param value The value of the variable.
|
|
165
|
+
*/
|
|
166
|
+
setVariable: (key: string, value: StorageElementType) => void;
|
|
167
|
+
/**
|
|
168
|
+
* This function removes a variable.
|
|
169
|
+
* @param key The key of the variable.
|
|
170
|
+
*/
|
|
171
|
+
removeVariable: (key: string) => void;
|
|
172
|
+
/**
|
|
173
|
+
* This function returns the value of a flag.
|
|
174
|
+
* @param name The name of the flag.
|
|
175
|
+
*/
|
|
176
|
+
getFlag: (name: string) => boolean;
|
|
177
|
+
/**
|
|
178
|
+
* This function sets the value of a flag.
|
|
179
|
+
* @param name The name of the flag.
|
|
180
|
+
* @param value The value of the flag.
|
|
181
|
+
*/
|
|
182
|
+
setFlag: (name: string, value: boolean) => void;
|
|
183
|
+
/**
|
|
184
|
+
* This function is called after the narration.continue() method is executed.
|
|
185
|
+
*
|
|
186
|
+
* It can be used to clear old temporary variables.
|
|
187
|
+
*
|
|
188
|
+
* @param openedLabelsNumber The number of opened labels.
|
|
189
|
+
*/
|
|
190
|
+
onLabelClosing?: (openedLabelsNumber: number) => void;
|
|
191
|
+
/**
|
|
192
|
+
* Add a history step to the history.
|
|
193
|
+
*
|
|
194
|
+
* If your game engine does not have a history of steps, you can return a resolved promise.
|
|
195
|
+
*
|
|
196
|
+
* @param historyInfo The history information.
|
|
197
|
+
* @param opstions Options to add the step.
|
|
198
|
+
*/
|
|
199
|
+
addHistoryItem(historyInfo?: HistoryInfo, opstions?: {
|
|
200
|
+
/**
|
|
201
|
+
* If true, the step will not be added to the history if the current step is the same as the last step.
|
|
202
|
+
*/
|
|
203
|
+
ignoreSameStep?: boolean;
|
|
204
|
+
}): void;
|
|
205
|
+
/**
|
|
206
|
+
* This function returns the character by its id.
|
|
207
|
+
* @param id The id of the character.
|
|
208
|
+
* @returns The character or undefined if it does not exist.
|
|
209
|
+
*/
|
|
210
|
+
getCharacter: (id: string) => CharacterInterface | undefined;
|
|
211
|
+
/**
|
|
212
|
+
* This function is called to animate a component.
|
|
213
|
+
* @param components - The PixiJS component(s) to animate.
|
|
214
|
+
* @param keyframes - The keyframes to animate the component(s) with.
|
|
215
|
+
* @param options - Additional options for the animation, including duration, easing, and ticker.
|
|
216
|
+
* @param priority - The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
217
|
+
* @returns The id of tickers.
|
|
218
|
+
* @template T - The type of Pixi’VN component(s) being animated.
|
|
219
|
+
*/
|
|
220
|
+
animate: <T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: any, options?: any, priority?: UPDATE_PRIORITY) => string | undefined;
|
|
221
|
+
}): void;
|
|
222
|
+
private static _navigate;
|
|
223
|
+
/**
|
|
224
|
+
* The navigate function.
|
|
225
|
+
* @param path The path to navigate to.
|
|
226
|
+
* @returns
|
|
227
|
+
*/
|
|
228
|
+
static get navigate(): (path: string) => void | Promise<void>;
|
|
229
|
+
static set navigate(value: (path: string) => void | Promise<void>);
|
|
230
|
+
private static _getStepCounter;
|
|
231
|
+
private static _setStepCounter;
|
|
232
|
+
/**
|
|
233
|
+
* Returns the current step counter. This counter corresponds to the total number of steps that have been executed so far.
|
|
234
|
+
*/
|
|
235
|
+
static get stepCounter(): number;
|
|
236
|
+
/**
|
|
237
|
+
* Returns the current state of the game step.
|
|
238
|
+
*/
|
|
239
|
+
static set stepCounter(value: number);
|
|
240
|
+
private static _getCurrentGameStepState;
|
|
241
|
+
/**
|
|
242
|
+
* Returns the current state of the game step.
|
|
243
|
+
*/
|
|
244
|
+
static get currentGameStepState(): GameStepState;
|
|
245
|
+
private static _restoreGameStepState;
|
|
246
|
+
/**
|
|
247
|
+
* Restores the game step state.
|
|
248
|
+
* @param state The state to restore.
|
|
249
|
+
* @param navigate The function to navigate to the restored path.
|
|
250
|
+
*/
|
|
251
|
+
static get restoreGameStepState(): (state: GameStepState, navigate: (path: string) => void | Promise<void>) => Promise<void>;
|
|
252
|
+
private static _getOpenedLabels;
|
|
253
|
+
/**
|
|
254
|
+
* Returns the number of opened labels.
|
|
255
|
+
*/
|
|
256
|
+
static get openedLabels(): number;
|
|
257
|
+
private static _onPreContinueHandlers;
|
|
258
|
+
/**
|
|
259
|
+
* Register a handler to run immediately before a narration "continue" operation.
|
|
260
|
+
* Handlers are executed in registration order and may be async. Use
|
|
261
|
+
* `{@link addOnPreContinue}` / `{@link removeOnPreContinue}` to manage them programmatically.
|
|
262
|
+
*/
|
|
263
|
+
static addOnPreContinue(handler: () => Promise<void> | void): void;
|
|
264
|
+
static removeOnPreContinue(handler: () => Promise<void> | void): void;
|
|
265
|
+
static clearOnPreContinueHandlers(): void;
|
|
266
|
+
static runOnPreContinue(): Promise<void>;
|
|
267
|
+
static get onPreContinue(): typeof GameUnifier.runOnPreContinue;
|
|
268
|
+
/**
|
|
269
|
+
* Number of pending navigation requests (continue/back).
|
|
270
|
+
* Positive values indicate pending continue requests,
|
|
271
|
+
* negative values indicate pending back requests.
|
|
272
|
+
*/
|
|
273
|
+
private static navigationRequestsCount;
|
|
274
|
+
/**
|
|
275
|
+
* Promise-based lock to ensure only one processNavigationRequests executes at a time.
|
|
276
|
+
* This prevents race conditions in the read-modify-write operation.
|
|
277
|
+
*/
|
|
278
|
+
private static processNavigationLock;
|
|
279
|
+
/**
|
|
280
|
+
* This function is called to get the number of pending continue requests.
|
|
281
|
+
* Returns a positive count of pending continue requests when navigationRequestsCount is positive.
|
|
282
|
+
* If it is > 0, after the stepsRunning is 0, the next step will be executed.
|
|
283
|
+
*/
|
|
284
|
+
static get continueRequestsCount(): number;
|
|
285
|
+
/**
|
|
286
|
+
* This function is called to increase the number of pending continue requests.
|
|
287
|
+
* Note: While the increment operation itself is atomic, the overall navigation
|
|
288
|
+
* processing uses a lock in processNavigationRequests to ensure atomicity of
|
|
289
|
+
* read-modify-write operations across async boundaries.
|
|
290
|
+
* @param amount The number of steps to increase. Default is 1.
|
|
291
|
+
*/
|
|
292
|
+
static increaseContinueRequest(amount?: number): void;
|
|
293
|
+
/**
|
|
294
|
+
* This function is called to get the number of pending back requests.
|
|
295
|
+
* Returns the negation of navigationRequestsCount:
|
|
296
|
+
* - Positive value (absolute value of navigationRequestsCount) when navigationRequestsCount is negative (back requests pending)
|
|
297
|
+
* - Negative value when navigationRequestsCount is positive (continue requests pending)
|
|
298
|
+
* - Zero when navigationRequestsCount is zero (no requests pending)
|
|
299
|
+
* If it is > 0, after the stepsRunning is 0, the previous step will be executed.
|
|
300
|
+
*/
|
|
301
|
+
static get backRequestsCount(): number;
|
|
302
|
+
/**
|
|
303
|
+
* This function is called to increase the number of pending back requests.
|
|
304
|
+
* Note: While the decrement operation itself is atomic, the overall navigation
|
|
305
|
+
* processing uses a lock in processNavigationRequests to ensure atomicity of
|
|
306
|
+
* read-modify-write operations across async boundaries.
|
|
307
|
+
* @param amount The number of steps to increase. Default is 1.
|
|
308
|
+
*/
|
|
309
|
+
static increaseBackRequest(amount?: number): void;
|
|
310
|
+
private static _processNavigationRequests;
|
|
311
|
+
/**
|
|
312
|
+
* This function processes the pending navigation requests (continue/back).
|
|
313
|
+
*/
|
|
314
|
+
static processNavigationRequests(props: StepLabelPropsType<any>): Promise<StepLabelResultType>;
|
|
315
|
+
private static _getVariable;
|
|
316
|
+
/**
|
|
317
|
+
* This function returns the value of a variable.
|
|
318
|
+
* @param key The key of the variable.
|
|
319
|
+
* @returns The value of the variable.
|
|
320
|
+
*/
|
|
321
|
+
static get getVariable(): <T extends StorageElementType>(key: string) => T | undefined;
|
|
322
|
+
private static _setVariable;
|
|
323
|
+
/**
|
|
324
|
+
* This function sets the value of a variable.
|
|
325
|
+
* @param key The key of the variable.
|
|
326
|
+
* @param value The value of the variable.
|
|
327
|
+
*/
|
|
328
|
+
static get setVariable(): (key: string, value: StorageElementType) => void;
|
|
329
|
+
private static _removeVariable;
|
|
330
|
+
/**
|
|
331
|
+
* This function removes a variable.
|
|
332
|
+
* @param key The key of the variable.
|
|
333
|
+
*/
|
|
334
|
+
static get removeVariable(): (key: string) => void;
|
|
335
|
+
private static _getFlag;
|
|
336
|
+
/**
|
|
337
|
+
* This function returns the value of a flag.
|
|
338
|
+
* @param name The name of the flag.
|
|
339
|
+
*/
|
|
340
|
+
static get getFlag(): (name: string) => boolean;
|
|
341
|
+
private static _setFlag;
|
|
342
|
+
/**
|
|
343
|
+
* This function sets the value of a flag.
|
|
344
|
+
* @param name The name of the flag.
|
|
345
|
+
* @param value The value of the flag.
|
|
346
|
+
*/
|
|
347
|
+
static get setFlag(): (name: string, value: boolean) => void;
|
|
348
|
+
private static _onLabelClosing;
|
|
349
|
+
/**
|
|
350
|
+
* This function is called after the narration.continue() method is executed
|
|
351
|
+
* It can be used to clear old temporary variables.
|
|
352
|
+
* @param openedLabelsNumber The number of opened labels.
|
|
353
|
+
*/
|
|
354
|
+
static get onLabelClosing(): (openedLabelsNumber: number) => void;
|
|
355
|
+
private static _addHistoryItem;
|
|
356
|
+
/**
|
|
357
|
+
* Add a history step to the history.
|
|
358
|
+
* @param historyInfo The history information.
|
|
359
|
+
* @param opstions Options to add the step.
|
|
360
|
+
*/
|
|
361
|
+
static get addHistoryItem(): (historyInfo?: HistoryInfo, opstions?: {
|
|
362
|
+
/**
|
|
363
|
+
* If true, the step will not be added to the history if the current step is the same as the last step.
|
|
364
|
+
*/
|
|
365
|
+
ignoreSameStep?: boolean;
|
|
366
|
+
}) => void;
|
|
367
|
+
/**
|
|
368
|
+
* Count of currently executing steps.
|
|
369
|
+
* If a step triggers a narration.continue(), this number is greater than 1.
|
|
370
|
+
*/
|
|
371
|
+
static runningStepsCount: number;
|
|
372
|
+
private static _getCharacter;
|
|
373
|
+
/**
|
|
374
|
+
* This function returns the character by its id.
|
|
375
|
+
* @param id The id of the character.
|
|
376
|
+
* @returns The character or undefined if it does not exist.
|
|
377
|
+
*/
|
|
378
|
+
static get getCharacter(): (id: string) => CharacterInterface | undefined;
|
|
379
|
+
static onEnd?: StepLabelType;
|
|
380
|
+
static onError?: (type: "step", error: any, props: StepLabelPropsType) => void | Promise<void>;
|
|
381
|
+
private static _animate;
|
|
382
|
+
/**
|
|
383
|
+
* This function is called to animate a component.
|
|
384
|
+
* @param components - The PixiJS component(s) to animate.
|
|
385
|
+
* @param keyframes - The keyframes to animate the component(s) with.
|
|
386
|
+
* @param options - Additional options for the animation, including duration, easing, and ticker.
|
|
387
|
+
* @param priority - The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
388
|
+
* @returns The id of tickers.
|
|
389
|
+
* @template T - The type of Pixi’VN component(s) being animated.
|
|
390
|
+
*/
|
|
391
|
+
static get animate(): <T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: any, options?: any, priority?: UPDATE_PRIORITY) => string | undefined;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare class PixiError extends Error {
|
|
395
|
+
code: ErrorCodeType;
|
|
396
|
+
constructor(code: ErrorCodeType, message: string);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export { type ErrorCodeType, GameUnifier, PixiError };
|
package/dist/core.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var g=(r,t,o)=>t in r?p(r,t,{enumerable:true,configurable:true,writable:true,value:o}):r[t]=o;var i=(r,t,o)=>g(r,typeof t!="symbol"?t+"":t,o);var a;(l=>(l.log=(s,...m)=>console.log(`[Pixi\u2019VN] ${s}`,...m),l.warn=(s,...m)=>console.warn(`[Pixi\u2019VN] ${s}`,...m),l.error=(s,...m)=>console.error(`[Pixi\u2019VN] ${s}`,...m),l.info=(s,...m)=>console.info(`[Pixi\u2019VN] ${s}`,...m)))(a||(a={}));var n=class extends Error{constructor(o,u){super(`[Pixi\u2019VN] ${u}`);i(this,"code");this.code=o;}};var e=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,t.onPreContinue&&e.addOnPreContinue(t.onPreContinue),e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate;}static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static get currentGameStepState(){return e._getCurrentGameStepState()}static get restoreGameStepState(){return e._restoreGameStepState}static get openedLabels(){return e._getOpenedLabels()}static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(o=>o!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(o=>o()));}static get onPreContinue(){return e.runOnPreContinue}static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static async processNavigationRequests(t){let o=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=o.newValue,await o.result}static get getVariable(){return e._getVariable}static get setVariable(){return e._setVariable}static get removeVariable(){return e._removeVariable}static get getFlag(){return e._getFlag}static get setFlag(){return e._setFlag}static get onLabelClosing(){return e._onLabelClosing}static get addHistoryItem(){return e._addHistoryItem}static get getCharacter(){return e._getCharacter}static get animate(){return e._animate}};i(e,"_navigate",()=>{a.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");}),i(e,"_getStepCounter",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_setStepCounter",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_getCurrentGameStepState",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_restoreGameStepState",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_getOpenedLabels",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_onPreContinueHandlers",[]),i(e,"navigationRequestsCount",0),i(e,"processNavigationLock",Promise.resolve()),i(e,"_processNavigationRequests",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_getVariable",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_setVariable",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_removeVariable",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_getFlag",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_setFlag",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"_onLabelClosing",()=>{}),i(e,"_addHistoryItem",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")}),i(e,"runningStepsCount",0),i(e,"_getCharacter",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented.")}),i(e,"onEnd"),i(e,"onError"),i(e,"_animate",()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")});var d=e;export{d as GameUnifier,n as PixiError};
|