@drincs/pixi-vn 1.8.16 → 1.8.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/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +73 -40
- package/dist/canvas.d.ts +73 -40
- package/dist/canvas.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/narration.cjs +1 -1
- package/dist/narration.d.cts +1 -1
- package/dist/narration.d.ts +1 -1
- package/dist/narration.mjs +1 -1
- package/dist/pixi/browser.js +169 -169
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
package/dist/canvas.d.cts
CHANGED
|
@@ -203,7 +203,7 @@ interface TickerTimeoutHistory {
|
|
|
203
203
|
|
|
204
204
|
type CommonTickerProps = {
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
206
|
+
* An array of strings containing the aliases of the canvas components to remove after the animation completes.
|
|
207
207
|
* @default []
|
|
208
208
|
*/
|
|
209
209
|
aliasToRemoveAfter?: string[] | string;
|
|
@@ -213,12 +213,12 @@ type CommonTickerProps = {
|
|
|
213
213
|
*/
|
|
214
214
|
startOnlyIfHaveTexture?: boolean;
|
|
215
215
|
/**
|
|
216
|
-
*
|
|
216
|
+
* If you want to resume tickers that were previously paused, provide the aliases of the canvas components whose tickers should be resumed.
|
|
217
217
|
* @default []
|
|
218
218
|
*/
|
|
219
219
|
tickerAliasToResume?: string[] | string;
|
|
220
220
|
/**
|
|
221
|
-
*
|
|
221
|
+
* A string containing the ticker ID to resume after the animation completes.
|
|
222
222
|
* @default []
|
|
223
223
|
*/
|
|
224
224
|
tickerIdToResume?: string[] | string;
|
|
@@ -227,6 +227,7 @@ type CommonTickerProps = {
|
|
|
227
227
|
*/
|
|
228
228
|
forceCompleteBeforeNext?: boolean;
|
|
229
229
|
/**
|
|
230
|
+
* A boolean indicating whether the animation must complete before the next `step` of the game. If `true`, the game will force the animation to finish before proceeding.
|
|
230
231
|
* When true, calling {@link narration.continue()} forces the current content to complete before advancing to the next narrative step.
|
|
231
232
|
* @default false
|
|
232
233
|
*/
|
|
@@ -326,8 +327,8 @@ interface CanvasManagerInterface {
|
|
|
326
327
|
* Add a canvas element to the canvas.
|
|
327
328
|
* If there is a canvas element with the same alias, all "style", zIndex, and {@link TickerBase} will be transferred to the new canvas element,
|
|
328
329
|
* and the old canvas element will be removed.
|
|
329
|
-
* @param alias The alias
|
|
330
|
-
* @param canvasComponent The
|
|
330
|
+
* @param alias The alias to identify the component.
|
|
331
|
+
* @param canvasComponent The component to add.
|
|
331
332
|
* @param options The options of the canvas element.
|
|
332
333
|
* @example
|
|
333
334
|
* ```ts
|
|
@@ -368,8 +369,8 @@ interface CanvasManagerInterface {
|
|
|
368
369
|
}): void;
|
|
369
370
|
/**
|
|
370
371
|
* Get a canvas element by the alias.
|
|
371
|
-
* @param alias The alias
|
|
372
|
-
* @returns The canvas element.
|
|
372
|
+
* @param alias The alias to identify the component.
|
|
373
|
+
* @returns The canvas element. If the component does not exist, it will return `undefined`.
|
|
373
374
|
* @example
|
|
374
375
|
* ```ts
|
|
375
376
|
* const sprite = canvas.find<Sprite>("bunny");
|
|
@@ -388,8 +389,8 @@ interface CanvasManagerInterface {
|
|
|
388
389
|
removeAll(): void;
|
|
389
390
|
/**
|
|
390
391
|
* Edit the alias of a canvas element. The tickers that are connected to the canvas element will be transferred.
|
|
391
|
-
* @param oldAlias The old alias of the
|
|
392
|
-
* @param newAlias The new alias of the
|
|
392
|
+
* @param oldAlias The old alias of the component to edit.
|
|
393
|
+
* @param newAlias The new alias of the component.
|
|
393
394
|
* @param options The options of the canvas element.
|
|
394
395
|
*/
|
|
395
396
|
editAlias(oldAlias: string, newAlias: string, options?: {
|
|
@@ -552,12 +553,12 @@ interface CanvasManagerInterface {
|
|
|
552
553
|
*
|
|
553
554
|
* Pixi’VN will keep track of the animation state of this function.
|
|
554
555
|
* So Pixi’VN will save the animation state in saves.
|
|
555
|
-
* @param components
|
|
556
|
-
* @param keyframes
|
|
557
|
-
* @param options
|
|
558
|
-
* @param priority
|
|
559
|
-
* @returns The
|
|
560
|
-
* @template T
|
|
556
|
+
* @param components The PixiJS component(s) to animate. This can be a single component, an array of components, or a string representing the component's alias.
|
|
557
|
+
* @param keyframes This is an object containing the properties to animate and the values to reach.
|
|
558
|
+
* @param options [`motion` options](https://motion.dev/docs/animate#options) for the animation, including duration, `easing`, and ticker.
|
|
559
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority. @default UPDATE_PRIORITY.NORMAL
|
|
560
|
+
* @returns The function returns the ID of the ticker created to animate the component(s).
|
|
561
|
+
* @template T The type of Pixi’VN component(s) being animated.
|
|
561
562
|
*/
|
|
562
563
|
animate<T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: KeyframesType<T>, options?: AnimationOptions, priority?: UPDATE_PRIORITY$1): string | undefined;
|
|
563
564
|
/**
|
|
@@ -566,12 +567,12 @@ interface CanvasManagerInterface {
|
|
|
566
567
|
*
|
|
567
568
|
* Pixi’VN will keep track of the animation state of this function.
|
|
568
569
|
* So Pixi’VN will save the animation state in saves.
|
|
569
|
-
* @param components
|
|
570
|
-
* @param sequence
|
|
571
|
-
* @param options
|
|
572
|
-
* @param priority
|
|
573
|
-
* @returns The
|
|
574
|
-
* @template T
|
|
570
|
+
* @param components The PixiJS component(s) to animate. This can be a single component, an array of components, or a string representing the component's alias.
|
|
571
|
+
* @param sequence The sequence of keyframes to animate the component(s) with.
|
|
572
|
+
* @param options [`motion` options](https://motion.dev/docs/animate#options) for the animation, including duration, `easing`, and ticker.
|
|
573
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority. @default UPDATE_PRIORITY.NORMAL
|
|
574
|
+
* @returns The function returns the ID of the ticker created to animate the component(s).
|
|
575
|
+
* @template T The type of Pixi’VN component(s) being animated.
|
|
575
576
|
*/
|
|
576
577
|
animate<T extends CanvasBaseInterface<any>>(components: T | string, sequence: (ObjectSegment<T> | ObjectSegmentWithTransition<T>)[], options?: SequenceOptions, priority?: UPDATE_PRIORITY$1): string | undefined;
|
|
577
578
|
/**
|
|
@@ -746,6 +747,9 @@ interface SpriteMemory extends SpriteBaseMemory {
|
|
|
746
747
|
* ```
|
|
747
748
|
*/
|
|
748
749
|
declare class Sprite<Memory extends SpriteOptions$1 & CanvasBaseItemMemory = SpriteMemory> extends _drincs_pixi_vn_pixi_js__default.Sprite implements CanvasBaseItem<Memory | SpriteMemory>, ListenerExtension, AdditionalPositionsExtension {
|
|
750
|
+
/**
|
|
751
|
+
* @param options The options for the component.
|
|
752
|
+
*/
|
|
749
753
|
constructor(options?: SpriteOptions | Texture$1);
|
|
750
754
|
readonly pixivnId: string;
|
|
751
755
|
get memory(): Memory | SpriteMemory;
|
|
@@ -836,6 +840,10 @@ declare class ImageSprite<Memory extends ImageSpriteMemory = ImageSpriteMemory>
|
|
|
836
840
|
private _textureAlias?;
|
|
837
841
|
protected get textureAlias(): string;
|
|
838
842
|
readonly pixivnId: string;
|
|
843
|
+
/**
|
|
844
|
+
* @param options The options for the component.
|
|
845
|
+
* @param textureAlias The URL or path. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
846
|
+
*/
|
|
839
847
|
constructor(options?: ImageSpriteOptions | Omit<Texture$1, "on"> | undefined, textureAlias?: string);
|
|
840
848
|
get memory(): ImageSpriteMemory;
|
|
841
849
|
setMemory(memory: Memory | SpriteMemory): Promise<void>;
|
|
@@ -887,6 +895,10 @@ interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
|
887
895
|
* ```
|
|
888
896
|
*/
|
|
889
897
|
declare class VideoSprite extends ImageSprite<VideoSpriteMemory> {
|
|
898
|
+
/**
|
|
899
|
+
* @param options The options for the component.
|
|
900
|
+
* @param textureAlias The URL or path. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
901
|
+
*/
|
|
890
902
|
constructor(options?: VideoSpriteOptions | Texture$1 | undefined, textureAlias?: string);
|
|
891
903
|
readonly pixivnId: string;
|
|
892
904
|
get memory(): VideoSpriteMemory;
|
|
@@ -1031,6 +1043,10 @@ interface ImageContainerMemory extends ContainerMemory<ImageSprite> {
|
|
|
1031
1043
|
* ```
|
|
1032
1044
|
*/
|
|
1033
1045
|
declare class ImageContainer extends Container<ImageSprite, ImageContainerMemory> {
|
|
1046
|
+
/**
|
|
1047
|
+
* @param options The options for the component.
|
|
1048
|
+
* @param textureAliases An array of image URLs or paths. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
1049
|
+
*/
|
|
1034
1050
|
constructor(options?: ImageContainerOptions<ImageSprite>, textureAliases?: string[]);
|
|
1035
1051
|
get memory(): ImageContainerMemory;
|
|
1036
1052
|
setMemory(value: ImageContainerMemory): Promise<void>;
|
|
@@ -1208,10 +1224,27 @@ type CanvasElementAliasType = string;
|
|
|
1208
1224
|
* Is a decorator that register a canvas component in the game.
|
|
1209
1225
|
* @param options Options for the canvas component.
|
|
1210
1226
|
* @returns
|
|
1227
|
+
* @example
|
|
1228
|
+
* ```ts title="canvas/components/AlienTinting.ts"
|
|
1229
|
+
* const ALIEN_TINTING_TEST_ID = "AlienTintingTest";
|
|
1230
|
+
* @canvasComponentDecorator({
|
|
1231
|
+
* name: ALIEN_TINTING_TEST_ID,
|
|
1232
|
+
* })
|
|
1233
|
+
* class AlienTintingTest extends Sprite<IAlienTintingMemory> {
|
|
1234
|
+
* readonly pixivnId: string = CANVAS_SPINE_ID;
|
|
1235
|
+
* override get memory() {
|
|
1236
|
+
* // ...
|
|
1237
|
+
* }
|
|
1238
|
+
* override async setMemory(memory: IAlienTintingMemory) {
|
|
1239
|
+
* // ...
|
|
1240
|
+
* }
|
|
1241
|
+
* // ...
|
|
1242
|
+
* }
|
|
1243
|
+
* ```
|
|
1211
1244
|
*/
|
|
1212
1245
|
declare function canvasComponentDecorator<M extends CanvasBaseItemMemory, T extends typeof CanvasBaseItem<M>>(options?: {
|
|
1213
1246
|
/**
|
|
1214
|
-
*
|
|
1247
|
+
* The id used by Pixi’VN to refer to this class (must be unique). If you don't pass the id, the class name will be used as the id.
|
|
1215
1248
|
* @default target.name
|
|
1216
1249
|
*/
|
|
1217
1250
|
name?: CanvasElementAliasType;
|
|
@@ -1307,7 +1340,7 @@ type SerializableEventHandler = (...args: never[]) => unknown;
|
|
|
1307
1340
|
*
|
|
1308
1341
|
* sprite.on("pointerdown", Events.eventExample);
|
|
1309
1342
|
* ```
|
|
1310
|
-
* @param name
|
|
1343
|
+
* @param name The id used by Pixi’VN to refer to this function (must be unique). If you don't pass the id, the function name will be used as the id.
|
|
1311
1344
|
* @returns
|
|
1312
1345
|
*/
|
|
1313
1346
|
declare function eventDecorator(name?: string): (_target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
@@ -1345,9 +1378,9 @@ declare namespace RegisteredEvents {
|
|
|
1345
1378
|
/**
|
|
1346
1379
|
* Shake the canvas element.
|
|
1347
1380
|
* If there is a/more ticker(s) with the same alias, then the ticker(s) is/are paused.
|
|
1348
|
-
* @param alias
|
|
1349
|
-
* @param options
|
|
1350
|
-
* @param priority
|
|
1381
|
+
* @param alias The alias to identify the component.
|
|
1382
|
+
* @param options Animation options, matching the `options` of animate function.
|
|
1383
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority.
|
|
1351
1384
|
* @returns
|
|
1352
1385
|
*/
|
|
1353
1386
|
declare function shakeEffect(alias: string, options?: ShakeEffectProps, priority?: UPDATE_PRIORITY$1): Promise<string[] | undefined>;
|
|
@@ -1552,11 +1585,11 @@ declare function drawCanvasErrorHandler(): OnErrorHandler;
|
|
|
1552
1585
|
/**
|
|
1553
1586
|
* Add a list of images in the container, after that, the images are added to the canvas.
|
|
1554
1587
|
* Is the same that {@link showImageContainer}, but the image is not shown.
|
|
1555
|
-
* If you want to show the
|
|
1556
|
-
* @param alias is the unique alias of the
|
|
1588
|
+
* If you want to show the container, then you need to use the function {@link ImageSprite.load()}.
|
|
1589
|
+
* @param alias is the unique alias of the container. You can use this alias to refer to this container
|
|
1557
1590
|
* @param imageUrls is the url of the image. If you don't provide the url, then the alias is used as the url.
|
|
1558
|
-
* @param options The options of the
|
|
1559
|
-
* @returns
|
|
1591
|
+
* @param options The options of the container.
|
|
1592
|
+
* @returns This function returns an {@link ImageContainer} that you can use to manipulate the component.
|
|
1560
1593
|
* @example
|
|
1561
1594
|
* ```ts
|
|
1562
1595
|
* let bunny = addImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
@@ -1566,10 +1599,10 @@ declare function drawCanvasErrorHandler(): OnErrorHandler;
|
|
|
1566
1599
|
declare function addImageCointainer(alias: string, imageUrls: string[], options?: ImageContainerOptions<ImageSprite>): ImageContainer;
|
|
1567
1600
|
/**
|
|
1568
1601
|
* Add a list of images in the container, after that, the images are added and shown in the canvas.
|
|
1569
|
-
* @param alias The unique alias of the
|
|
1602
|
+
* @param alias The unique alias of the container. You can use this alias to refer to this container
|
|
1570
1603
|
* @param imageUrls The url of the image.
|
|
1571
|
-
* @param options The options of the
|
|
1572
|
-
* @returns
|
|
1604
|
+
* @param options The options of the container.
|
|
1605
|
+
* @returns This function returns an {@link ImageContainer} that you can use to manipulate the component.
|
|
1573
1606
|
* @example
|
|
1574
1607
|
* ```ts
|
|
1575
1608
|
* let bunny = showImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
@@ -1582,9 +1615,9 @@ declare function showImageContainer(alias: string, imageUrls: string[], options?
|
|
|
1582
1615
|
* Is the same that {@link showImage}, but the image is not shown.
|
|
1583
1616
|
* If you want to show the image, then you need to use the function {@link ImageSprite.load}.
|
|
1584
1617
|
* @param alias is the unique alias of the image. You can use this alias to refer to this image
|
|
1585
|
-
* @param imageUrl
|
|
1618
|
+
* @param imageUrl The url of the image. If you have initialized the "asset matrix", you can use the alias of the texture. If you don't provide the URL, then the alias is used as the URL.
|
|
1586
1619
|
* @param options The options of the image.
|
|
1587
|
-
* @returns
|
|
1620
|
+
* @returns This function returns an {@link ImageSprite} that you can use to manipulate the component.
|
|
1588
1621
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1589
1622
|
* @example
|
|
1590
1623
|
* ```ts
|
|
@@ -1599,9 +1632,9 @@ declare function addImage(alias: string, imageUrl?: string, options?: ImageSprit
|
|
|
1599
1632
|
/**
|
|
1600
1633
|
* Add and show a image in the canvas. This function is a combination of {@link addImage}.
|
|
1601
1634
|
* @param alias The unique alias of the image. You can use this alias to refer to this image
|
|
1602
|
-
* @param imageUrl The url of the image.
|
|
1635
|
+
* @param imageUrl The url of the image. If you have initialized the "asset matrix", you can use the alias of the texture. If you don't provide the URL, then the alias is used as the URL.
|
|
1603
1636
|
* @param options The options of the image.
|
|
1604
|
-
* @returns
|
|
1637
|
+
* @returns This function returns an {@link ImageSprite} that you can use to manipulate the component.
|
|
1605
1638
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1606
1639
|
* @example
|
|
1607
1640
|
* ```ts
|
|
@@ -1617,7 +1650,7 @@ declare function showImage(alias: string, imageUrl?: string, options?: ImageSpri
|
|
|
1617
1650
|
* @param alias The unique alias of the text. You can use this alias to refer to this text.
|
|
1618
1651
|
* @param text
|
|
1619
1652
|
* @param options The options of the text.
|
|
1620
|
-
* @returns
|
|
1653
|
+
* @returns This function returns an {@link Text} that you can use to manipulate the component.
|
|
1621
1654
|
* @example
|
|
1622
1655
|
* ```ts
|
|
1623
1656
|
* let text = showText("text", "Hello World", { fontSize: 24, fill: "white" })
|
|
@@ -1640,7 +1673,7 @@ declare function getTexture(textureAlias?: string): Promise<Texture$1 | undefine
|
|
|
1640
1673
|
* @param alias is the unique alias of the video. You can use this alias to refer to this video
|
|
1641
1674
|
* @param videoUrl is the url of the video. If you don't provide the url, then the alias is used as the url.
|
|
1642
1675
|
* @param options The options of the video.
|
|
1643
|
-
* @returns
|
|
1676
|
+
* @returns This function returns an {@link VideoSprite} that you can use to manipulate the component.
|
|
1644
1677
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1645
1678
|
* @example
|
|
1646
1679
|
* ```ts
|
|
@@ -1657,7 +1690,7 @@ declare function addVideo(alias: string, videoUrl?: string, options?: VideoSprit
|
|
|
1657
1690
|
* @param alias The unique alias of the video. You can use this alias to refer to this video
|
|
1658
1691
|
* @param videoUrl The url of the video.
|
|
1659
1692
|
* @param options The options of the video.
|
|
1660
|
-
* @returns
|
|
1693
|
+
* @returns This function returns an {@link VideoSprite} that you can use to manipulate the component.
|
|
1661
1694
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1662
1695
|
* @example
|
|
1663
1696
|
* ```ts
|
package/dist/canvas.d.ts
CHANGED
|
@@ -203,7 +203,7 @@ interface TickerTimeoutHistory {
|
|
|
203
203
|
|
|
204
204
|
type CommonTickerProps = {
|
|
205
205
|
/**
|
|
206
|
-
*
|
|
206
|
+
* An array of strings containing the aliases of the canvas components to remove after the animation completes.
|
|
207
207
|
* @default []
|
|
208
208
|
*/
|
|
209
209
|
aliasToRemoveAfter?: string[] | string;
|
|
@@ -213,12 +213,12 @@ type CommonTickerProps = {
|
|
|
213
213
|
*/
|
|
214
214
|
startOnlyIfHaveTexture?: boolean;
|
|
215
215
|
/**
|
|
216
|
-
*
|
|
216
|
+
* If you want to resume tickers that were previously paused, provide the aliases of the canvas components whose tickers should be resumed.
|
|
217
217
|
* @default []
|
|
218
218
|
*/
|
|
219
219
|
tickerAliasToResume?: string[] | string;
|
|
220
220
|
/**
|
|
221
|
-
*
|
|
221
|
+
* A string containing the ticker ID to resume after the animation completes.
|
|
222
222
|
* @default []
|
|
223
223
|
*/
|
|
224
224
|
tickerIdToResume?: string[] | string;
|
|
@@ -227,6 +227,7 @@ type CommonTickerProps = {
|
|
|
227
227
|
*/
|
|
228
228
|
forceCompleteBeforeNext?: boolean;
|
|
229
229
|
/**
|
|
230
|
+
* A boolean indicating whether the animation must complete before the next `step` of the game. If `true`, the game will force the animation to finish before proceeding.
|
|
230
231
|
* When true, calling {@link narration.continue()} forces the current content to complete before advancing to the next narrative step.
|
|
231
232
|
* @default false
|
|
232
233
|
*/
|
|
@@ -326,8 +327,8 @@ interface CanvasManagerInterface {
|
|
|
326
327
|
* Add a canvas element to the canvas.
|
|
327
328
|
* If there is a canvas element with the same alias, all "style", zIndex, and {@link TickerBase} will be transferred to the new canvas element,
|
|
328
329
|
* and the old canvas element will be removed.
|
|
329
|
-
* @param alias The alias
|
|
330
|
-
* @param canvasComponent The
|
|
330
|
+
* @param alias The alias to identify the component.
|
|
331
|
+
* @param canvasComponent The component to add.
|
|
331
332
|
* @param options The options of the canvas element.
|
|
332
333
|
* @example
|
|
333
334
|
* ```ts
|
|
@@ -368,8 +369,8 @@ interface CanvasManagerInterface {
|
|
|
368
369
|
}): void;
|
|
369
370
|
/**
|
|
370
371
|
* Get a canvas element by the alias.
|
|
371
|
-
* @param alias The alias
|
|
372
|
-
* @returns The canvas element.
|
|
372
|
+
* @param alias The alias to identify the component.
|
|
373
|
+
* @returns The canvas element. If the component does not exist, it will return `undefined`.
|
|
373
374
|
* @example
|
|
374
375
|
* ```ts
|
|
375
376
|
* const sprite = canvas.find<Sprite>("bunny");
|
|
@@ -388,8 +389,8 @@ interface CanvasManagerInterface {
|
|
|
388
389
|
removeAll(): void;
|
|
389
390
|
/**
|
|
390
391
|
* Edit the alias of a canvas element. The tickers that are connected to the canvas element will be transferred.
|
|
391
|
-
* @param oldAlias The old alias of the
|
|
392
|
-
* @param newAlias The new alias of the
|
|
392
|
+
* @param oldAlias The old alias of the component to edit.
|
|
393
|
+
* @param newAlias The new alias of the component.
|
|
393
394
|
* @param options The options of the canvas element.
|
|
394
395
|
*/
|
|
395
396
|
editAlias(oldAlias: string, newAlias: string, options?: {
|
|
@@ -552,12 +553,12 @@ interface CanvasManagerInterface {
|
|
|
552
553
|
*
|
|
553
554
|
* Pixi’VN will keep track of the animation state of this function.
|
|
554
555
|
* So Pixi’VN will save the animation state in saves.
|
|
555
|
-
* @param components
|
|
556
|
-
* @param keyframes
|
|
557
|
-
* @param options
|
|
558
|
-
* @param priority
|
|
559
|
-
* @returns The
|
|
560
|
-
* @template T
|
|
556
|
+
* @param components The PixiJS component(s) to animate. This can be a single component, an array of components, or a string representing the component's alias.
|
|
557
|
+
* @param keyframes This is an object containing the properties to animate and the values to reach.
|
|
558
|
+
* @param options [`motion` options](https://motion.dev/docs/animate#options) for the animation, including duration, `easing`, and ticker.
|
|
559
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority. @default UPDATE_PRIORITY.NORMAL
|
|
560
|
+
* @returns The function returns the ID of the ticker created to animate the component(s).
|
|
561
|
+
* @template T The type of Pixi’VN component(s) being animated.
|
|
561
562
|
*/
|
|
562
563
|
animate<T extends CanvasBaseInterface<any>>(components: T | string | (string | T)[], keyframes: KeyframesType<T>, options?: AnimationOptions, priority?: UPDATE_PRIORITY$1): string | undefined;
|
|
563
564
|
/**
|
|
@@ -566,12 +567,12 @@ interface CanvasManagerInterface {
|
|
|
566
567
|
*
|
|
567
568
|
* Pixi’VN will keep track of the animation state of this function.
|
|
568
569
|
* So Pixi’VN will save the animation state in saves.
|
|
569
|
-
* @param components
|
|
570
|
-
* @param sequence
|
|
571
|
-
* @param options
|
|
572
|
-
* @param priority
|
|
573
|
-
* @returns The
|
|
574
|
-
* @template T
|
|
570
|
+
* @param components The PixiJS component(s) to animate. This can be a single component, an array of components, or a string representing the component's alias.
|
|
571
|
+
* @param sequence The sequence of keyframes to animate the component(s) with.
|
|
572
|
+
* @param options [`motion` options](https://motion.dev/docs/animate#options) for the animation, including duration, `easing`, and ticker.
|
|
573
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority. @default UPDATE_PRIORITY.NORMAL
|
|
574
|
+
* @returns The function returns the ID of the ticker created to animate the component(s).
|
|
575
|
+
* @template T The type of Pixi’VN component(s) being animated.
|
|
575
576
|
*/
|
|
576
577
|
animate<T extends CanvasBaseInterface<any>>(components: T | string, sequence: (ObjectSegment<T> | ObjectSegmentWithTransition<T>)[], options?: SequenceOptions, priority?: UPDATE_PRIORITY$1): string | undefined;
|
|
577
578
|
/**
|
|
@@ -746,6 +747,9 @@ interface SpriteMemory extends SpriteBaseMemory {
|
|
|
746
747
|
* ```
|
|
747
748
|
*/
|
|
748
749
|
declare class Sprite<Memory extends SpriteOptions$1 & CanvasBaseItemMemory = SpriteMemory> extends _drincs_pixi_vn_pixi_js__default.Sprite implements CanvasBaseItem<Memory | SpriteMemory>, ListenerExtension, AdditionalPositionsExtension {
|
|
750
|
+
/**
|
|
751
|
+
* @param options The options for the component.
|
|
752
|
+
*/
|
|
749
753
|
constructor(options?: SpriteOptions | Texture$1);
|
|
750
754
|
readonly pixivnId: string;
|
|
751
755
|
get memory(): Memory | SpriteMemory;
|
|
@@ -836,6 +840,10 @@ declare class ImageSprite<Memory extends ImageSpriteMemory = ImageSpriteMemory>
|
|
|
836
840
|
private _textureAlias?;
|
|
837
841
|
protected get textureAlias(): string;
|
|
838
842
|
readonly pixivnId: string;
|
|
843
|
+
/**
|
|
844
|
+
* @param options The options for the component.
|
|
845
|
+
* @param textureAlias The URL or path. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
846
|
+
*/
|
|
839
847
|
constructor(options?: ImageSpriteOptions | Omit<Texture$1, "on"> | undefined, textureAlias?: string);
|
|
840
848
|
get memory(): ImageSpriteMemory;
|
|
841
849
|
setMemory(memory: Memory | SpriteMemory): Promise<void>;
|
|
@@ -887,6 +895,10 @@ interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
|
887
895
|
* ```
|
|
888
896
|
*/
|
|
889
897
|
declare class VideoSprite extends ImageSprite<VideoSpriteMemory> {
|
|
898
|
+
/**
|
|
899
|
+
* @param options The options for the component.
|
|
900
|
+
* @param textureAlias The URL or path. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
901
|
+
*/
|
|
890
902
|
constructor(options?: VideoSpriteOptions | Texture$1 | undefined, textureAlias?: string);
|
|
891
903
|
readonly pixivnId: string;
|
|
892
904
|
get memory(): VideoSpriteMemory;
|
|
@@ -1031,6 +1043,10 @@ interface ImageContainerMemory extends ContainerMemory<ImageSprite> {
|
|
|
1031
1043
|
* ```
|
|
1032
1044
|
*/
|
|
1033
1045
|
declare class ImageContainer extends Container<ImageSprite, ImageContainerMemory> {
|
|
1046
|
+
/**
|
|
1047
|
+
* @param options The options for the component.
|
|
1048
|
+
* @param textureAliases An array of image URLs or paths. If you have initialized the "asset matrix", you can use the alias of the texture.
|
|
1049
|
+
*/
|
|
1034
1050
|
constructor(options?: ImageContainerOptions<ImageSprite>, textureAliases?: string[]);
|
|
1035
1051
|
get memory(): ImageContainerMemory;
|
|
1036
1052
|
setMemory(value: ImageContainerMemory): Promise<void>;
|
|
@@ -1208,10 +1224,27 @@ type CanvasElementAliasType = string;
|
|
|
1208
1224
|
* Is a decorator that register a canvas component in the game.
|
|
1209
1225
|
* @param options Options for the canvas component.
|
|
1210
1226
|
* @returns
|
|
1227
|
+
* @example
|
|
1228
|
+
* ```ts title="canvas/components/AlienTinting.ts"
|
|
1229
|
+
* const ALIEN_TINTING_TEST_ID = "AlienTintingTest";
|
|
1230
|
+
* @canvasComponentDecorator({
|
|
1231
|
+
* name: ALIEN_TINTING_TEST_ID,
|
|
1232
|
+
* })
|
|
1233
|
+
* class AlienTintingTest extends Sprite<IAlienTintingMemory> {
|
|
1234
|
+
* readonly pixivnId: string = CANVAS_SPINE_ID;
|
|
1235
|
+
* override get memory() {
|
|
1236
|
+
* // ...
|
|
1237
|
+
* }
|
|
1238
|
+
* override async setMemory(memory: IAlienTintingMemory) {
|
|
1239
|
+
* // ...
|
|
1240
|
+
* }
|
|
1241
|
+
* // ...
|
|
1242
|
+
* }
|
|
1243
|
+
* ```
|
|
1211
1244
|
*/
|
|
1212
1245
|
declare function canvasComponentDecorator<M extends CanvasBaseItemMemory, T extends typeof CanvasBaseItem<M>>(options?: {
|
|
1213
1246
|
/**
|
|
1214
|
-
*
|
|
1247
|
+
* The id used by Pixi’VN to refer to this class (must be unique). If you don't pass the id, the class name will be used as the id.
|
|
1215
1248
|
* @default target.name
|
|
1216
1249
|
*/
|
|
1217
1250
|
name?: CanvasElementAliasType;
|
|
@@ -1307,7 +1340,7 @@ type SerializableEventHandler = (...args: never[]) => unknown;
|
|
|
1307
1340
|
*
|
|
1308
1341
|
* sprite.on("pointerdown", Events.eventExample);
|
|
1309
1342
|
* ```
|
|
1310
|
-
* @param name
|
|
1343
|
+
* @param name The id used by Pixi’VN to refer to this function (must be unique). If you don't pass the id, the function name will be used as the id.
|
|
1311
1344
|
* @returns
|
|
1312
1345
|
*/
|
|
1313
1346
|
declare function eventDecorator(name?: string): (_target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
@@ -1345,9 +1378,9 @@ declare namespace RegisteredEvents {
|
|
|
1345
1378
|
/**
|
|
1346
1379
|
* Shake the canvas element.
|
|
1347
1380
|
* If there is a/more ticker(s) with the same alias, then the ticker(s) is/are paused.
|
|
1348
|
-
* @param alias
|
|
1349
|
-
* @param options
|
|
1350
|
-
* @param priority
|
|
1381
|
+
* @param alias The alias to identify the component.
|
|
1382
|
+
* @param options Animation options, matching the `options` of animate function.
|
|
1383
|
+
* @param priority The priority of the PixiJS ticker. This parameter sets the ticker's priority.
|
|
1351
1384
|
* @returns
|
|
1352
1385
|
*/
|
|
1353
1386
|
declare function shakeEffect(alias: string, options?: ShakeEffectProps, priority?: UPDATE_PRIORITY$1): Promise<string[] | undefined>;
|
|
@@ -1552,11 +1585,11 @@ declare function drawCanvasErrorHandler(): OnErrorHandler;
|
|
|
1552
1585
|
/**
|
|
1553
1586
|
* Add a list of images in the container, after that, the images are added to the canvas.
|
|
1554
1587
|
* Is the same that {@link showImageContainer}, but the image is not shown.
|
|
1555
|
-
* If you want to show the
|
|
1556
|
-
* @param alias is the unique alias of the
|
|
1588
|
+
* If you want to show the container, then you need to use the function {@link ImageSprite.load()}.
|
|
1589
|
+
* @param alias is the unique alias of the container. You can use this alias to refer to this container
|
|
1557
1590
|
* @param imageUrls is the url of the image. If you don't provide the url, then the alias is used as the url.
|
|
1558
|
-
* @param options The options of the
|
|
1559
|
-
* @returns
|
|
1591
|
+
* @param options The options of the container.
|
|
1592
|
+
* @returns This function returns an {@link ImageContainer} that you can use to manipulate the component.
|
|
1560
1593
|
* @example
|
|
1561
1594
|
* ```ts
|
|
1562
1595
|
* let bunny = addImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
@@ -1566,10 +1599,10 @@ declare function drawCanvasErrorHandler(): OnErrorHandler;
|
|
|
1566
1599
|
declare function addImageCointainer(alias: string, imageUrls: string[], options?: ImageContainerOptions<ImageSprite>): ImageContainer;
|
|
1567
1600
|
/**
|
|
1568
1601
|
* Add a list of images in the container, after that, the images are added and shown in the canvas.
|
|
1569
|
-
* @param alias The unique alias of the
|
|
1602
|
+
* @param alias The unique alias of the container. You can use this alias to refer to this container
|
|
1570
1603
|
* @param imageUrls The url of the image.
|
|
1571
|
-
* @param options The options of the
|
|
1572
|
-
* @returns
|
|
1604
|
+
* @param options The options of the container.
|
|
1605
|
+
* @returns This function returns an {@link ImageContainer} that you can use to manipulate the component.
|
|
1573
1606
|
* @example
|
|
1574
1607
|
* ```ts
|
|
1575
1608
|
* let bunny = showImageContainer("bunny", ["https://pixijs.com/assets/bunny-body.png", "https://pixijs.com/assets/bunny-eyes.png"])
|
|
@@ -1582,9 +1615,9 @@ declare function showImageContainer(alias: string, imageUrls: string[], options?
|
|
|
1582
1615
|
* Is the same that {@link showImage}, but the image is not shown.
|
|
1583
1616
|
* If you want to show the image, then you need to use the function {@link ImageSprite.load}.
|
|
1584
1617
|
* @param alias is the unique alias of the image. You can use this alias to refer to this image
|
|
1585
|
-
* @param imageUrl
|
|
1618
|
+
* @param imageUrl The url of the image. If you have initialized the "asset matrix", you can use the alias of the texture. If you don't provide the URL, then the alias is used as the URL.
|
|
1586
1619
|
* @param options The options of the image.
|
|
1587
|
-
* @returns
|
|
1620
|
+
* @returns This function returns an {@link ImageSprite} that you can use to manipulate the component.
|
|
1588
1621
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1589
1622
|
* @example
|
|
1590
1623
|
* ```ts
|
|
@@ -1599,9 +1632,9 @@ declare function addImage(alias: string, imageUrl?: string, options?: ImageSprit
|
|
|
1599
1632
|
/**
|
|
1600
1633
|
* Add and show a image in the canvas. This function is a combination of {@link addImage}.
|
|
1601
1634
|
* @param alias The unique alias of the image. You can use this alias to refer to this image
|
|
1602
|
-
* @param imageUrl The url of the image.
|
|
1635
|
+
* @param imageUrl The url of the image. If you have initialized the "asset matrix", you can use the alias of the texture. If you don't provide the URL, then the alias is used as the URL.
|
|
1603
1636
|
* @param options The options of the image.
|
|
1604
|
-
* @returns
|
|
1637
|
+
* @returns This function returns an {@link ImageSprite} that you can use to manipulate the component.
|
|
1605
1638
|
* @throws {PixiError} when `imageUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1606
1639
|
* @example
|
|
1607
1640
|
* ```ts
|
|
@@ -1617,7 +1650,7 @@ declare function showImage(alias: string, imageUrl?: string, options?: ImageSpri
|
|
|
1617
1650
|
* @param alias The unique alias of the text. You can use this alias to refer to this text.
|
|
1618
1651
|
* @param text
|
|
1619
1652
|
* @param options The options of the text.
|
|
1620
|
-
* @returns
|
|
1653
|
+
* @returns This function returns an {@link Text} that you can use to manipulate the component.
|
|
1621
1654
|
* @example
|
|
1622
1655
|
* ```ts
|
|
1623
1656
|
* let text = showText("text", "Hello World", { fontSize: 24, fill: "white" })
|
|
@@ -1640,7 +1673,7 @@ declare function getTexture(textureAlias?: string): Promise<Texture$1 | undefine
|
|
|
1640
1673
|
* @param alias is the unique alias of the video. You can use this alias to refer to this video
|
|
1641
1674
|
* @param videoUrl is the url of the video. If you don't provide the url, then the alias is used as the url.
|
|
1642
1675
|
* @param options The options of the video.
|
|
1643
|
-
* @returns
|
|
1676
|
+
* @returns This function returns an {@link VideoSprite} that you can use to manipulate the component.
|
|
1644
1677
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1645
1678
|
* @example
|
|
1646
1679
|
* ```ts
|
|
@@ -1657,7 +1690,7 @@ declare function addVideo(alias: string, videoUrl?: string, options?: VideoSprit
|
|
|
1657
1690
|
* @param alias The unique alias of the video. You can use this alias to refer to this video
|
|
1658
1691
|
* @param videoUrl The url of the video.
|
|
1659
1692
|
* @param options The options of the video.
|
|
1660
|
-
* @returns
|
|
1693
|
+
* @returns This function returns an {@link VideoSprite} that you can use to manipulate the component.
|
|
1661
1694
|
* @throws {PixiError} when `videoUrl` is not provided and `alias` is not registered in the asset cache.
|
|
1662
1695
|
* @example
|
|
1663
1696
|
* ```ts
|