@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/canvas.d.cts
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
import * as _drincs_pixi_vn_pixi_js from '@drincs/pixi-vn/pixi.js';
|
|
2
2
|
import _drincs_pixi_vn_pixi_js__default, { Container as Container$1, ContainerChild as ContainerChild$1, Ticker as Ticker$1, 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 { ObjectTarget, AnimationOptions as AnimationOptions$1, At, SequenceOptions as SequenceOptions$1 } from 'motion';
|
|
5
|
+
export { AnimationOptions as MotionAnimationOptions } from 'motion';
|
|
4
6
|
import { Devtools } from '@pixi/devtools';
|
|
5
|
-
import { AnimationOptions as AnimationOptions$1, At, ObjectTarget, AnimationPlaybackControlsWithThen, ObjectSegment as ObjectSegment$1, SequenceOptions as SequenceOptions$1 } from 'motion';
|
|
6
|
-
export { At, AnimationOptions as MotionAnimationOptions } from 'motion';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface MotionComponentExtension {
|
|
9
|
+
pivot?: number;
|
|
10
|
+
pivotX?: number;
|
|
11
|
+
pivotY?: number;
|
|
12
|
+
scale?: number;
|
|
13
|
+
scaleX?: number;
|
|
14
|
+
scaleY?: number;
|
|
15
|
+
}
|
|
9
16
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
type
|
|
17
|
+
type AnimationOptionsCommon = Omit<AnimationOptions$1, "onComplete" | "onPlay" | "onStop" | "onUpdate" | "onRepeat">;
|
|
18
|
+
|
|
19
|
+
type AnimationOptions = AnimationOptionsCommon & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
20
|
+
|
|
21
|
+
type KeyframesType<T> = ObjectTarget<T> & MotionComponentExtension;
|
|
22
|
+
type SequenceOptions = SequenceOptions$1 & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
23
|
+
type ObjectSegment<O extends CanvasBaseInterface<any>> = [ObjectTarget<O> & MotionComponentExtension];
|
|
24
|
+
type ObjectSegmentWithTransition<O extends CanvasBaseInterface<any>> = [
|
|
25
|
+
ObjectTarget<O> & MotionComponentExtension,
|
|
26
|
+
AnimationOptions & At
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
type Layer = Container$1<ContainerChild$1>;
|
|
15
30
|
|
|
16
31
|
interface TickerArgs {
|
|
17
32
|
}
|
|
@@ -74,7 +89,7 @@ declare abstract class TickerBase<TArgs extends TickerArgs> implements Ticker<TA
|
|
|
74
89
|
*/
|
|
75
90
|
canvasElementAliases?: string[];
|
|
76
91
|
});
|
|
77
|
-
readonly alias:
|
|
92
|
+
readonly alias: string;
|
|
78
93
|
readonly id: string;
|
|
79
94
|
args: TArgs;
|
|
80
95
|
duration?: number;
|
|
@@ -118,7 +133,7 @@ interface Ticker<TArgs extends TickerArgs> {
|
|
|
118
133
|
/**
|
|
119
134
|
* Get the alias of the ticker class. This variable is used in the system to get the ticker class by id, {@link RegisteredTickers.getInstance}
|
|
120
135
|
*/
|
|
121
|
-
readonly alias:
|
|
136
|
+
readonly alias: string;
|
|
122
137
|
/**
|
|
123
138
|
* The id of the ticker. Must be unique for each ticker instance.
|
|
124
139
|
*/
|
|
@@ -163,7 +178,7 @@ interface Ticker<TArgs extends TickerArgs> {
|
|
|
163
178
|
* @param name is th identifier of the label, by default is the name of the class
|
|
164
179
|
* @returns
|
|
165
180
|
*/
|
|
166
|
-
declare function tickerDecorator(name?:
|
|
181
|
+
declare function tickerDecorator(name?: string): (target: {
|
|
167
182
|
new (args: any, options?: {
|
|
168
183
|
duration?: number;
|
|
169
184
|
priority?: UPDATE_PRIORITY$1;
|
|
@@ -184,13 +199,13 @@ declare namespace RegisteredTickers {
|
|
|
184
199
|
id?: string;
|
|
185
200
|
canvasElementAliases?: string[];
|
|
186
201
|
}): Ticker<any>;
|
|
187
|
-
}, name?:
|
|
202
|
+
}, name?: string): void;
|
|
188
203
|
/**
|
|
189
204
|
* Get a ticker by the id.
|
|
190
205
|
* @param canvasId The id of the ticker.
|
|
191
206
|
* @returns The ticker type.
|
|
192
207
|
*/
|
|
193
|
-
function get<T = Ticker<any>>(tickerId:
|
|
208
|
+
function get<T = Ticker<any>>(tickerId: string): T | undefined;
|
|
194
209
|
/**
|
|
195
210
|
* Get a ticker instance by the id.
|
|
196
211
|
* @param tickerId The id of the ticker.
|
|
@@ -199,7 +214,7 @@ declare namespace RegisteredTickers {
|
|
|
199
214
|
* @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
|
|
200
215
|
* @returns The instance of the ticker
|
|
201
216
|
*/
|
|
202
|
-
function getInstance<TArgs extends TickerArgs>(tickerId:
|
|
217
|
+
function getInstance<TArgs extends TickerArgs>(tickerId: string, args: TArgs, options?: {
|
|
203
218
|
duration?: number;
|
|
204
219
|
priority?: UPDATE_PRIORITY$1;
|
|
205
220
|
id?: string;
|
|
@@ -230,71 +245,6 @@ declare namespace RegisteredTickers {
|
|
|
230
245
|
function keys(): string[];
|
|
231
246
|
}
|
|
232
247
|
|
|
233
|
-
type SegmentOptions = AnimationOptions$1 & At;
|
|
234
|
-
type ObjectSegmentWithTransition$1<O extends {} = {}> = [O, ObjectTarget<O>, SegmentOptions];
|
|
235
|
-
/**
|
|
236
|
-
* Create a motion driver that integrates with the PixiJS ticker. This driver will allow you to use motion's animation capabilities while ensuring that animations are synchronized with the PixiJS rendering loop.
|
|
237
|
-
* @param ticker - The PixiJS ticker to integrate with. If not provided, a new ticker will be created.
|
|
238
|
-
* @returns An object that implements the motion driver interface, allowing you to start, stop, and control animations using the PixiJS ticker.
|
|
239
|
-
* @example
|
|
240
|
-
* const ticker = new PIXI.Ticker();
|
|
241
|
-
* const driver = motionDriver(ticker);
|
|
242
|
-
* const animation = animate(mySprite, { x: 100 }, { duration: 1, driver });
|
|
243
|
-
* animation.start();
|
|
244
|
-
*/
|
|
245
|
-
declare const motionDriver: (ticker: Ticker$1) => AnimationOptions$1["driver"];
|
|
246
|
-
/**
|
|
247
|
-
* Animate a PixiJS component or components using [motion's animate](https://motion.dev/docs/animate) function.
|
|
248
|
-
* This function integrates with the PixiJS ticker to ensure smooth animations.
|
|
249
|
-
*
|
|
250
|
-
* Pixi’VN will **not** keep track of the animation state of this function (This feature is intended for animating PixiJS components used for UI.).
|
|
251
|
-
* If you want Pixi'VN to save the animation state in saves, use the {@link canvas.animate} function instead.
|
|
252
|
-
* @param components - The PixiJS component(s) to animate.
|
|
253
|
-
* @param keyframes - The keyframes to animate the component(s) with.
|
|
254
|
-
* @param options - Additional options for the animation, including duration, easing, and ticker.
|
|
255
|
-
* @returns An animation playback control object that can be used to start, stop, or control the animation.
|
|
256
|
-
* @template T - The type of PixiJS component(s) being animated.
|
|
257
|
-
*/
|
|
258
|
-
declare function animate<T extends {}>(components: T | T[], keyframes: ObjectTarget<T>, options?: AnimationOptions$1 & {
|
|
259
|
-
ticker?: Ticker$1;
|
|
260
|
-
}): AnimationPlaybackControlsWithThen;
|
|
261
|
-
/**
|
|
262
|
-
* Animate a sequence of PixiJS components with transitions using [motion's animate](https://motion.dev/docs/animate) function.
|
|
263
|
-
* This function allows for complex animations involving multiple components and transitions.
|
|
264
|
-
* It integrates with the PixiJS ticker to ensure smooth animations.
|
|
265
|
-
* This function is intended for animating PixiJS components used for UI.
|
|
266
|
-
*
|
|
267
|
-
* Pixi’VN will **not** keep track of the animation state of this function (This feature is intended for animating PixiJS components used for UI.).
|
|
268
|
-
* If you want Pixi'VN to save the animation state in saves, use the {@link canvas.animate} function instead
|
|
269
|
-
*
|
|
270
|
-
* @param sequence An array of segments to animate, where each segment is an array containing:
|
|
271
|
-
* - The PixiJS component to animate.
|
|
272
|
-
* - The keyframes to animate the component with.
|
|
273
|
-
* - An options object that can include animation options and a ticker.
|
|
274
|
-
* @param options Additional options for the sequence, such as duration and repeat count.
|
|
275
|
-
* @returns An animation playback control object that can be used to start, stop, or control the animation.
|
|
276
|
-
* @template T - The type of PixiJS component(s) being animated.
|
|
277
|
-
*/
|
|
278
|
-
declare function animate<T extends {}>(sequence: (ObjectSegment$1<T> | ObjectSegmentWithTransition$1<T>)[], options?: SequenceOptions$1 & {
|
|
279
|
-
ticker?: Ticker$1;
|
|
280
|
-
driver?: any;
|
|
281
|
-
}): AnimationPlaybackControlsWithThen;
|
|
282
|
-
/**
|
|
283
|
-
* Create a timeline for running a sequence of functions with transitions. Each function will be called with the provided arguments and will run for the specified duration.
|
|
284
|
-
* @example
|
|
285
|
-
* timeline([
|
|
286
|
-
* { duration: 10, onComplete: () => console.log("First step completed") },
|
|
287
|
-
* { duration: 5, onComplete: () => console.log("Second step completed") },
|
|
288
|
-
* ]);
|
|
289
|
-
* @param times
|
|
290
|
-
* @param options
|
|
291
|
-
* @returns
|
|
292
|
-
*/
|
|
293
|
-
declare function timeline(times: SegmentOptions[], options?: SequenceOptions$1 & {
|
|
294
|
-
ticker?: Ticker$1;
|
|
295
|
-
driver?: any;
|
|
296
|
-
}): AnimationPlaybackControlsWithThen;
|
|
297
|
-
|
|
298
248
|
/**
|
|
299
249
|
* TickerHistory is a class that contains the name of a class and the arguments that were used to create it.
|
|
300
250
|
*/
|
|
@@ -309,7 +259,7 @@ interface TickerInfo<TArgs extends TickerArgs> {
|
|
|
309
259
|
ticker: Ticker<TArgs>;
|
|
310
260
|
}
|
|
311
261
|
interface TickerHistory<TArgs extends TickerArgs> {
|
|
312
|
-
id:
|
|
262
|
+
id: string;
|
|
313
263
|
args: TArgs;
|
|
314
264
|
/**
|
|
315
265
|
* The aliases of the canvas elements that are connected to this ticker
|
|
@@ -475,33 +425,12 @@ declare class CanvasBaseItem<T2 extends CanvasBaseItemMemory> {
|
|
|
475
425
|
*/
|
|
476
426
|
interface CanvasBaseItemMemory {
|
|
477
427
|
pixivnId: string;
|
|
428
|
+
zIndex?: number;
|
|
478
429
|
}
|
|
479
430
|
|
|
480
431
|
interface CanvasBaseInterface<T2 extends CanvasBaseItemMemory> extends CanvasBaseItem<T2>, Container$1 {
|
|
481
432
|
}
|
|
482
433
|
|
|
483
|
-
interface MotionComponentExtension {
|
|
484
|
-
pivot?: number;
|
|
485
|
-
pivotX?: number;
|
|
486
|
-
pivotY?: number;
|
|
487
|
-
scale?: number;
|
|
488
|
-
scaleX?: number;
|
|
489
|
-
scaleY?: number;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
type AnimationOptionsCommon = Omit<AnimationOptions$1, "onComplete" | "onPlay" | "onStop" | "onUpdate" | "onRepeat">;
|
|
493
|
-
|
|
494
|
-
type AnimationOptions = AnimationOptionsCommon & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
495
|
-
|
|
496
|
-
type KeyframesType<T> = ObjectTarget<T> & MotionComponentExtension;
|
|
497
|
-
type AnimationSequenceOptions = Omit<AnimationOptions$1, "onComplete" | "onPlay" | "onStop" | "onUpdate" | "onRepeat">;
|
|
498
|
-
type SequenceOptions = SequenceOptions$1 & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
499
|
-
type ObjectSegment<O extends CanvasBaseInterface<any>> = [ObjectTarget<O> & MotionComponentExtension];
|
|
500
|
-
type ObjectSegmentWithTransition<O extends CanvasBaseInterface<any>> = [
|
|
501
|
-
ObjectTarget<O> & MotionComponentExtension,
|
|
502
|
-
AnimationOptions & At
|
|
503
|
-
];
|
|
504
|
-
|
|
505
434
|
type PauseTickerType = {
|
|
506
435
|
/**
|
|
507
436
|
* Ticker ids excluded
|
|
@@ -529,6 +458,9 @@ interface CanvasGameState {
|
|
|
529
458
|
[alias: string]: CanvasBaseItemMemory;
|
|
530
459
|
};
|
|
531
460
|
stage: Partial<ContainerMemory>;
|
|
461
|
+
/**
|
|
462
|
+
* @deprecated
|
|
463
|
+
*/
|
|
532
464
|
elementAliasesOrder: string[];
|
|
533
465
|
/**
|
|
534
466
|
* @deprecated
|
|
@@ -615,9 +547,17 @@ interface CanvasManagerInterface {
|
|
|
615
547
|
* Copy the properties of an old canvas element to a new canvas element.
|
|
616
548
|
* @param oldAlias Old alias
|
|
617
549
|
* @param newAlias New alias
|
|
550
|
+
* @param options The options of the copy.
|
|
618
551
|
* @returns
|
|
619
552
|
*/
|
|
620
|
-
copyCanvasElementProperty<T extends CanvasBaseItemMemory>(oldAlias: T | CanvasBaseInterface<T> | string, newAlias: CanvasBaseInterface<T> | string
|
|
553
|
+
copyCanvasElementProperty<T extends CanvasBaseItemMemory>(oldAlias: T | CanvasBaseInterface<T> | string, newAlias: CanvasBaseInterface<T> | string, options?: {
|
|
554
|
+
/**
|
|
555
|
+
* If provided, the properties returned by this function will not be copied from the old canvas element to the new canvas element.
|
|
556
|
+
* @param defaultProperties The default properties that will be ignored.
|
|
557
|
+
* @returns The properties that will be ignored.
|
|
558
|
+
*/
|
|
559
|
+
ignoreProperties?: (defaultProperties: string[]) => string[];
|
|
560
|
+
}): Promise<void>;
|
|
621
561
|
/**
|
|
622
562
|
* Transfer the tickers from an old alias to a new alias.
|
|
623
563
|
* @param oldAlias Old alias
|
|
@@ -1395,6 +1335,7 @@ declare class VideoSprite extends ImageSprite<VideoSpriteMemory> {
|
|
|
1395
1335
|
*/
|
|
1396
1336
|
interface ContainerMemory<C extends ContainerChild = ContainerChild> extends ContainerOptions$1<C>, CanvasBaseItemMemory, ListenerExtensionMemory, AdditionalPositionsExtensionProps {
|
|
1397
1337
|
elements: CanvasBaseItemMemory[];
|
|
1338
|
+
index?: number;
|
|
1398
1339
|
}
|
|
1399
1340
|
|
|
1400
1341
|
/**
|
|
@@ -2045,7 +1986,7 @@ declare function showImageContainer(alias: string, imageUrls: string[], options?
|
|
|
2045
1986
|
/**
|
|
2046
1987
|
* Add a image in the canvas.
|
|
2047
1988
|
* Is the same that {@link showImage}, but the image is not shown.
|
|
2048
|
-
* If you want to show the image, then you need to use the function {@link ImageSprite.load
|
|
1989
|
+
* If you want to show the image, then you need to use the function {@link ImageSprite.load}.
|
|
2049
1990
|
* @param alias is the unique alias of the image. You can use this alias to refer to this image
|
|
2050
1991
|
* @param imageUrl is the url of the image. If you don't provide the url, then the alias is used as the url.
|
|
2051
1992
|
* @param options The options of the image.
|
|
@@ -2157,4 +2098,4 @@ declare const UPDATE_PRIORITY: typeof _drincs_pixi_vn_pixi_js.UPDATE_PRIORITY;
|
|
|
2157
2098
|
|
|
2158
2099
|
declare const canvas: CanvasManagerInterface;
|
|
2159
2100
|
|
|
2160
|
-
export { type AdditionalPositionsExtension, type AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type
|
|
2101
|
+
export { type AdditionalPositionsExtension, type AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type AssetMemory, Assets, type CanvasBaseInterface, CanvasBaseItem, type CanvasBaseItemMemory, type CanvasGameState, type CanvasManagerInterface, CanvasManagerStatic, CanvasPropertyUtility, Color, type CommonTickerProps, Container, type ContainerChild, type ContainerMemory, type ContainerOptions, ImageContainer, type ImageContainerMemory, type ImageContainerOptions, ImageSprite, type ImageSpriteMemory, type ImageSpriteOptions, type Layer, type ListenerExtension, type ListenerExtensionMemory, type MoveInOutProps, type OnEventsHandlers, type PauseType, type PushInOutProps, Rectangle, RegisteredCanvasComponents, RegisteredEvents, RegisteredTickers, type RepeatType, type ShakeEffectProps, type ShowWithDissolveTransitionProps, type ShowWithFadeTransitionProps, Sprite, type SpriteBaseMemory, type SpriteMemory, type SpriteOptions, Text, type TextMemory, type TextOptions, TextStyle, Texture, type Ticker, type TickerArgs, TickerBase, type TickerHistory, type TickerInfo, type TickerProgrationExponential, type TickerProgrationLinear, type TickerProgrationType, type TickerTimeoutHistory, type TickersSequence, UPDATE_PRIORITY, VideoSprite, type VideoSpriteMemory, type VideoSpriteOptions, type ZoomInOutProps, addImage, addImageCointainer, addListenerHandler, addVideo, analizePositionsExtensionProps, canvas, canvasComponentDecorator, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, tickerDecorator, zoomIn, zoomOut };
|
package/dist/canvas.d.ts
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
import * as _drincs_pixi_vn_pixi_js from '@drincs/pixi-vn/pixi.js';
|
|
2
2
|
import _drincs_pixi_vn_pixi_js__default, { Container as Container$1, ContainerChild as ContainerChild$1, Ticker as Ticker$1, 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 { ObjectTarget, AnimationOptions as AnimationOptions$1, At, SequenceOptions as SequenceOptions$1 } from 'motion';
|
|
5
|
+
export { AnimationOptions as MotionAnimationOptions } from 'motion';
|
|
4
6
|
import { Devtools } from '@pixi/devtools';
|
|
5
|
-
import { AnimationOptions as AnimationOptions$1, At, ObjectTarget, AnimationPlaybackControlsWithThen, ObjectSegment as ObjectSegment$1, SequenceOptions as SequenceOptions$1 } from 'motion';
|
|
6
|
-
export { At, AnimationOptions as MotionAnimationOptions } from 'motion';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface MotionComponentExtension {
|
|
9
|
+
pivot?: number;
|
|
10
|
+
pivotX?: number;
|
|
11
|
+
pivotY?: number;
|
|
12
|
+
scale?: number;
|
|
13
|
+
scaleX?: number;
|
|
14
|
+
scaleY?: number;
|
|
15
|
+
}
|
|
9
16
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
type
|
|
17
|
+
type AnimationOptionsCommon = Omit<AnimationOptions$1, "onComplete" | "onPlay" | "onStop" | "onUpdate" | "onRepeat">;
|
|
18
|
+
|
|
19
|
+
type AnimationOptions = AnimationOptionsCommon & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
20
|
+
|
|
21
|
+
type KeyframesType<T> = ObjectTarget<T> & MotionComponentExtension;
|
|
22
|
+
type SequenceOptions = SequenceOptions$1 & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
23
|
+
type ObjectSegment<O extends CanvasBaseInterface<any>> = [ObjectTarget<O> & MotionComponentExtension];
|
|
24
|
+
type ObjectSegmentWithTransition<O extends CanvasBaseInterface<any>> = [
|
|
25
|
+
ObjectTarget<O> & MotionComponentExtension,
|
|
26
|
+
AnimationOptions & At
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
type Layer = Container$1<ContainerChild$1>;
|
|
15
30
|
|
|
16
31
|
interface TickerArgs {
|
|
17
32
|
}
|
|
@@ -74,7 +89,7 @@ declare abstract class TickerBase<TArgs extends TickerArgs> implements Ticker<TA
|
|
|
74
89
|
*/
|
|
75
90
|
canvasElementAliases?: string[];
|
|
76
91
|
});
|
|
77
|
-
readonly alias:
|
|
92
|
+
readonly alias: string;
|
|
78
93
|
readonly id: string;
|
|
79
94
|
args: TArgs;
|
|
80
95
|
duration?: number;
|
|
@@ -118,7 +133,7 @@ interface Ticker<TArgs extends TickerArgs> {
|
|
|
118
133
|
/**
|
|
119
134
|
* Get the alias of the ticker class. This variable is used in the system to get the ticker class by id, {@link RegisteredTickers.getInstance}
|
|
120
135
|
*/
|
|
121
|
-
readonly alias:
|
|
136
|
+
readonly alias: string;
|
|
122
137
|
/**
|
|
123
138
|
* The id of the ticker. Must be unique for each ticker instance.
|
|
124
139
|
*/
|
|
@@ -163,7 +178,7 @@ interface Ticker<TArgs extends TickerArgs> {
|
|
|
163
178
|
* @param name is th identifier of the label, by default is the name of the class
|
|
164
179
|
* @returns
|
|
165
180
|
*/
|
|
166
|
-
declare function tickerDecorator(name?:
|
|
181
|
+
declare function tickerDecorator(name?: string): (target: {
|
|
167
182
|
new (args: any, options?: {
|
|
168
183
|
duration?: number;
|
|
169
184
|
priority?: UPDATE_PRIORITY$1;
|
|
@@ -184,13 +199,13 @@ declare namespace RegisteredTickers {
|
|
|
184
199
|
id?: string;
|
|
185
200
|
canvasElementAliases?: string[];
|
|
186
201
|
}): Ticker<any>;
|
|
187
|
-
}, name?:
|
|
202
|
+
}, name?: string): void;
|
|
188
203
|
/**
|
|
189
204
|
* Get a ticker by the id.
|
|
190
205
|
* @param canvasId The id of the ticker.
|
|
191
206
|
* @returns The ticker type.
|
|
192
207
|
*/
|
|
193
|
-
function get<T = Ticker<any>>(tickerId:
|
|
208
|
+
function get<T = Ticker<any>>(tickerId: string): T | undefined;
|
|
194
209
|
/**
|
|
195
210
|
* Get a ticker instance by the id.
|
|
196
211
|
* @param tickerId The id of the ticker.
|
|
@@ -199,7 +214,7 @@ declare namespace RegisteredTickers {
|
|
|
199
214
|
* @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
|
|
200
215
|
* @returns The instance of the ticker
|
|
201
216
|
*/
|
|
202
|
-
function getInstance<TArgs extends TickerArgs>(tickerId:
|
|
217
|
+
function getInstance<TArgs extends TickerArgs>(tickerId: string, args: TArgs, options?: {
|
|
203
218
|
duration?: number;
|
|
204
219
|
priority?: UPDATE_PRIORITY$1;
|
|
205
220
|
id?: string;
|
|
@@ -230,71 +245,6 @@ declare namespace RegisteredTickers {
|
|
|
230
245
|
function keys(): string[];
|
|
231
246
|
}
|
|
232
247
|
|
|
233
|
-
type SegmentOptions = AnimationOptions$1 & At;
|
|
234
|
-
type ObjectSegmentWithTransition$1<O extends {} = {}> = [O, ObjectTarget<O>, SegmentOptions];
|
|
235
|
-
/**
|
|
236
|
-
* Create a motion driver that integrates with the PixiJS ticker. This driver will allow you to use motion's animation capabilities while ensuring that animations are synchronized with the PixiJS rendering loop.
|
|
237
|
-
* @param ticker - The PixiJS ticker to integrate with. If not provided, a new ticker will be created.
|
|
238
|
-
* @returns An object that implements the motion driver interface, allowing you to start, stop, and control animations using the PixiJS ticker.
|
|
239
|
-
* @example
|
|
240
|
-
* const ticker = new PIXI.Ticker();
|
|
241
|
-
* const driver = motionDriver(ticker);
|
|
242
|
-
* const animation = animate(mySprite, { x: 100 }, { duration: 1, driver });
|
|
243
|
-
* animation.start();
|
|
244
|
-
*/
|
|
245
|
-
declare const motionDriver: (ticker: Ticker$1) => AnimationOptions$1["driver"];
|
|
246
|
-
/**
|
|
247
|
-
* Animate a PixiJS component or components using [motion's animate](https://motion.dev/docs/animate) function.
|
|
248
|
-
* This function integrates with the PixiJS ticker to ensure smooth animations.
|
|
249
|
-
*
|
|
250
|
-
* Pixi’VN will **not** keep track of the animation state of this function (This feature is intended for animating PixiJS components used for UI.).
|
|
251
|
-
* If you want Pixi'VN to save the animation state in saves, use the {@link canvas.animate} function instead.
|
|
252
|
-
* @param components - The PixiJS component(s) to animate.
|
|
253
|
-
* @param keyframes - The keyframes to animate the component(s) with.
|
|
254
|
-
* @param options - Additional options for the animation, including duration, easing, and ticker.
|
|
255
|
-
* @returns An animation playback control object that can be used to start, stop, or control the animation.
|
|
256
|
-
* @template T - The type of PixiJS component(s) being animated.
|
|
257
|
-
*/
|
|
258
|
-
declare function animate<T extends {}>(components: T | T[], keyframes: ObjectTarget<T>, options?: AnimationOptions$1 & {
|
|
259
|
-
ticker?: Ticker$1;
|
|
260
|
-
}): AnimationPlaybackControlsWithThen;
|
|
261
|
-
/**
|
|
262
|
-
* Animate a sequence of PixiJS components with transitions using [motion's animate](https://motion.dev/docs/animate) function.
|
|
263
|
-
* This function allows for complex animations involving multiple components and transitions.
|
|
264
|
-
* It integrates with the PixiJS ticker to ensure smooth animations.
|
|
265
|
-
* This function is intended for animating PixiJS components used for UI.
|
|
266
|
-
*
|
|
267
|
-
* Pixi’VN will **not** keep track of the animation state of this function (This feature is intended for animating PixiJS components used for UI.).
|
|
268
|
-
* If you want Pixi'VN to save the animation state in saves, use the {@link canvas.animate} function instead
|
|
269
|
-
*
|
|
270
|
-
* @param sequence An array of segments to animate, where each segment is an array containing:
|
|
271
|
-
* - The PixiJS component to animate.
|
|
272
|
-
* - The keyframes to animate the component with.
|
|
273
|
-
* - An options object that can include animation options and a ticker.
|
|
274
|
-
* @param options Additional options for the sequence, such as duration and repeat count.
|
|
275
|
-
* @returns An animation playback control object that can be used to start, stop, or control the animation.
|
|
276
|
-
* @template T - The type of PixiJS component(s) being animated.
|
|
277
|
-
*/
|
|
278
|
-
declare function animate<T extends {}>(sequence: (ObjectSegment$1<T> | ObjectSegmentWithTransition$1<T>)[], options?: SequenceOptions$1 & {
|
|
279
|
-
ticker?: Ticker$1;
|
|
280
|
-
driver?: any;
|
|
281
|
-
}): AnimationPlaybackControlsWithThen;
|
|
282
|
-
/**
|
|
283
|
-
* Create a timeline for running a sequence of functions with transitions. Each function will be called with the provided arguments and will run for the specified duration.
|
|
284
|
-
* @example
|
|
285
|
-
* timeline([
|
|
286
|
-
* { duration: 10, onComplete: () => console.log("First step completed") },
|
|
287
|
-
* { duration: 5, onComplete: () => console.log("Second step completed") },
|
|
288
|
-
* ]);
|
|
289
|
-
* @param times
|
|
290
|
-
* @param options
|
|
291
|
-
* @returns
|
|
292
|
-
*/
|
|
293
|
-
declare function timeline(times: SegmentOptions[], options?: SequenceOptions$1 & {
|
|
294
|
-
ticker?: Ticker$1;
|
|
295
|
-
driver?: any;
|
|
296
|
-
}): AnimationPlaybackControlsWithThen;
|
|
297
|
-
|
|
298
248
|
/**
|
|
299
249
|
* TickerHistory is a class that contains the name of a class and the arguments that were used to create it.
|
|
300
250
|
*/
|
|
@@ -309,7 +259,7 @@ interface TickerInfo<TArgs extends TickerArgs> {
|
|
|
309
259
|
ticker: Ticker<TArgs>;
|
|
310
260
|
}
|
|
311
261
|
interface TickerHistory<TArgs extends TickerArgs> {
|
|
312
|
-
id:
|
|
262
|
+
id: string;
|
|
313
263
|
args: TArgs;
|
|
314
264
|
/**
|
|
315
265
|
* The aliases of the canvas elements that are connected to this ticker
|
|
@@ -475,33 +425,12 @@ declare class CanvasBaseItem<T2 extends CanvasBaseItemMemory> {
|
|
|
475
425
|
*/
|
|
476
426
|
interface CanvasBaseItemMemory {
|
|
477
427
|
pixivnId: string;
|
|
428
|
+
zIndex?: number;
|
|
478
429
|
}
|
|
479
430
|
|
|
480
431
|
interface CanvasBaseInterface<T2 extends CanvasBaseItemMemory> extends CanvasBaseItem<T2>, Container$1 {
|
|
481
432
|
}
|
|
482
433
|
|
|
483
|
-
interface MotionComponentExtension {
|
|
484
|
-
pivot?: number;
|
|
485
|
-
pivotX?: number;
|
|
486
|
-
pivotY?: number;
|
|
487
|
-
scale?: number;
|
|
488
|
-
scaleX?: number;
|
|
489
|
-
scaleY?: number;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
type AnimationOptionsCommon = Omit<AnimationOptions$1, "onComplete" | "onPlay" | "onStop" | "onUpdate" | "onRepeat">;
|
|
493
|
-
|
|
494
|
-
type AnimationOptions = AnimationOptionsCommon & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
495
|
-
|
|
496
|
-
type KeyframesType<T> = ObjectTarget<T> & MotionComponentExtension;
|
|
497
|
-
type AnimationSequenceOptions = Omit<AnimationOptions$1, "onComplete" | "onPlay" | "onStop" | "onUpdate" | "onRepeat">;
|
|
498
|
-
type SequenceOptions = SequenceOptions$1 & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
499
|
-
type ObjectSegment<O extends CanvasBaseInterface<any>> = [ObjectTarget<O> & MotionComponentExtension];
|
|
500
|
-
type ObjectSegmentWithTransition<O extends CanvasBaseInterface<any>> = [
|
|
501
|
-
ObjectTarget<O> & MotionComponentExtension,
|
|
502
|
-
AnimationOptions & At
|
|
503
|
-
];
|
|
504
|
-
|
|
505
434
|
type PauseTickerType = {
|
|
506
435
|
/**
|
|
507
436
|
* Ticker ids excluded
|
|
@@ -529,6 +458,9 @@ interface CanvasGameState {
|
|
|
529
458
|
[alias: string]: CanvasBaseItemMemory;
|
|
530
459
|
};
|
|
531
460
|
stage: Partial<ContainerMemory>;
|
|
461
|
+
/**
|
|
462
|
+
* @deprecated
|
|
463
|
+
*/
|
|
532
464
|
elementAliasesOrder: string[];
|
|
533
465
|
/**
|
|
534
466
|
* @deprecated
|
|
@@ -615,9 +547,17 @@ interface CanvasManagerInterface {
|
|
|
615
547
|
* Copy the properties of an old canvas element to a new canvas element.
|
|
616
548
|
* @param oldAlias Old alias
|
|
617
549
|
* @param newAlias New alias
|
|
550
|
+
* @param options The options of the copy.
|
|
618
551
|
* @returns
|
|
619
552
|
*/
|
|
620
|
-
copyCanvasElementProperty<T extends CanvasBaseItemMemory>(oldAlias: T | CanvasBaseInterface<T> | string, newAlias: CanvasBaseInterface<T> | string
|
|
553
|
+
copyCanvasElementProperty<T extends CanvasBaseItemMemory>(oldAlias: T | CanvasBaseInterface<T> | string, newAlias: CanvasBaseInterface<T> | string, options?: {
|
|
554
|
+
/**
|
|
555
|
+
* If provided, the properties returned by this function will not be copied from the old canvas element to the new canvas element.
|
|
556
|
+
* @param defaultProperties The default properties that will be ignored.
|
|
557
|
+
* @returns The properties that will be ignored.
|
|
558
|
+
*/
|
|
559
|
+
ignoreProperties?: (defaultProperties: string[]) => string[];
|
|
560
|
+
}): Promise<void>;
|
|
621
561
|
/**
|
|
622
562
|
* Transfer the tickers from an old alias to a new alias.
|
|
623
563
|
* @param oldAlias Old alias
|
|
@@ -1395,6 +1335,7 @@ declare class VideoSprite extends ImageSprite<VideoSpriteMemory> {
|
|
|
1395
1335
|
*/
|
|
1396
1336
|
interface ContainerMemory<C extends ContainerChild = ContainerChild> extends ContainerOptions$1<C>, CanvasBaseItemMemory, ListenerExtensionMemory, AdditionalPositionsExtensionProps {
|
|
1397
1337
|
elements: CanvasBaseItemMemory[];
|
|
1338
|
+
index?: number;
|
|
1398
1339
|
}
|
|
1399
1340
|
|
|
1400
1341
|
/**
|
|
@@ -2045,7 +1986,7 @@ declare function showImageContainer(alias: string, imageUrls: string[], options?
|
|
|
2045
1986
|
/**
|
|
2046
1987
|
* Add a image in the canvas.
|
|
2047
1988
|
* Is the same that {@link showImage}, but the image is not shown.
|
|
2048
|
-
* If you want to show the image, then you need to use the function {@link ImageSprite.load
|
|
1989
|
+
* If you want to show the image, then you need to use the function {@link ImageSprite.load}.
|
|
2049
1990
|
* @param alias is the unique alias of the image. You can use this alias to refer to this image
|
|
2050
1991
|
* @param imageUrl is the url of the image. If you don't provide the url, then the alias is used as the url.
|
|
2051
1992
|
* @param options The options of the image.
|
|
@@ -2157,4 +2098,4 @@ declare const UPDATE_PRIORITY: typeof _drincs_pixi_vn_pixi_js.UPDATE_PRIORITY;
|
|
|
2157
2098
|
|
|
2158
2099
|
declare const canvas: CanvasManagerInterface;
|
|
2159
2100
|
|
|
2160
|
-
export { type AdditionalPositionsExtension, type AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type
|
|
2101
|
+
export { type AdditionalPositionsExtension, type AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type AssetMemory, Assets, type CanvasBaseInterface, CanvasBaseItem, type CanvasBaseItemMemory, type CanvasGameState, type CanvasManagerInterface, CanvasManagerStatic, CanvasPropertyUtility, Color, type CommonTickerProps, Container, type ContainerChild, type ContainerMemory, type ContainerOptions, ImageContainer, type ImageContainerMemory, type ImageContainerOptions, ImageSprite, type ImageSpriteMemory, type ImageSpriteOptions, type Layer, type ListenerExtension, type ListenerExtensionMemory, type MoveInOutProps, type OnEventsHandlers, type PauseType, type PushInOutProps, Rectangle, RegisteredCanvasComponents, RegisteredEvents, RegisteredTickers, type RepeatType, type ShakeEffectProps, type ShowWithDissolveTransitionProps, type ShowWithFadeTransitionProps, Sprite, type SpriteBaseMemory, type SpriteMemory, type SpriteOptions, Text, type TextMemory, type TextOptions, TextStyle, Texture, type Ticker, type TickerArgs, TickerBase, type TickerHistory, type TickerInfo, type TickerProgrationExponential, type TickerProgrationLinear, type TickerProgrationType, type TickerTimeoutHistory, type TickersSequence, UPDATE_PRIORITY, VideoSprite, type VideoSpriteMemory, type VideoSpriteOptions, type ZoomInOutProps, addImage, addImageCointainer, addListenerHandler, addVideo, analizePositionsExtensionProps, canvas, canvasComponentDecorator, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, tickerDecorator, zoomIn, zoomOut };
|