@drincs/pixi-vn 1.6.4 → 1.7.2
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 +47 -53
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +56 -51
- package/dist/canvas.d.ts +56 -51
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.mjs +1 -1
- package/dist/chunk-4KCAZKAJ.mjs +1 -0
- package/dist/{chunk-D45QSSXG.mjs → chunk-HNGW4ITF.mjs} +1 -1
- package/dist/{chunk-L4IHQ3VT.mjs → chunk-X4NBVTSJ.mjs} +1 -1
- package/dist/{chunk-ZW3MIPMS.mjs → chunk-YDNEIPJP.mjs} +1 -1
- package/dist/history.cjs +1 -1
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -9
- package/dist/index.d.cts +73 -4
- package/dist/index.d.ts +73 -4
- package/dist/index.mjs +2 -9
- package/dist/motion.cjs +1 -1
- package/dist/motion.d.cts +3 -1
- package/dist/motion.d.ts +3 -1
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +2 -2
- package/dist/narration.mjs +2 -2
- package/dist/pixi/browser.js +183 -171
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +74 -14
- package/dist/sound.d.ts +74 -14
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +63 -12
- package/dist/storage.d.ts +63 -12
- package/dist/storage.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.cts +10 -1
- package/dist/vite.d.ts +10 -1
- package/dist/vite.mjs +1 -1
- package/package.json +12 -7
- package/dist/chunk-EWW7VYPM.mjs +0 -1
- /package/dist/{chunk-XSN6P5JL.mjs → chunk-JMOSOAGB.mjs} +0 -0
package/dist/canvas.d.cts
CHANGED
|
@@ -21,7 +21,9 @@ type AnimationOptions = AnimationOptionsCommon & Omit<CommonTickerProps, "startO
|
|
|
21
21
|
|
|
22
22
|
type KeyframesType<T> = ObjectTarget<T> & MotionComponentExtension;
|
|
23
23
|
type SequenceOptions = SequenceOptions$1 & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
24
|
-
type ObjectSegment<O extends CanvasBaseInterface<any>> = [
|
|
24
|
+
type ObjectSegment<O extends CanvasBaseInterface<any>> = [
|
|
25
|
+
ObjectTarget<O> & MotionComponentExtension
|
|
26
|
+
];
|
|
25
27
|
type ObjectSegmentWithTransition<O extends CanvasBaseInterface<any>> = [
|
|
26
28
|
ObjectTarget<O> & MotionComponentExtension,
|
|
27
29
|
AnimationOptions & At
|
|
@@ -641,17 +643,11 @@ interface CanvasManagerInterface {
|
|
|
641
643
|
/**
|
|
642
644
|
* Currently tickers that are running.
|
|
643
645
|
*/
|
|
644
|
-
readonly currentTickers:
|
|
645
|
-
[id: string]: TickerInfo<any>;
|
|
646
|
-
};
|
|
646
|
+
readonly currentTickers: Map<string, TickerInfo<any>>;
|
|
647
647
|
/**
|
|
648
648
|
* The steps of the tickers
|
|
649
649
|
*/
|
|
650
|
-
readonly currentTickersSteps:
|
|
651
|
-
[alias: string]: {
|
|
652
|
-
[tickerId: string]: TickersSequence;
|
|
653
|
-
};
|
|
654
|
-
};
|
|
650
|
+
readonly currentTickersSteps: Map<string, Map<string, TickersSequence>>;
|
|
655
651
|
/**
|
|
656
652
|
* Find a ticker by its id.
|
|
657
653
|
* @param tickerId The id of the ticker.
|
|
@@ -757,6 +753,17 @@ interface CanvasManagerInterface {
|
|
|
757
753
|
* @returns If the ticker is paused.
|
|
758
754
|
*/
|
|
759
755
|
isTickerPaused(alias: string, tickerId?: string): boolean;
|
|
756
|
+
/**
|
|
757
|
+
* Pause the rendering of gameLayer and pause currently running tickers.
|
|
758
|
+
* Use {@link resume} to restore rendering and resume only
|
|
759
|
+
* the tickers paused by this method.
|
|
760
|
+
*/
|
|
761
|
+
pause(): void;
|
|
762
|
+
/**
|
|
763
|
+
* Resume the rendering of gameLayer and resume tickers that were paused by
|
|
764
|
+
* {@link pause}.
|
|
765
|
+
*/
|
|
766
|
+
resume(): void;
|
|
760
767
|
/**
|
|
761
768
|
* Add a ticker that must be completed before the next step.
|
|
762
769
|
* This method is used for example into a transition between scenes.
|
|
@@ -842,7 +849,7 @@ interface CanvasManagerInterface {
|
|
|
842
849
|
* Add a HTML layer to the canvas.
|
|
843
850
|
* @param id The id of the layer.
|
|
844
851
|
* @param element The html element to be added.
|
|
845
|
-
* @param style The style of the layer. @default { position: "absolute", pointerEvents: "none" }.
|
|
852
|
+
* @param style The style of the layer. @default { position: "absolute", pointerEvents: "none", userSelect: "none" }.
|
|
846
853
|
* @example
|
|
847
854
|
* ```tsx
|
|
848
855
|
* const root = document.getElementById('root')
|
|
@@ -859,7 +866,7 @@ interface CanvasManagerInterface {
|
|
|
859
866
|
* )
|
|
860
867
|
* ```
|
|
861
868
|
*/
|
|
862
|
-
addHtmlLayer(id: string, element: HTMLElement, style?: Pick<CSSStyleDeclaration, "position" | "pointerEvents"
|
|
869
|
+
addHtmlLayer(id: string, element: HTMLElement, style?: Partial<Pick<CSSStyleDeclaration, "position" | "pointerEvents" | "userSelect">>): HTMLDivElement;
|
|
863
870
|
/**
|
|
864
871
|
* Get a HTML layer from the canvas.
|
|
865
872
|
* @param id The id of the layer to be removed.
|
|
@@ -1096,7 +1103,7 @@ interface ListenerExtension {
|
|
|
1096
1103
|
on: Container$1["on"];
|
|
1097
1104
|
readonly onEventsHandlers: OnEventsHandlers;
|
|
1098
1105
|
}
|
|
1099
|
-
declare function addListenerHandler<T extends ListenerExtension>(event: symbol | string, element: T, fn:
|
|
1106
|
+
declare function addListenerHandler<T extends ListenerExtension>(event: symbol | string, element: T, fn: (...args: never[]) => unknown): boolean;
|
|
1100
1107
|
|
|
1101
1108
|
/**
|
|
1102
1109
|
* Interface for Asset memory
|
|
@@ -1119,22 +1126,6 @@ interface SpriteBaseMemory extends SpriteOptions$1, CanvasBaseItemMemory, Listen
|
|
|
1119
1126
|
interface SpriteMemory extends SpriteBaseMemory {
|
|
1120
1127
|
}
|
|
1121
1128
|
|
|
1122
|
-
/**
|
|
1123
|
-
* The memory of the image. It uses for save the state of the image.
|
|
1124
|
-
*/
|
|
1125
|
-
interface ImageSpriteMemory extends SpriteBaseMemory {
|
|
1126
|
-
loadIsStarted: boolean;
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
/**
|
|
1130
|
-
* The memory of the video. It uses for save the state of the video.
|
|
1131
|
-
*/
|
|
1132
|
-
interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
1133
|
-
loop: boolean;
|
|
1134
|
-
paused: boolean;
|
|
1135
|
-
currentTime: number;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
1129
|
/**
|
|
1139
1130
|
* 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,
|
|
1140
1131
|
* but it has the ability to be saved and loaded by the Pixi’VN library.
|
|
@@ -1155,7 +1146,7 @@ interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
|
1155
1146
|
* ```
|
|
1156
1147
|
*/
|
|
1157
1148
|
declare class Sprite<Memory extends SpriteOptions$1 & CanvasBaseItemMemory = SpriteMemory> extends _drincs_pixi_vn_pixi_js__default.Sprite implements CanvasBaseItem<Memory | SpriteMemory>, ListenerExtension, AdditionalPositionsExtension {
|
|
1158
|
-
constructor(options?: SpriteOptions |
|
|
1149
|
+
constructor(options?: SpriteOptions | Texture$1);
|
|
1159
1150
|
readonly pixivnId: string;
|
|
1160
1151
|
get memory(): Memory | SpriteMemory;
|
|
1161
1152
|
setMemory(value: Memory | SpriteMemory): Promise<void>;
|
|
@@ -1210,6 +1201,13 @@ declare class Sprite<Memory extends SpriteOptions$1 & CanvasBaseItemMemory = Spr
|
|
|
1210
1201
|
set y(value: number);
|
|
1211
1202
|
}
|
|
1212
1203
|
|
|
1204
|
+
/**
|
|
1205
|
+
* The memory of the image. It uses for save the state of the image.
|
|
1206
|
+
*/
|
|
1207
|
+
interface ImageSpriteMemory extends SpriteBaseMemory {
|
|
1208
|
+
loadIsStarted: boolean;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1213
1211
|
/**
|
|
1214
1212
|
* This class is a extension of the {@link Sprite} class, it has the same properties and methods,
|
|
1215
1213
|
* but it has some features that make texture management easier.
|
|
@@ -1258,6 +1256,15 @@ declare class ImageSprite<Memory extends ImageSpriteMemory = ImageSpriteMemory>
|
|
|
1258
1256
|
get haveEmptyTexture(): boolean;
|
|
1259
1257
|
}
|
|
1260
1258
|
|
|
1259
|
+
/**
|
|
1260
|
+
* The memory of the video. It uses for save the state of the video.
|
|
1261
|
+
*/
|
|
1262
|
+
interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
1263
|
+
loop: boolean;
|
|
1264
|
+
paused: boolean;
|
|
1265
|
+
currentTime: number;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1261
1268
|
/**
|
|
1262
1269
|
* This class is a extension of the {@link ImageSprite} class, it has the same properties and methods,
|
|
1263
1270
|
* but it has some features that make video management easier.
|
|
@@ -1332,15 +1339,6 @@ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends Con
|
|
|
1332
1339
|
elements: CanvasBaseItemMemory[];
|
|
1333
1340
|
}
|
|
1334
1341
|
|
|
1335
|
-
/**
|
|
1336
|
-
* Interface for the canvas container memory
|
|
1337
|
-
*/
|
|
1338
|
-
interface ImageContainerMemory extends ContainerMemory<ImageSprite> {
|
|
1339
|
-
elements: ImageSpriteMemory[];
|
|
1340
|
-
anchor?: PointData;
|
|
1341
|
-
loadIsStarted: boolean;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
1342
|
/**
|
|
1345
1343
|
* 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,
|
|
1346
1344
|
* but it has the ability to be saved and loaded by the Pixi’VN library.
|
|
@@ -1421,6 +1419,15 @@ declare class Container<C extends ContainerChild = ContainerChild, Memory extend
|
|
|
1421
1419
|
set y(value: number);
|
|
1422
1420
|
}
|
|
1423
1421
|
|
|
1422
|
+
/**
|
|
1423
|
+
* Interface for the canvas container memory
|
|
1424
|
+
*/
|
|
1425
|
+
interface ImageContainerMemory extends ContainerMemory<ImageSprite> {
|
|
1426
|
+
elements: ImageSpriteMemory[];
|
|
1427
|
+
anchor?: PointData;
|
|
1428
|
+
loadIsStarted: boolean;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1424
1431
|
/**
|
|
1425
1432
|
* This class is a extension of the {@link Container}, it has the same properties and methods,
|
|
1426
1433
|
* but this container is composed only of {@link ImageSprite} and introduces the {@link load} functionality
|
|
@@ -1496,7 +1503,7 @@ declare class CanvasManagerStatic {
|
|
|
1496
1503
|
* @param id it is the id of the canvas element.
|
|
1497
1504
|
*/
|
|
1498
1505
|
private static addCanvasIntoHTMLElement;
|
|
1499
|
-
static addHtmlLayer(id: string, element: HTMLElement, style?: Pick<CSSStyleDeclaration, "position" | "pointerEvents"
|
|
1506
|
+
static addHtmlLayer(id: string, element: HTMLElement, style?: Partial<Pick<CSSStyleDeclaration, "position" | "pointerEvents" | "userSelect">>): HTMLDivElement;
|
|
1500
1507
|
static removeHtmlLayer(id: string): void;
|
|
1501
1508
|
static getHtmlLayer(id: string): HTMLElement | undefined;
|
|
1502
1509
|
/**
|
|
@@ -1511,18 +1518,15 @@ declare class CanvasManagerStatic {
|
|
|
1511
1518
|
static get currentTickersWithoutCreatedBySteps(): {
|
|
1512
1519
|
[k: string]: TickerHistory<any>;
|
|
1513
1520
|
};
|
|
1514
|
-
static _currentTickers:
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
static _currentTickersSequence: {
|
|
1521
|
+
static readonly _currentTickers: Map<string, TickerInfo<any>>;
|
|
1522
|
+
static readonly _currentTickersSequence: Map<string, Map<string, TickersSequence>>;
|
|
1523
|
+
static get currentTickersSequence(): {
|
|
1518
1524
|
[alias: string]: {
|
|
1519
1525
|
[tickerId: string]: TickersSequence;
|
|
1520
1526
|
};
|
|
1521
1527
|
};
|
|
1522
|
-
static _currentTickersTimeouts:
|
|
1523
|
-
|
|
1524
|
-
};
|
|
1525
|
-
static _tickersToCompleteOnStepEnd: {
|
|
1528
|
+
static readonly _currentTickersTimeouts: Map<string, TickerTimeoutHistory>;
|
|
1529
|
+
static readonly _tickersToCompleteOnStepEnd: {
|
|
1526
1530
|
tikersIds: {
|
|
1527
1531
|
id: string;
|
|
1528
1532
|
}[];
|
|
@@ -1697,6 +1701,7 @@ declare namespace RegisteredCanvasComponents {
|
|
|
1697
1701
|
function keys(): string[];
|
|
1698
1702
|
}
|
|
1699
1703
|
|
|
1704
|
+
type SerializableEventHandler = (...args: never[]) => unknown;
|
|
1700
1705
|
/**
|
|
1701
1706
|
* Is a decorator that register a event in the game.
|
|
1702
1707
|
* Is a required decorator for use the event in the game.
|
|
@@ -1715,25 +1720,25 @@ declare namespace RegisteredCanvasComponents {
|
|
|
1715
1720
|
* @param name is th identifier of the event, by default is the name of the class
|
|
1716
1721
|
* @returns
|
|
1717
1722
|
*/
|
|
1718
|
-
declare function eventDecorator(name?: string): (
|
|
1723
|
+
declare function eventDecorator(name?: string): (_target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
1719
1724
|
declare namespace RegisteredEvents {
|
|
1720
1725
|
/**
|
|
1721
1726
|
* Register a event in the game.
|
|
1722
1727
|
* @param fn The class of the event.
|
|
1723
1728
|
* @param name Name of the event, by default it will use the class name. If the name is already registered, it will show a warning
|
|
1724
1729
|
*/
|
|
1725
|
-
function add(fn:
|
|
1730
|
+
function add(fn: SerializableEventHandler, name: string): void;
|
|
1726
1731
|
/**
|
|
1727
1732
|
* Get a event by the id.
|
|
1728
1733
|
* @param canvasId The id of the event.
|
|
1729
1734
|
* @returns The event type.
|
|
1730
1735
|
*/
|
|
1731
|
-
function get(name: string):
|
|
1736
|
+
function get(name: string): SerializableEventHandler | undefined;
|
|
1732
1737
|
/**
|
|
1733
1738
|
* Get a list of all events registered.
|
|
1734
1739
|
* @returns An array of events.
|
|
1735
1740
|
*/
|
|
1736
|
-
function values():
|
|
1741
|
+
function values(): SerializableEventHandler[];
|
|
1737
1742
|
/**
|
|
1738
1743
|
* Check if a event is registered.
|
|
1739
1744
|
* @param id The id of the event.
|
package/dist/canvas.d.ts
CHANGED
|
@@ -21,7 +21,9 @@ type AnimationOptions = AnimationOptionsCommon & Omit<CommonTickerProps, "startO
|
|
|
21
21
|
|
|
22
22
|
type KeyframesType<T> = ObjectTarget<T> & MotionComponentExtension;
|
|
23
23
|
type SequenceOptions = SequenceOptions$1 & Omit<CommonTickerProps, "startOnlyIfHaveTexture">;
|
|
24
|
-
type ObjectSegment<O extends CanvasBaseInterface<any>> = [
|
|
24
|
+
type ObjectSegment<O extends CanvasBaseInterface<any>> = [
|
|
25
|
+
ObjectTarget<O> & MotionComponentExtension
|
|
26
|
+
];
|
|
25
27
|
type ObjectSegmentWithTransition<O extends CanvasBaseInterface<any>> = [
|
|
26
28
|
ObjectTarget<O> & MotionComponentExtension,
|
|
27
29
|
AnimationOptions & At
|
|
@@ -641,17 +643,11 @@ interface CanvasManagerInterface {
|
|
|
641
643
|
/**
|
|
642
644
|
* Currently tickers that are running.
|
|
643
645
|
*/
|
|
644
|
-
readonly currentTickers:
|
|
645
|
-
[id: string]: TickerInfo<any>;
|
|
646
|
-
};
|
|
646
|
+
readonly currentTickers: Map<string, TickerInfo<any>>;
|
|
647
647
|
/**
|
|
648
648
|
* The steps of the tickers
|
|
649
649
|
*/
|
|
650
|
-
readonly currentTickersSteps:
|
|
651
|
-
[alias: string]: {
|
|
652
|
-
[tickerId: string]: TickersSequence;
|
|
653
|
-
};
|
|
654
|
-
};
|
|
650
|
+
readonly currentTickersSteps: Map<string, Map<string, TickersSequence>>;
|
|
655
651
|
/**
|
|
656
652
|
* Find a ticker by its id.
|
|
657
653
|
* @param tickerId The id of the ticker.
|
|
@@ -757,6 +753,17 @@ interface CanvasManagerInterface {
|
|
|
757
753
|
* @returns If the ticker is paused.
|
|
758
754
|
*/
|
|
759
755
|
isTickerPaused(alias: string, tickerId?: string): boolean;
|
|
756
|
+
/**
|
|
757
|
+
* Pause the rendering of gameLayer and pause currently running tickers.
|
|
758
|
+
* Use {@link resume} to restore rendering and resume only
|
|
759
|
+
* the tickers paused by this method.
|
|
760
|
+
*/
|
|
761
|
+
pause(): void;
|
|
762
|
+
/**
|
|
763
|
+
* Resume the rendering of gameLayer and resume tickers that were paused by
|
|
764
|
+
* {@link pause}.
|
|
765
|
+
*/
|
|
766
|
+
resume(): void;
|
|
760
767
|
/**
|
|
761
768
|
* Add a ticker that must be completed before the next step.
|
|
762
769
|
* This method is used for example into a transition between scenes.
|
|
@@ -842,7 +849,7 @@ interface CanvasManagerInterface {
|
|
|
842
849
|
* Add a HTML layer to the canvas.
|
|
843
850
|
* @param id The id of the layer.
|
|
844
851
|
* @param element The html element to be added.
|
|
845
|
-
* @param style The style of the layer. @default { position: "absolute", pointerEvents: "none" }.
|
|
852
|
+
* @param style The style of the layer. @default { position: "absolute", pointerEvents: "none", userSelect: "none" }.
|
|
846
853
|
* @example
|
|
847
854
|
* ```tsx
|
|
848
855
|
* const root = document.getElementById('root')
|
|
@@ -859,7 +866,7 @@ interface CanvasManagerInterface {
|
|
|
859
866
|
* )
|
|
860
867
|
* ```
|
|
861
868
|
*/
|
|
862
|
-
addHtmlLayer(id: string, element: HTMLElement, style?: Pick<CSSStyleDeclaration, "position" | "pointerEvents"
|
|
869
|
+
addHtmlLayer(id: string, element: HTMLElement, style?: Partial<Pick<CSSStyleDeclaration, "position" | "pointerEvents" | "userSelect">>): HTMLDivElement;
|
|
863
870
|
/**
|
|
864
871
|
* Get a HTML layer from the canvas.
|
|
865
872
|
* @param id The id of the layer to be removed.
|
|
@@ -1096,7 +1103,7 @@ interface ListenerExtension {
|
|
|
1096
1103
|
on: Container$1["on"];
|
|
1097
1104
|
readonly onEventsHandlers: OnEventsHandlers;
|
|
1098
1105
|
}
|
|
1099
|
-
declare function addListenerHandler<T extends ListenerExtension>(event: symbol | string, element: T, fn:
|
|
1106
|
+
declare function addListenerHandler<T extends ListenerExtension>(event: symbol | string, element: T, fn: (...args: never[]) => unknown): boolean;
|
|
1100
1107
|
|
|
1101
1108
|
/**
|
|
1102
1109
|
* Interface for Asset memory
|
|
@@ -1119,22 +1126,6 @@ interface SpriteBaseMemory extends SpriteOptions$1, CanvasBaseItemMemory, Listen
|
|
|
1119
1126
|
interface SpriteMemory extends SpriteBaseMemory {
|
|
1120
1127
|
}
|
|
1121
1128
|
|
|
1122
|
-
/**
|
|
1123
|
-
* The memory of the image. It uses for save the state of the image.
|
|
1124
|
-
*/
|
|
1125
|
-
interface ImageSpriteMemory extends SpriteBaseMemory {
|
|
1126
|
-
loadIsStarted: boolean;
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
/**
|
|
1130
|
-
* The memory of the video. It uses for save the state of the video.
|
|
1131
|
-
*/
|
|
1132
|
-
interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
1133
|
-
loop: boolean;
|
|
1134
|
-
paused: boolean;
|
|
1135
|
-
currentTime: number;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
1129
|
/**
|
|
1139
1130
|
* 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,
|
|
1140
1131
|
* but it has the ability to be saved and loaded by the Pixi’VN library.
|
|
@@ -1155,7 +1146,7 @@ interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
|
1155
1146
|
* ```
|
|
1156
1147
|
*/
|
|
1157
1148
|
declare class Sprite<Memory extends SpriteOptions$1 & CanvasBaseItemMemory = SpriteMemory> extends _drincs_pixi_vn_pixi_js__default.Sprite implements CanvasBaseItem<Memory | SpriteMemory>, ListenerExtension, AdditionalPositionsExtension {
|
|
1158
|
-
constructor(options?: SpriteOptions |
|
|
1149
|
+
constructor(options?: SpriteOptions | Texture$1);
|
|
1159
1150
|
readonly pixivnId: string;
|
|
1160
1151
|
get memory(): Memory | SpriteMemory;
|
|
1161
1152
|
setMemory(value: Memory | SpriteMemory): Promise<void>;
|
|
@@ -1210,6 +1201,13 @@ declare class Sprite<Memory extends SpriteOptions$1 & CanvasBaseItemMemory = Spr
|
|
|
1210
1201
|
set y(value: number);
|
|
1211
1202
|
}
|
|
1212
1203
|
|
|
1204
|
+
/**
|
|
1205
|
+
* The memory of the image. It uses for save the state of the image.
|
|
1206
|
+
*/
|
|
1207
|
+
interface ImageSpriteMemory extends SpriteBaseMemory {
|
|
1208
|
+
loadIsStarted: boolean;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1213
1211
|
/**
|
|
1214
1212
|
* This class is a extension of the {@link Sprite} class, it has the same properties and methods,
|
|
1215
1213
|
* but it has some features that make texture management easier.
|
|
@@ -1258,6 +1256,15 @@ declare class ImageSprite<Memory extends ImageSpriteMemory = ImageSpriteMemory>
|
|
|
1258
1256
|
get haveEmptyTexture(): boolean;
|
|
1259
1257
|
}
|
|
1260
1258
|
|
|
1259
|
+
/**
|
|
1260
|
+
* The memory of the video. It uses for save the state of the video.
|
|
1261
|
+
*/
|
|
1262
|
+
interface VideoSpriteMemory extends ImageSpriteMemory {
|
|
1263
|
+
loop: boolean;
|
|
1264
|
+
paused: boolean;
|
|
1265
|
+
currentTime: number;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1261
1268
|
/**
|
|
1262
1269
|
* This class is a extension of the {@link ImageSprite} class, it has the same properties and methods,
|
|
1263
1270
|
* but it has some features that make video management easier.
|
|
@@ -1332,15 +1339,6 @@ interface ContainerMemory<C extends ContainerChild = ContainerChild> extends Con
|
|
|
1332
1339
|
elements: CanvasBaseItemMemory[];
|
|
1333
1340
|
}
|
|
1334
1341
|
|
|
1335
|
-
/**
|
|
1336
|
-
* Interface for the canvas container memory
|
|
1337
|
-
*/
|
|
1338
|
-
interface ImageContainerMemory extends ContainerMemory<ImageSprite> {
|
|
1339
|
-
elements: ImageSpriteMemory[];
|
|
1340
|
-
anchor?: PointData;
|
|
1341
|
-
loadIsStarted: boolean;
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
1342
|
/**
|
|
1345
1343
|
* 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,
|
|
1346
1344
|
* but it has the ability to be saved and loaded by the Pixi’VN library.
|
|
@@ -1421,6 +1419,15 @@ declare class Container<C extends ContainerChild = ContainerChild, Memory extend
|
|
|
1421
1419
|
set y(value: number);
|
|
1422
1420
|
}
|
|
1423
1421
|
|
|
1422
|
+
/**
|
|
1423
|
+
* Interface for the canvas container memory
|
|
1424
|
+
*/
|
|
1425
|
+
interface ImageContainerMemory extends ContainerMemory<ImageSprite> {
|
|
1426
|
+
elements: ImageSpriteMemory[];
|
|
1427
|
+
anchor?: PointData;
|
|
1428
|
+
loadIsStarted: boolean;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1424
1431
|
/**
|
|
1425
1432
|
* This class is a extension of the {@link Container}, it has the same properties and methods,
|
|
1426
1433
|
* but this container is composed only of {@link ImageSprite} and introduces the {@link load} functionality
|
|
@@ -1496,7 +1503,7 @@ declare class CanvasManagerStatic {
|
|
|
1496
1503
|
* @param id it is the id of the canvas element.
|
|
1497
1504
|
*/
|
|
1498
1505
|
private static addCanvasIntoHTMLElement;
|
|
1499
|
-
static addHtmlLayer(id: string, element: HTMLElement, style?: Pick<CSSStyleDeclaration, "position" | "pointerEvents"
|
|
1506
|
+
static addHtmlLayer(id: string, element: HTMLElement, style?: Partial<Pick<CSSStyleDeclaration, "position" | "pointerEvents" | "userSelect">>): HTMLDivElement;
|
|
1500
1507
|
static removeHtmlLayer(id: string): void;
|
|
1501
1508
|
static getHtmlLayer(id: string): HTMLElement | undefined;
|
|
1502
1509
|
/**
|
|
@@ -1511,18 +1518,15 @@ declare class CanvasManagerStatic {
|
|
|
1511
1518
|
static get currentTickersWithoutCreatedBySteps(): {
|
|
1512
1519
|
[k: string]: TickerHistory<any>;
|
|
1513
1520
|
};
|
|
1514
|
-
static _currentTickers:
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
static _currentTickersSequence: {
|
|
1521
|
+
static readonly _currentTickers: Map<string, TickerInfo<any>>;
|
|
1522
|
+
static readonly _currentTickersSequence: Map<string, Map<string, TickersSequence>>;
|
|
1523
|
+
static get currentTickersSequence(): {
|
|
1518
1524
|
[alias: string]: {
|
|
1519
1525
|
[tickerId: string]: TickersSequence;
|
|
1520
1526
|
};
|
|
1521
1527
|
};
|
|
1522
|
-
static _currentTickersTimeouts:
|
|
1523
|
-
|
|
1524
|
-
};
|
|
1525
|
-
static _tickersToCompleteOnStepEnd: {
|
|
1528
|
+
static readonly _currentTickersTimeouts: Map<string, TickerTimeoutHistory>;
|
|
1529
|
+
static readonly _tickersToCompleteOnStepEnd: {
|
|
1526
1530
|
tikersIds: {
|
|
1527
1531
|
id: string;
|
|
1528
1532
|
}[];
|
|
@@ -1697,6 +1701,7 @@ declare namespace RegisteredCanvasComponents {
|
|
|
1697
1701
|
function keys(): string[];
|
|
1698
1702
|
}
|
|
1699
1703
|
|
|
1704
|
+
type SerializableEventHandler = (...args: never[]) => unknown;
|
|
1700
1705
|
/**
|
|
1701
1706
|
* Is a decorator that register a event in the game.
|
|
1702
1707
|
* Is a required decorator for use the event in the game.
|
|
@@ -1715,25 +1720,25 @@ declare namespace RegisteredCanvasComponents {
|
|
|
1715
1720
|
* @param name is th identifier of the event, by default is the name of the class
|
|
1716
1721
|
* @returns
|
|
1717
1722
|
*/
|
|
1718
|
-
declare function eventDecorator(name?: string): (
|
|
1723
|
+
declare function eventDecorator(name?: string): (_target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
1719
1724
|
declare namespace RegisteredEvents {
|
|
1720
1725
|
/**
|
|
1721
1726
|
* Register a event in the game.
|
|
1722
1727
|
* @param fn The class of the event.
|
|
1723
1728
|
* @param name Name of the event, by default it will use the class name. If the name is already registered, it will show a warning
|
|
1724
1729
|
*/
|
|
1725
|
-
function add(fn:
|
|
1730
|
+
function add(fn: SerializableEventHandler, name: string): void;
|
|
1726
1731
|
/**
|
|
1727
1732
|
* Get a event by the id.
|
|
1728
1733
|
* @param canvasId The id of the event.
|
|
1729
1734
|
* @returns The event type.
|
|
1730
1735
|
*/
|
|
1731
|
-
function get(name: string):
|
|
1736
|
+
function get(name: string): SerializableEventHandler | undefined;
|
|
1732
1737
|
/**
|
|
1733
1738
|
* Get a list of all events registered.
|
|
1734
1739
|
* @returns An array of events.
|
|
1735
1740
|
*/
|
|
1736
|
-
function values():
|
|
1741
|
+
function values(): SerializableEventHandler[];
|
|
1737
1742
|
/**
|
|
1738
1743
|
* Check if a event is registered.
|
|
1739
1744
|
* @param id The id of the event.
|