@drincs/pixi-vn 1.8.4 → 1.8.7
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/ContainerMemory-BjcfYRU7.d.cts +392 -0
- package/dist/ContainerMemory-BjcfYRU7.d.ts +392 -0
- package/dist/HistoryChoiceMenuOption-CEmjDDJH.d.cts +53 -0
- package/dist/HistoryChoiceMenuOption-CN7NkcxU.d.ts +53 -0
- package/dist/HistoryGameState-3ztYdv84.d.cts +12 -0
- package/dist/HistoryGameState-D4t2fY9x.d.ts +12 -0
- package/dist/HistoryStep-DtOryKAZ.d.cts +76 -0
- package/dist/HistoryStep-DtOryKAZ.d.ts +76 -0
- package/dist/OpenedLabel-DJby8qPc.d.ts +8 -0
- package/dist/OpenedLabel-t6PvSzaL.d.cts +8 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.cts +436 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.ts +436 -0
- package/dist/StepLabelType-CN97wZzm.d.cts +27 -0
- package/dist/StepLabelType-CN97wZzm.d.ts +27 -0
- package/dist/StorageGameState-BJy57o6K.d.ts +27 -0
- package/dist/StorageGameState-CtjNJpvE.d.cts +27 -0
- package/dist/{StoredClassModel-C9mQxPg-.d.cts → StoredClassModel-Bykjdn8S.d.cts} +1 -1
- package/dist/{StoredClassModel-upXPNQTp.d.ts → StoredClassModel-uMifeNzV.d.ts} +1 -1
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +54 -464
- package/dist/canvas.d.ts +54 -464
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.d.cts +5 -5
- package/dist/characters.d.ts +5 -5
- package/dist/characters.mjs +1 -1
- package/dist/{chunk-Z4GZCINS.mjs → chunk-3M6A7TU2.mjs} +1 -1
- package/dist/chunk-BQRPDCUT.mjs +1 -0
- package/dist/{chunk-YCWXA3OR.mjs → chunk-IFPF4NRX.mjs} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +5 -114
- package/dist/core.d.ts +5 -114
- package/dist/core.mjs +1 -1
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +7 -11
- package/dist/history.d.ts +7 -11
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +20 -826
- package/dist/index.d.ts +20 -826
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +1 -1
- package/dist/narration.d.cts +57 -22
- package/dist/narration.d.ts +57 -22
- package/dist/narration.mjs +1 -1
- package/dist/pixi/index.d.cts +12 -0
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +4 -435
- package/dist/sound.d.ts +4 -435
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +4 -27
- package/dist/storage.d.ts +4 -27
- package/dist/storage.mjs +1 -1
- package/dist/vite-listener.d.cts +1 -1
- package/dist/vite-listener.d.ts +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/package.json +1 -1
- package/dist/HistoryChoiceMenuOption-CS41KG13.d.ts +0 -182
- package/dist/HistoryChoiceMenuOption-DdwePsOm.d.cts +0 -182
- package/dist/chunk-V34PMA2H.mjs +0 -1
package/dist/canvas.d.cts
CHANGED
|
@@ -1,40 +1,16 @@
|
|
|
1
1
|
import * as _drincs_pixi_vn_pixi_js from '@drincs/pixi-vn/pixi.js';
|
|
2
|
-
import _drincs_pixi_vn_pixi_js__default, { Container as Container$1, ContainerChild
|
|
2
|
+
import _drincs_pixi_vn_pixi_js__default, { Container as Container$1, ContainerChild, Ticker, UPDATE_PRIORITY as UPDATE_PRIORITY$1, Application, Rectangle as Rectangle$1, ApplicationOptions, PointData, ContainerOptions as ContainerOptions$1, SpriteOptions as SpriteOptions$1, CanvasTextOptions, Texture as Texture$1, TextureSourceLike, ContainerEvents, EventEmitter, ObservablePoint, TextureSource, TextOptions as TextOptions$1 } from '@drincs/pixi-vn/pixi.js';
|
|
3
3
|
export { TextureSourceLike, Ticker as TickerValue } from '@drincs/pixi-vn/pixi.js';
|
|
4
|
-
import {
|
|
5
|
-
export { AnimationOptions as MotionAnimationOptions } from 'motion';
|
|
4
|
+
import { KeyframesType, AnimationOptions, ObjectSegment, ObjectSegmentWithTransition, SequenceOptions } from '@drincs/pixi-vn/motion';
|
|
6
5
|
import { Devtools } from '@pixi/devtools';
|
|
6
|
+
import { g as TickerArgs, T as Ticker$1, b as CanvasBaseItemMemory, C as CanvasBaseItem, i as TickerInfo, j as TickersSequence, R as RepeatType, P as PauseType, c as CanvasGameState, d as ContainerChild$1, a as AdditionalPositionsExtensionProps, f as ListenerExtensionMemory, L as ListenerExtension, A as AdditionalPositionsExtension, O as OnEventsHandlers, e as ContainerMemory, h as TickerHistory } from './ContainerMemory-BjcfYRU7.cjs';
|
|
7
|
+
export { k as addListenerHandler, l as analizePositionsExtensionProps } from './ContainerMemory-BjcfYRU7.cjs';
|
|
8
|
+
export { AnimationOptions as MotionAnimationOptions } from 'motion';
|
|
7
9
|
import { OnErrorHandler } from '@drincs/pixi-vn/core';
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
pivot?: number;
|
|
11
|
-
pivotX?: number;
|
|
12
|
-
pivotY?: number;
|
|
13
|
-
scale?: number;
|
|
14
|
-
scaleX?: number;
|
|
15
|
-
scaleY?: number;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type AnimationOptionsCommon = Omit<AnimationOptions$1, "onComplete" | "onPlay" | "onStop" | "onUpdate" | "onRepeat">;
|
|
19
|
-
|
|
20
|
-
type AnimationOptions = AnimationOptionsCommon & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
21
|
-
|
|
22
|
-
type KeyframesType<T> = ObjectTarget<T> & MotionComponentExtension;
|
|
23
|
-
type SequenceOptions = SequenceOptions$1 & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
24
|
-
type ObjectSegment<O extends CanvasBaseInterface<any>> = [
|
|
25
|
-
ObjectTarget<O> & MotionComponentExtension
|
|
26
|
-
];
|
|
27
|
-
type ObjectSegmentWithTransition<O extends CanvasBaseInterface<any>> = [
|
|
28
|
-
ObjectTarget<O> & MotionComponentExtension,
|
|
29
|
-
AnimationOptions & At
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
type Layer = Container$1<ContainerChild$1>;
|
|
11
|
+
type Layer = Container$1<ContainerChild>;
|
|
33
12
|
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type TickerValue = Ticker$1;
|
|
13
|
+
type TickerValue = Ticker;
|
|
38
14
|
|
|
39
15
|
/**
|
|
40
16
|
* A class is used to create a ticker element to add into a Pixi Application.
|
|
@@ -44,7 +20,7 @@ type TickerValue = Ticker$1;
|
|
|
44
20
|
* In Ren'Py is a transform.
|
|
45
21
|
* @template TArgs The type of the arguments that you want to pass to the ticker.
|
|
46
22
|
* @example
|
|
47
|
-
* ```
|
|
23
|
+
* ```ts
|
|
48
24
|
* \@tickerDecorator() // this is equivalent to tickerDecorator("RotateTicker")
|
|
49
25
|
* export class RotateTicker extends TickerBase<{ speed?: number }> {
|
|
50
26
|
* override fn(
|
|
@@ -69,7 +45,7 @@ type TickerValue = Ticker$1;
|
|
|
69
45
|
* }
|
|
70
46
|
* ```
|
|
71
47
|
*/
|
|
72
|
-
declare abstract class TickerBase<TArgs extends TickerArgs> implements Ticker<TArgs> {
|
|
48
|
+
declare abstract class TickerBase<TArgs extends TickerArgs> implements Ticker$1<TArgs> {
|
|
73
49
|
/**
|
|
74
50
|
* @param args The arguments that you want to pass to the ticker.
|
|
75
51
|
* @param options The options of the ticker.
|
|
@@ -120,60 +96,6 @@ declare abstract class TickerBase<TArgs extends TickerArgs> implements Ticker<TA
|
|
|
120
96
|
get paused(): boolean;
|
|
121
97
|
}
|
|
122
98
|
|
|
123
|
-
interface Ticker<TArgs extends TickerArgs> {
|
|
124
|
-
/**
|
|
125
|
-
* Arguments to pass to the ticker
|
|
126
|
-
*/
|
|
127
|
-
args: TArgs;
|
|
128
|
-
/**
|
|
129
|
-
* Duration in seconds to run the ticker
|
|
130
|
-
*/
|
|
131
|
-
duration?: number;
|
|
132
|
-
/**
|
|
133
|
-
* Priority of the ticker
|
|
134
|
-
*/
|
|
135
|
-
priority?: UPDATE_PRIORITY$1;
|
|
136
|
-
/**
|
|
137
|
-
* Get the alias of the ticker class. This variable is used in the system to get the ticker class by id, {@link RegisteredTickers.getInstance}
|
|
138
|
-
*/
|
|
139
|
-
readonly alias: string;
|
|
140
|
-
/**
|
|
141
|
-
* The id of the ticker. Must be unique for each ticker instance.
|
|
142
|
-
*/
|
|
143
|
-
readonly id: string;
|
|
144
|
-
/**
|
|
145
|
-
* The aliases of the canvas elements that are connected to this ticker
|
|
146
|
-
*/
|
|
147
|
-
canvasElementAliases: string[];
|
|
148
|
-
/**
|
|
149
|
-
* Completes the animation and applies the final state.
|
|
150
|
-
*/
|
|
151
|
-
complete: (options?: {
|
|
152
|
-
ignoreTickerSteps?: boolean;
|
|
153
|
-
}) => Promise<void> | void;
|
|
154
|
-
/**
|
|
155
|
-
* Stops the animation at its current state, and prevents it from resuming when the animation is played again.
|
|
156
|
-
*/
|
|
157
|
-
stop: () => void;
|
|
158
|
-
/**
|
|
159
|
-
* Starts the ticker. This will start the ticker and begin the animation.
|
|
160
|
-
*/
|
|
161
|
-
start: () => void;
|
|
162
|
-
/**
|
|
163
|
-
* Pauses the animation.
|
|
164
|
-
*/
|
|
165
|
-
pause: () => void;
|
|
166
|
-
/**
|
|
167
|
-
* Plays the animation.
|
|
168
|
-
*/
|
|
169
|
-
play: () => void;
|
|
170
|
-
/**
|
|
171
|
-
* Checks if the ticker is paused.
|
|
172
|
-
* @returns true if the ticker is paused, false otherwise.
|
|
173
|
-
*/
|
|
174
|
-
readonly paused: boolean;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
99
|
/**
|
|
178
100
|
* Is a decorator that register a ticker in the game.
|
|
179
101
|
* Is a required decorator for use the ticker in the game.
|
|
@@ -187,7 +109,7 @@ declare function tickerDecorator(name?: string): (target: {
|
|
|
187
109
|
priority?: UPDATE_PRIORITY$1;
|
|
188
110
|
id?: string;
|
|
189
111
|
canvasElementAliases?: string[];
|
|
190
|
-
}): Ticker<any>;
|
|
112
|
+
}): Ticker$1<any>;
|
|
191
113
|
}) => void;
|
|
192
114
|
declare namespace RegisteredTickers {
|
|
193
115
|
/**
|
|
@@ -201,14 +123,14 @@ declare namespace RegisteredTickers {
|
|
|
201
123
|
priority?: UPDATE_PRIORITY$1;
|
|
202
124
|
id?: string;
|
|
203
125
|
canvasElementAliases?: string[];
|
|
204
|
-
}): Ticker<any>;
|
|
126
|
+
}): Ticker$1<any>;
|
|
205
127
|
}, name?: string): void;
|
|
206
128
|
/**
|
|
207
129
|
* Get a ticker by the id.
|
|
208
130
|
* @param canvasId The id of the ticker.
|
|
209
131
|
* @returns The ticker type.
|
|
210
132
|
*/
|
|
211
|
-
function get<T = Ticker<any>>(tickerId: string): T | undefined;
|
|
133
|
+
function get<T = Ticker$1<any>>(tickerId: string): T | undefined;
|
|
212
134
|
/**
|
|
213
135
|
* Get a ticker instance by the id.
|
|
214
136
|
* @param tickerId The id of the ticker.
|
|
@@ -222,7 +144,7 @@ declare namespace RegisteredTickers {
|
|
|
222
144
|
priority?: UPDATE_PRIORITY$1;
|
|
223
145
|
id?: string;
|
|
224
146
|
canvasElementAliases?: string[];
|
|
225
|
-
}): Ticker<TArgs> | undefined;
|
|
147
|
+
}): Ticker$1<TArgs> | undefined;
|
|
226
148
|
/**
|
|
227
149
|
* Get a list of all tickers registered.
|
|
228
150
|
* @returns An array of tickers.
|
|
@@ -233,7 +155,7 @@ declare namespace RegisteredTickers {
|
|
|
233
155
|
priority?: UPDATE_PRIORITY$1;
|
|
234
156
|
id?: string;
|
|
235
157
|
canvasElementAliases?: string[];
|
|
236
|
-
}): Ticker<any>;
|
|
158
|
+
}): Ticker$1<any>;
|
|
237
159
|
}[];
|
|
238
160
|
/**
|
|
239
161
|
* Check if a ticker is registered.
|
|
@@ -248,31 +170,6 @@ declare namespace RegisteredTickers {
|
|
|
248
170
|
function keys(): string[];
|
|
249
171
|
}
|
|
250
172
|
|
|
251
|
-
/**
|
|
252
|
-
* TickerHistory is a class that contains the name of a class and the arguments that were used to create it.
|
|
253
|
-
*/
|
|
254
|
-
interface TickerInfo<TArgs extends TickerArgs> {
|
|
255
|
-
/**
|
|
256
|
-
* If this ticker was created by steps
|
|
257
|
-
*/
|
|
258
|
-
createdByTicketSteps?: {
|
|
259
|
-
canvasElementAlias: string;
|
|
260
|
-
id: string;
|
|
261
|
-
};
|
|
262
|
-
ticker: Ticker<TArgs>;
|
|
263
|
-
}
|
|
264
|
-
interface TickerHistory<TArgs extends TickerArgs> {
|
|
265
|
-
id: string;
|
|
266
|
-
args: TArgs;
|
|
267
|
-
/**
|
|
268
|
-
* The aliases of the canvas elements that are connected to this ticker
|
|
269
|
-
*/
|
|
270
|
-
canvasElementAliases: string[];
|
|
271
|
-
priority?: UPDATE_PRIORITY$1;
|
|
272
|
-
duration?: number;
|
|
273
|
-
paused?: boolean;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
173
|
type TickerProgrationType = TickerProgrationLinear | TickerProgrationExponential;
|
|
277
174
|
|
|
278
175
|
interface TickerProgrationLinear {
|
|
@@ -298,51 +195,6 @@ interface TickerProgrationExponential {
|
|
|
298
195
|
type: "exponential";
|
|
299
196
|
}
|
|
300
197
|
|
|
301
|
-
type PauseType = {
|
|
302
|
-
/**
|
|
303
|
-
* The type of the value
|
|
304
|
-
*/
|
|
305
|
-
type: "pause";
|
|
306
|
-
/**
|
|
307
|
-
* Duration in seconds
|
|
308
|
-
*/
|
|
309
|
-
duration: number;
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
type RepeatType = "repeat";
|
|
313
|
-
|
|
314
|
-
interface TickersStep<TArgs extends TickerArgs> {
|
|
315
|
-
/**
|
|
316
|
-
* Ticker class name
|
|
317
|
-
*/
|
|
318
|
-
ticker: string;
|
|
319
|
-
/**
|
|
320
|
-
* Duration in seconds. If is undefined, the step will end only when the animation is finished.
|
|
321
|
-
*/
|
|
322
|
-
duration?: number;
|
|
323
|
-
/**
|
|
324
|
-
* Arguments to pass to the ticker
|
|
325
|
-
*/
|
|
326
|
-
args: TArgs;
|
|
327
|
-
/**
|
|
328
|
-
* Priority of the ticker
|
|
329
|
-
*/
|
|
330
|
-
priority?: UPDATE_PRIORITY$1;
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* The steps of the tickers
|
|
334
|
-
*/
|
|
335
|
-
interface TickersSequence {
|
|
336
|
-
/**
|
|
337
|
-
* The step number
|
|
338
|
-
*/
|
|
339
|
-
currentStepNumber: number;
|
|
340
|
-
/**
|
|
341
|
-
* The steps of the tickers
|
|
342
|
-
*/
|
|
343
|
-
steps: (TickersStep<any> | RepeatType | PauseType)[];
|
|
344
|
-
}
|
|
345
|
-
|
|
346
198
|
interface TickerTimeoutHistory {
|
|
347
199
|
aliases: string[];
|
|
348
200
|
ticker: string;
|
|
@@ -381,101 +233,9 @@ type CommonTickerProps = {
|
|
|
381
233
|
completeOnContinue?: boolean;
|
|
382
234
|
};
|
|
383
235
|
|
|
384
|
-
/**
|
|
385
|
-
* This class is used to create a canvas element to add into a Pixi Application.
|
|
386
|
-
* You can use {@link canvas.add()} to add this element into the application.
|
|
387
|
-
* This class should be implemented and the memory method should be overridden.
|
|
388
|
-
* You must use the {@link canvasComponentDecorator} to register the canvas in the game.
|
|
389
|
-
* In Ren'Py is a displayable.
|
|
390
|
-
* @example
|
|
391
|
-
* ```typescript
|
|
392
|
-
* const CANVAS_EXAMPLE_ID = "CanvasExample";
|
|
393
|
-
*
|
|
394
|
-
* \@canvasComponentDecorator({
|
|
395
|
-
* name: CANVAS_EXAMPLE_ID,
|
|
396
|
-
* })
|
|
397
|
-
* export class CanvasExample extends Container implements CanvasBaseItem<Memory> {
|
|
398
|
-
* get memory(): Memory {
|
|
399
|
-
* return {
|
|
400
|
-
* pixivnId: CANVAS_EXAMPLE_ID,
|
|
401
|
-
* // ... other properties
|
|
402
|
-
* }
|
|
403
|
-
* }
|
|
404
|
-
* async setMemory(value: Memory) {
|
|
405
|
-
* // ... set other properties
|
|
406
|
-
* }
|
|
407
|
-
* }
|
|
408
|
-
* ```
|
|
409
|
-
*/
|
|
410
|
-
declare class CanvasBaseItem<T2 extends CanvasBaseItemMemory> {
|
|
411
|
-
constructor(..._options: any);
|
|
412
|
-
/**
|
|
413
|
-
* This method return the memory of the canvas element.
|
|
414
|
-
* @throws {PixiError} when the method is not overridden in the subclass.
|
|
415
|
-
*/
|
|
416
|
-
get memory(): T2;
|
|
417
|
-
/**
|
|
418
|
-
* This method set the memory of the canvas element.
|
|
419
|
-
* @throws {PixiError} when the method is not overridden in the subclass.
|
|
420
|
-
*/
|
|
421
|
-
setMemory(_value: T2): Promise<void> | void;
|
|
422
|
-
/**
|
|
423
|
-
* Get the id of the canvas element. This variable is used in the system to get the canvas element by id
|
|
424
|
-
*/
|
|
425
|
-
pixivnId: string;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Interface for the canvas base memory
|
|
430
|
-
*/
|
|
431
|
-
interface CanvasBaseItemMemory {
|
|
432
|
-
pixivnId: string;
|
|
433
|
-
/**
|
|
434
|
-
* The index of the container in its parent, if it has one
|
|
435
|
-
*/
|
|
436
|
-
index?: number;
|
|
437
|
-
/**
|
|
438
|
-
* The label of the parent container, if it has one
|
|
439
|
-
*/
|
|
440
|
-
parentLabel?: string;
|
|
441
|
-
label?: string;
|
|
442
|
-
zIndex?: number;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
236
|
interface CanvasBaseInterface<T2 extends CanvasBaseItemMemory> extends CanvasBaseItem<T2>, Container$1 {
|
|
446
237
|
}
|
|
447
238
|
|
|
448
|
-
/**
|
|
449
|
-
* Interface exported canvas
|
|
450
|
-
*/
|
|
451
|
-
interface CanvasGameState {
|
|
452
|
-
tickers: {
|
|
453
|
-
[id: string]: TickerHistory<any>;
|
|
454
|
-
};
|
|
455
|
-
tickersSteps: {
|
|
456
|
-
[alias: string]: {
|
|
457
|
-
[tickerId: string]: TickersSequence;
|
|
458
|
-
};
|
|
459
|
-
};
|
|
460
|
-
elements: {
|
|
461
|
-
[alias: string]: CanvasBaseItemMemory;
|
|
462
|
-
};
|
|
463
|
-
stage: Partial<ContainerMemory>;
|
|
464
|
-
/**
|
|
465
|
-
* @deprecated
|
|
466
|
-
*/
|
|
467
|
-
elementAliasesOrder: string[];
|
|
468
|
-
tickersToCompleteOnStepEnd: {
|
|
469
|
-
tikersIds: {
|
|
470
|
-
id: string;
|
|
471
|
-
}[];
|
|
472
|
-
stepAlias: {
|
|
473
|
-
id: string;
|
|
474
|
-
alias: string;
|
|
475
|
-
}[];
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
|
|
479
239
|
interface CanvasManagerInterface {
|
|
480
240
|
/**
|
|
481
241
|
* The PIXI Application instance.
|
|
@@ -512,7 +272,7 @@ interface CanvasManagerInterface {
|
|
|
512
272
|
* @param options The options of PixiJS Application
|
|
513
273
|
* @param devtoolsOptions The options of the devtools. You can read more about it in the [PixiJS Devtools documentation](https://pixijs.io/devtools/docs/plugin/)
|
|
514
274
|
* @example
|
|
515
|
-
* ```
|
|
275
|
+
* ```ts
|
|
516
276
|
* const body = document.body
|
|
517
277
|
* if (!body) {
|
|
518
278
|
* throw new Error('body element not found')
|
|
@@ -539,7 +299,7 @@ interface CanvasManagerInterface {
|
|
|
539
299
|
/**
|
|
540
300
|
* The children of the canvas.
|
|
541
301
|
*/
|
|
542
|
-
readonly children: ContainerChild
|
|
302
|
+
readonly children: ContainerChild[];
|
|
543
303
|
/**
|
|
544
304
|
* Copy the properties of an old canvas element to a new canvas element.
|
|
545
305
|
* @param oldAlias Old alias
|
|
@@ -570,7 +330,7 @@ interface CanvasManagerInterface {
|
|
|
570
330
|
* @param canvasComponent The canvas elements to be added.
|
|
571
331
|
* @param options The options of the canvas element.
|
|
572
332
|
* @example
|
|
573
|
-
* ```
|
|
333
|
+
* ```ts
|
|
574
334
|
* const texture = await Assets.load('https://pixijs.com/assets/bunny.png');
|
|
575
335
|
* const sprite = Sprite.from(texture);
|
|
576
336
|
* canvas.add("bunny", sprite);
|
|
@@ -595,7 +355,7 @@ interface CanvasManagerInterface {
|
|
|
595
355
|
* @param options The options of the canvas element.
|
|
596
356
|
* @returns
|
|
597
357
|
* @example
|
|
598
|
-
* ```
|
|
358
|
+
* ```ts
|
|
599
359
|
* canvas.remove("bunny");
|
|
600
360
|
* ```
|
|
601
361
|
*/
|
|
@@ -611,7 +371,7 @@ interface CanvasManagerInterface {
|
|
|
611
371
|
* @param alias The alias of the canvas element.
|
|
612
372
|
* @returns The canvas element.
|
|
613
373
|
* @example
|
|
614
|
-
* ```
|
|
374
|
+
* ```ts
|
|
615
375
|
* const sprite = canvas.find<Sprite>("bunny");
|
|
616
376
|
* ```
|
|
617
377
|
*/
|
|
@@ -654,7 +414,7 @@ interface CanvasManagerInterface {
|
|
|
654
414
|
* @param args The args of the ticker.
|
|
655
415
|
* @returns The ticker if found, undefined otherwise.
|
|
656
416
|
*/
|
|
657
|
-
findTicker<TArgs extends TickerArgs>(tickerId: string, args?: TArgs): Ticker<TArgs> | undefined;
|
|
417
|
+
findTicker<TArgs extends TickerArgs>(tickerId: string, args?: TArgs): Ticker$1<TArgs> | undefined;
|
|
658
418
|
/**
|
|
659
419
|
* Run a ticker. You can run multiple addTicker with the same alias and different tickerClasses.
|
|
660
420
|
* If you run a ticker with the same alias and tickerClass, the old ticker will be removed.
|
|
@@ -663,11 +423,11 @@ interface CanvasManagerInterface {
|
|
|
663
423
|
* @param ticker The ticker class to be run.
|
|
664
424
|
* @returns The id of the ticker.
|
|
665
425
|
* @example
|
|
666
|
-
* ```
|
|
426
|
+
* ```ts
|
|
667
427
|
* canvas.addTicker("alien", new RotateTicker({ speed: 0.2 }))
|
|
668
428
|
* ```
|
|
669
429
|
*/
|
|
670
|
-
addTicker<TArgs extends TickerArgs>(canvasElementAlias: string | string[], ticker: Ticker<TArgs>): string | undefined;
|
|
430
|
+
addTicker<TArgs extends TickerArgs>(canvasElementAlias: string | string[], ticker: Ticker$1<TArgs>): string | undefined;
|
|
671
431
|
/**
|
|
672
432
|
* Run a sequence of tickers.
|
|
673
433
|
* @param alias The alias of canvas element that will use the tickers.
|
|
@@ -675,7 +435,7 @@ interface CanvasManagerInterface {
|
|
|
675
435
|
* @param currentStepNumber The current step number. It is used to continue the sequence of tickers.
|
|
676
436
|
* @returns The id of tickers.
|
|
677
437
|
* @example
|
|
678
|
-
* ```
|
|
438
|
+
* ```ts
|
|
679
439
|
* canvas.addTickersSequence("alien", [
|
|
680
440
|
* new RotateTicker({ speed: 0.1, clockwise: true }, 2), // 2 seconds
|
|
681
441
|
* Pause(1), // 1 second
|
|
@@ -684,20 +444,20 @@ interface CanvasManagerInterface {
|
|
|
684
444
|
* ])
|
|
685
445
|
* ```
|
|
686
446
|
*/
|
|
687
|
-
addTickersSequence(alias: string, steps: (Ticker<any> | RepeatType | PauseType)[], currentStepNumber?: number): string | undefined;
|
|
447
|
+
addTickersSequence(alias: string, steps: (Ticker$1<any> | RepeatType | PauseType)[], currentStepNumber?: number): string | undefined;
|
|
688
448
|
/**
|
|
689
449
|
* Remove a connection between a canvas element and a ticker.
|
|
690
450
|
* And remove the ticker if there is no canvas element connected to it.
|
|
691
451
|
* @param alias The alias of the canvas element that will use the ticker.
|
|
692
452
|
* @param ticker The ticker class to be removed.
|
|
693
453
|
* @example
|
|
694
|
-
* ```
|
|
454
|
+
* ```ts
|
|
695
455
|
* canvas.unlinkComponentFromTicker("alien", RotateTicker)
|
|
696
456
|
* ```
|
|
697
457
|
* @deprecated
|
|
698
458
|
*/
|
|
699
459
|
unlinkComponentFromTicker(alias: string | string[], ticker?: {
|
|
700
|
-
new (): Ticker<any>;
|
|
460
|
+
new (): Ticker$1<any>;
|
|
701
461
|
} | string): void;
|
|
702
462
|
/**
|
|
703
463
|
* Remove all tickers from the canvas.
|
|
@@ -820,7 +580,7 @@ interface CanvasManagerInterface {
|
|
|
820
580
|
* @param layer The layer to be added.
|
|
821
581
|
* @returns The layer.
|
|
822
582
|
* @example
|
|
823
|
-
* ```
|
|
583
|
+
* ```ts
|
|
824
584
|
* const uiLayer = new Container();
|
|
825
585
|
* canvas.addLayer("ui", uiLayer);
|
|
826
586
|
* ```
|
|
@@ -831,7 +591,7 @@ interface CanvasManagerInterface {
|
|
|
831
591
|
* @param label The label of the layer.
|
|
832
592
|
* @returns The layer.
|
|
833
593
|
* @example
|
|
834
|
-
* ```
|
|
594
|
+
* ```ts
|
|
835
595
|
* const uiLayer = canvas.getLayer("ui");
|
|
836
596
|
* ```
|
|
837
597
|
*/
|
|
@@ -840,7 +600,7 @@ interface CanvasManagerInterface {
|
|
|
840
600
|
* Remove a layer from the canvas.
|
|
841
601
|
* @param label The label of the layer to be removed.
|
|
842
602
|
* @example
|
|
843
|
-
* ```
|
|
603
|
+
* ```ts
|
|
844
604
|
* canvas.removeLayer("ui");
|
|
845
605
|
* ```
|
|
846
606
|
*/
|
|
@@ -905,138 +665,6 @@ interface CanvasManagerInterface {
|
|
|
905
665
|
}): void;
|
|
906
666
|
}
|
|
907
667
|
|
|
908
|
-
interface AdditionalPositionsExtensionProps {
|
|
909
|
-
/**
|
|
910
|
-
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
911
|
-
* For example:
|
|
912
|
-
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
913
|
-
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
914
|
-
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
915
|
-
*
|
|
916
|
-
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
917
|
-
*/
|
|
918
|
-
align?: Partial<PointData> | number;
|
|
919
|
-
/**
|
|
920
|
-
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
921
|
-
* For example:
|
|
922
|
-
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
923
|
-
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
924
|
-
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
925
|
-
*
|
|
926
|
-
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
927
|
-
*/
|
|
928
|
-
xAlign?: number;
|
|
929
|
-
/**
|
|
930
|
-
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
931
|
-
* For example:
|
|
932
|
-
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
933
|
-
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
934
|
-
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
935
|
-
*
|
|
936
|
-
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
937
|
-
*/
|
|
938
|
-
yAlign?: number;
|
|
939
|
-
/**
|
|
940
|
-
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
941
|
-
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
942
|
-
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
943
|
-
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
944
|
-
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
945
|
-
*
|
|
946
|
-
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
947
|
-
*/
|
|
948
|
-
percentagePosition?: Partial<PointData> | number;
|
|
949
|
-
/**
|
|
950
|
-
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
951
|
-
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
952
|
-
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
953
|
-
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
954
|
-
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
955
|
-
*
|
|
956
|
-
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
957
|
-
*/
|
|
958
|
-
percentageX?: number;
|
|
959
|
-
/**
|
|
960
|
-
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
961
|
-
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
962
|
-
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
963
|
-
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
964
|
-
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
965
|
-
*
|
|
966
|
-
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
967
|
-
*/
|
|
968
|
-
percentageY?: number;
|
|
969
|
-
}
|
|
970
|
-
interface AdditionalPositionsExtension {
|
|
971
|
-
/**
|
|
972
|
-
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
973
|
-
* For example:
|
|
974
|
-
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
975
|
-
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
976
|
-
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
977
|
-
*
|
|
978
|
-
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
979
|
-
*/
|
|
980
|
-
align: Partial<PointData> | number;
|
|
981
|
-
/**
|
|
982
|
-
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
983
|
-
* For example:
|
|
984
|
-
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
985
|
-
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
986
|
-
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
987
|
-
*
|
|
988
|
-
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
989
|
-
*/
|
|
990
|
-
xAlign: number;
|
|
991
|
-
/**
|
|
992
|
-
* is a way to set the position of the element in the canvas. compared to position, align, it is a percentage used to determine the proximity from the edges of the canvas.
|
|
993
|
-
* For example:
|
|
994
|
-
* - if you set align to 0.5, the element will be in the center of the canvas.
|
|
995
|
-
* - if you set align to 0, the left end and a top end of the element will be in the left end and top end of the canvas.
|
|
996
|
-
* - if you set align to 1, the right end and a bottom end of the element will be in the right end and bottom end of the canvas.
|
|
997
|
-
*
|
|
998
|
-
* **Important:** The {@link PixiContainer.pivot} field does not affect the alignment.
|
|
999
|
-
*/
|
|
1000
|
-
yAlign: number;
|
|
1001
|
-
/**
|
|
1002
|
-
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
1003
|
-
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
1004
|
-
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
1005
|
-
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
1006
|
-
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
1007
|
-
*
|
|
1008
|
-
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
1009
|
-
*/
|
|
1010
|
-
percentagePosition: Partial<PointData> | number;
|
|
1011
|
-
/**
|
|
1012
|
-
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
1013
|
-
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
1014
|
-
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
1015
|
-
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
1016
|
-
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
1017
|
-
*
|
|
1018
|
-
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
1019
|
-
*/
|
|
1020
|
-
percentageX: number;
|
|
1021
|
-
/**
|
|
1022
|
-
* is a way to set the position of the element in the canvas calculated in percentage.
|
|
1023
|
-
* For example, if you set the {@link PixiContainer.pivot} to 0.5, and:
|
|
1024
|
-
* - if you set percentagePosition to 0.5, the element will be in the center of the canvas.
|
|
1025
|
-
* - If you set percentagePosition to 0, the center of the element will be in the left end and top end of the canvas.
|
|
1026
|
-
* - If you set percentagePosition to 1, the center of the element will be in the right end and bottom end of the canvas.
|
|
1027
|
-
*
|
|
1028
|
-
* **Important:** The {@link PixiContainer.pivot} field does affect the percentagePosition.
|
|
1029
|
-
*/
|
|
1030
|
-
percentageY: number;
|
|
1031
|
-
readonly positionType: "pixel" | "percentage" | "align";
|
|
1032
|
-
readonly positionInfo: {
|
|
1033
|
-
x: number;
|
|
1034
|
-
y: number;
|
|
1035
|
-
type: "pixel" | "percentage" | "align";
|
|
1036
|
-
};
|
|
1037
|
-
}
|
|
1038
|
-
declare function analizePositionsExtensionProps<T extends AdditionalPositionsExtensionProps>(props?: T): T | undefined;
|
|
1039
|
-
|
|
1040
668
|
interface AnchorExtensionProps {
|
|
1041
669
|
anchor?: PointData | number;
|
|
1042
670
|
}
|
|
@@ -1061,15 +689,13 @@ interface AnchorExtension {
|
|
|
1061
689
|
anchor: PointData;
|
|
1062
690
|
}
|
|
1063
691
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
interface ContainerOptions<C extends ContainerChild = ContainerChild> extends Omit<ContainerOptions$1<C>, "on">, AnchorExtensionProps, AdditionalPositionsExtensionProps {
|
|
692
|
+
interface ContainerOptions<C extends ContainerChild$1 = ContainerChild$1> extends Omit<ContainerOptions$1<C>, "on">, AnchorExtensionProps, AdditionalPositionsExtensionProps {
|
|
1067
693
|
}
|
|
1068
694
|
interface SpriteOptions extends Omit<SpriteOptions$1, "on">, AdditionalPositionsExtensionProps {
|
|
1069
695
|
}
|
|
1070
696
|
interface TextOptions extends Omit<CanvasTextOptions, "on">, AdditionalPositionsExtensionProps {
|
|
1071
697
|
}
|
|
1072
|
-
interface ImageContainerOptions<C extends ContainerChild = ContainerChild> extends ContainerOptions<C> {
|
|
698
|
+
interface ImageContainerOptions<C extends ContainerChild$1 = ContainerChild$1> extends ContainerOptions<C> {
|
|
1073
699
|
}
|
|
1074
700
|
interface ImageSpriteOptions extends SpriteOptions {
|
|
1075
701
|
}
|
|
@@ -1079,32 +705,6 @@ interface VideoSpriteOptions extends ImageSpriteOptions {
|
|
|
1079
705
|
currentTime?: number;
|
|
1080
706
|
}
|
|
1081
707
|
|
|
1082
|
-
interface ListenerExtensionMemory {
|
|
1083
|
-
onEvents?: OnEventsHandlers;
|
|
1084
|
-
}
|
|
1085
|
-
interface OnEventsHandlers {
|
|
1086
|
-
[name: string]: string;
|
|
1087
|
-
}
|
|
1088
|
-
interface ListenerExtension {
|
|
1089
|
-
/**
|
|
1090
|
-
* Add a listener for a given event.
|
|
1091
|
-
* @example
|
|
1092
|
-
* ```ts
|
|
1093
|
-
* export class Events {
|
|
1094
|
-
* \@eventDecorator()
|
|
1095
|
-
* static eventExample(event: FederatedEvent, component: Sprite) {
|
|
1096
|
-
* // event code here
|
|
1097
|
-
* }
|
|
1098
|
-
* }
|
|
1099
|
-
*
|
|
1100
|
-
* sprite.on("pointerdown", Events.eventExample);
|
|
1101
|
-
* ```
|
|
1102
|
-
*/
|
|
1103
|
-
on: Container$1["on"];
|
|
1104
|
-
readonly onEventsHandlers: OnEventsHandlers;
|
|
1105
|
-
}
|
|
1106
|
-
declare function addListenerHandler<T extends ListenerExtension>(event: symbol | string, element: T, fn: (...args: never[]) => unknown): boolean;
|
|
1107
|
-
|
|
1108
708
|
/**
|
|
1109
709
|
* Interface for Asset memory
|
|
1110
710
|
*/
|
|
@@ -1130,7 +730,7 @@ interface SpriteMemory extends SpriteBaseMemory {
|
|
|
1130
730
|
* This class is a extension of the [PIXI.Sprite class](https://pixijs.com/8.x/examples/sprite/basic), it has the same properties and methods,
|
|
1131
731
|
* but it has the ability to be saved and loaded by the Pixi’VN library.
|
|
1132
732
|
* @example
|
|
1133
|
-
* ```
|
|
733
|
+
* ```ts
|
|
1134
734
|
* const texture = await Assets.load('https://pixijs.com/assets/bunny.png');
|
|
1135
735
|
* const sprite = Sprite.from(texture);
|
|
1136
736
|
*
|
|
@@ -1153,14 +753,14 @@ declare class Sprite<Memory extends SpriteOptions$1 & CanvasBaseItemMemory = Spr
|
|
|
1153
753
|
static from(source: Texture$1 | TextureSourceLike, skipCache?: boolean): Sprite<any>;
|
|
1154
754
|
/** ListenerExtension */
|
|
1155
755
|
readonly onEventsHandlers: OnEventsHandlers;
|
|
1156
|
-
on<T extends keyof ContainerEvents<ContainerChild
|
|
756
|
+
on<T extends keyof ContainerEvents<ContainerChild> | keyof {
|
|
1157
757
|
[K: symbol]: any;
|
|
1158
758
|
[K: {} & string]: any;
|
|
1159
759
|
}>(event: T, fn: (...args: [
|
|
1160
|
-
...EventEmitter.ArgumentMap<ContainerEvents<ContainerChild
|
|
760
|
+
...EventEmitter.ArgumentMap<ContainerEvents<ContainerChild> & {
|
|
1161
761
|
[K: symbol]: any;
|
|
1162
762
|
[K: {} & string]: any;
|
|
1163
|
-
}>[Extract<T, keyof ContainerEvents<ContainerChild
|
|
763
|
+
}>[Extract<T, keyof ContainerEvents<ContainerChild> | keyof {
|
|
1164
764
|
[K: symbol]: any;
|
|
1165
765
|
[K: {} & string]: any;
|
|
1166
766
|
}>],
|
|
@@ -1214,7 +814,7 @@ interface ImageSpriteMemory extends SpriteBaseMemory {
|
|
|
1214
814
|
* You need to use {@link load} to show the image in the canvas.
|
|
1215
815
|
* This class is used for functions like {@link addImage} and {@link showWithDissolve}.
|
|
1216
816
|
* @example
|
|
1217
|
-
* ```
|
|
817
|
+
* ```ts
|
|
1218
818
|
* let alien = new ImageSprite({
|
|
1219
819
|
* anchor: { x: 0.5, y: 0.5 },
|
|
1220
820
|
* x: 100,
|
|
@@ -1224,7 +824,7 @@ interface ImageSpriteMemory extends SpriteBaseMemory {
|
|
|
1224
824
|
* canvas.add("alien", alien)
|
|
1225
825
|
* ```
|
|
1226
826
|
* @example
|
|
1227
|
-
* ```
|
|
827
|
+
* ```ts
|
|
1228
828
|
* let alien = addImage("alien", 'https://pixijs.com/assets/eggHead.png')
|
|
1229
829
|
* alien.anchor.set(0.5);
|
|
1230
830
|
* alien.x = 100
|
|
@@ -1271,7 +871,7 @@ interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
|
1271
871
|
* You need to use {@link load} to show the video in the canvas.
|
|
1272
872
|
* This class is used for functions like {@link addVideo} and {@link showWithDissolve}.
|
|
1273
873
|
* @example
|
|
1274
|
-
* ```
|
|
874
|
+
* ```ts
|
|
1275
875
|
* let film = new VideoSprite({
|
|
1276
876
|
* x: 100,
|
|
1277
877
|
* y: 100,
|
|
@@ -1280,7 +880,7 @@ interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
|
1280
880
|
* canvas.add("film", film)
|
|
1281
881
|
* ```
|
|
1282
882
|
* @example
|
|
1283
|
-
* ```
|
|
883
|
+
* ```ts
|
|
1284
884
|
* let film = addVideo("film", 'https://pixijs.com/assets/video.mp4')
|
|
1285
885
|
* film.currentTime = 2
|
|
1286
886
|
* await film.load()
|
|
@@ -1329,21 +929,11 @@ declare class VideoSprite extends ImageSprite<VideoSpriteMemory> {
|
|
|
1329
929
|
get duration(): number | undefined;
|
|
1330
930
|
}
|
|
1331
931
|
|
|
1332
|
-
/**
|
|
1333
|
-
* Interface for the canvas container memory
|
|
1334
|
-
*/
|
|
1335
|
-
interface ContainerMemory<C extends ContainerChild = ContainerChild> extends ContainerOptions$1<C>, CanvasBaseItemMemory, ListenerExtensionMemory, AdditionalPositionsExtensionProps {
|
|
1336
|
-
/**
|
|
1337
|
-
* The elements contained in this container
|
|
1338
|
-
*/
|
|
1339
|
-
elements: CanvasBaseItemMemory[];
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
932
|
/**
|
|
1343
933
|
* This class is a extension of the [PIXI.Container class](https://pixijs.com/8.x/examples/basic/container), it has the same properties and methods,
|
|
1344
934
|
* but it has the ability to be saved and loaded by the Pixi’VN library.
|
|
1345
935
|
* @example
|
|
1346
|
-
* ```
|
|
936
|
+
* ```ts
|
|
1347
937
|
* const container = new Container();
|
|
1348
938
|
* canvas.add(container);
|
|
1349
939
|
* const texture = await Assets.load('https://pixijs.com/assets/bunny.png');
|
|
@@ -1356,7 +946,7 @@ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends Con
|
|
|
1356
946
|
* }
|
|
1357
947
|
* ```
|
|
1358
948
|
*/
|
|
1359
|
-
declare class Container<C extends ContainerChild = ContainerChild, Memory extends ContainerMemory = ContainerMemory> extends Container$1<C> implements CanvasBaseItem<Memory>, ListenerExtension, AnchorExtension, AdditionalPositionsExtension {
|
|
949
|
+
declare class Container<C extends ContainerChild$1 = ContainerChild$1, Memory extends ContainerMemory = ContainerMemory> extends Container$1<C> implements CanvasBaseItem<Memory>, ListenerExtension, AnchorExtension, AdditionalPositionsExtension {
|
|
1360
950
|
constructor(options?: ContainerOptions<C>);
|
|
1361
951
|
readonly pixivnId: string;
|
|
1362
952
|
get memory(): Memory;
|
|
@@ -1432,7 +1022,7 @@ interface ImageContainerMemory extends ContainerMemory<ImageSprite> {
|
|
|
1432
1022
|
* This class is a extension of the {@link Container}, it has the same properties and methods,
|
|
1433
1023
|
* but this container is composed only of {@link ImageSprite} and introduces the {@link load} functionality
|
|
1434
1024
|
* @example
|
|
1435
|
-
* ```
|
|
1025
|
+
* ```ts
|
|
1436
1026
|
* const liamBodyImageUrl = 'https://example.com/assets/liam/body.png';
|
|
1437
1027
|
* const liamHeadImageUrl = 'https://example.com/assets/liam/head.png';
|
|
1438
1028
|
* const container = new ImageContainer(undefined, [liamBodyImageUrl, liamHeadImageUrl]);
|
|
@@ -1552,7 +1142,7 @@ interface TextMemory extends TextOptions$1, CanvasBaseItemMemory, AdditionalPosi
|
|
|
1552
1142
|
* This class is a extension of the [PIXI.Text class](https://pixijs.com/8.x/examples/text/pixi-text), it has the same properties and methods,
|
|
1553
1143
|
* but it has the ability to be saved and loaded by the Pixi’VN library.
|
|
1554
1144
|
* @example
|
|
1555
|
-
* ```
|
|
1145
|
+
* ```ts
|
|
1556
1146
|
* const text = new Text();
|
|
1557
1147
|
* text.text = "Hello World"
|
|
1558
1148
|
* canvas.add("text", text);
|
|
@@ -1564,14 +1154,14 @@ declare class Text extends _drincs_pixi_vn_pixi_js__default.Text implements Canv
|
|
|
1564
1154
|
get memory(): TextMemory;
|
|
1565
1155
|
setMemory(value: TextMemory): Promise<void>;
|
|
1566
1156
|
readonly onEventsHandlers: OnEventsHandlers;
|
|
1567
|
-
on<T extends keyof ContainerEvents<ContainerChild
|
|
1157
|
+
on<T extends keyof ContainerEvents<ContainerChild> | keyof {
|
|
1568
1158
|
[K: symbol]: any;
|
|
1569
1159
|
[K: {} & string]: any;
|
|
1570
1160
|
}>(event: T, fn: (...args: [
|
|
1571
|
-
...EventEmitter.ArgumentMap<ContainerEvents<ContainerChild
|
|
1161
|
+
...EventEmitter.ArgumentMap<ContainerEvents<ContainerChild> & {
|
|
1572
1162
|
[K: symbol]: any;
|
|
1573
1163
|
[K: {} & string]: any;
|
|
1574
|
-
}>[Extract<T, keyof ContainerEvents<ContainerChild
|
|
1164
|
+
}>[Extract<T, keyof ContainerEvents<ContainerChild> | keyof {
|
|
1575
1165
|
[K: symbol]: any;
|
|
1576
1166
|
[K: {} & string]: any;
|
|
1577
1167
|
}>],
|
|
@@ -1968,7 +1558,7 @@ declare function drawCanvasErrorHandler(): OnErrorHandler;
|
|
|
1968
1558
|
* @param options The options of the image.
|
|
1969
1559
|
* @returns the container of the image.
|
|
1970
1560
|
* @example
|
|
1971
|
-
* ```
|
|
1561
|
+
* ```ts
|
|
1972
1562
|
* let bunny = addImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
1973
1563
|
* await bunny.load()
|
|
1974
1564
|
* ```
|
|
@@ -1981,7 +1571,7 @@ declare function addImageCointainer(alias: string, imageUrls: string[], options?
|
|
|
1981
1571
|
* @param options The options of the image.
|
|
1982
1572
|
* @returns A promise that is resolved when the image is loaded.
|
|
1983
1573
|
* @example
|
|
1984
|
-
* ```
|
|
1574
|
+
* ```ts
|
|
1985
1575
|
* let bunny = showImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
1986
1576
|
* ```
|
|
1987
1577
|
*/
|
|
@@ -1997,7 +1587,7 @@ declare function showImageContainer(alias: string, imageUrls: string[], options?
|
|
|
1997
1587
|
* @returns the container of the image.
|
|
1998
1588
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1999
1589
|
* @example
|
|
2000
|
-
* ```
|
|
1590
|
+
* ```ts
|
|
2001
1591
|
* let bunny1 = addImage("bunny1", "https://pixijs.com/assets/bunny1.png")
|
|
2002
1592
|
* await bunny1.load()
|
|
2003
1593
|
* Assets.add({ alias: "bunny2", src: "https://pixijs.com/assets/bunny2.png" })
|
|
@@ -2014,7 +1604,7 @@ declare function addImage(alias: string, imageUrl?: string, options?: ImageSprit
|
|
|
2014
1604
|
* @returns A promise that is resolved when the image is loaded.
|
|
2015
1605
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
2016
1606
|
* @example
|
|
2017
|
-
* ```
|
|
1607
|
+
* ```ts
|
|
2018
1608
|
* let bunny1 = showImage("bunny1", "https://pixijs.com/assets/bunny1.png")
|
|
2019
1609
|
* Assets.add({ alias: "bunny2", src: "https://pixijs.com/assets/bunny2.png" })
|
|
2020
1610
|
* let bunny2 = showImage("bunny2")
|
|
@@ -2029,7 +1619,7 @@ declare function showImage(alias: string, imageUrl?: string, options?: ImageSpri
|
|
|
2029
1619
|
* @param options The options of the text.
|
|
2030
1620
|
* @returns A promise that is resolved when the text is loaded.
|
|
2031
1621
|
* @example
|
|
2032
|
-
* ```
|
|
1622
|
+
* ```ts
|
|
2033
1623
|
* let text = showText("text", "Hello World", { fontSize: 24, fill: "white" })
|
|
2034
1624
|
* ```
|
|
2035
1625
|
*/
|
|
@@ -2053,7 +1643,7 @@ declare function getTexture(textureAlias?: string): Promise<Texture$1 | undefine
|
|
|
2053
1643
|
* @returns the container of the video.
|
|
2054
1644
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
2055
1645
|
* @example
|
|
2056
|
-
* ```
|
|
1646
|
+
* ```ts
|
|
2057
1647
|
* let video1 = addVideo("video1", "https://pixijs.com/assets/video1.mp4")
|
|
2058
1648
|
* await video1.load()
|
|
2059
1649
|
* Assets.add({ alias: "video2", src: "https://pixijs.com/assets/video2.png" })
|
|
@@ -2070,7 +1660,7 @@ declare function addVideo(alias: string, videoUrl?: string, options?: VideoSprit
|
|
|
2070
1660
|
* @returns A promise that is resolved when the video is loaded.
|
|
2071
1661
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
2072
1662
|
* @example
|
|
2073
|
-
* ```
|
|
1663
|
+
* ```ts
|
|
2074
1664
|
* let video1 = showVideo("video1", "https://pixijs.com/assets/video1.mp4")
|
|
2075
1665
|
* Assets.add({ alias: "video2", src: "https://pixijs.com/assets/video2.png" })
|
|
2076
1666
|
* let video2 = showVideo("video2")
|
|
@@ -2107,4 +1697,4 @@ declare const UPDATE_PRIORITY: typeof _drincs_pixi_vn_pixi_js.UPDATE_PRIORITY;
|
|
|
2107
1697
|
|
|
2108
1698
|
declare const canvas: CanvasManagerInterface;
|
|
2109
1699
|
|
|
2110
|
-
export {
|
|
1700
|
+
export { AdditionalPositionsExtension, AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type AssetMemory, Assets, type CanvasBaseInterface, CanvasBaseItem, CanvasBaseItemMemory, CanvasGameState, type CanvasManagerInterface, CanvasManagerStatic, CanvasPropertyUtility, Color, type CommonTickerProps, Container, ContainerChild$1 as ContainerChild, ContainerMemory, type ContainerOptions, ImageContainer, type ImageContainerMemory, type ImageContainerOptions, ImageSprite, type ImageSpriteMemory, type ImageSpriteOptions, type Layer, ListenerExtension, ListenerExtensionMemory, type MoveInOutProps, OnEventsHandlers, PauseType, type PushInOutProps, Rectangle, RegisteredCanvasComponents, RegisteredEvents, RegisteredTickers, RepeatType, type ShakeEffectProps, type ShowWithDissolveTransitionProps, type ShowWithFadeTransitionProps, Sprite, type SpriteBaseMemory, type SpriteMemory, type SpriteOptions, Text, type TextMemory, type TextOptions, TextStyle, Texture, Ticker$1 as Ticker, TickerArgs, TickerBase, TickerHistory, TickerInfo, type TickerProgrationExponential, type TickerProgrationLinear, type TickerProgrationType, type TickerTimeoutHistory, TickersSequence, UPDATE_PRIORITY, VideoSprite, type VideoSpriteMemory, type VideoSpriteOptions, type ZoomInOutProps, addImage, addImageCointainer, addVideo, canvas, canvasComponentDecorator, drawCanvasErrorHandler, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, tickerDecorator, zoomIn, zoomOut };
|