@drincs/pixi-vn 0.6.1 → 0.6.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/dist/{TickerBase-BAUiHet_.d.ts → TickerBase-3rLpDpmb.d.ts} +9 -0
- package/dist/{TickerBase-BctFf13y.d.mts → TickerBase-DKYzbzro.d.mts} +9 -0
- package/dist/classes/CanvasEvent.d.mts +6 -0
- package/dist/classes/CanvasEvent.d.ts +6 -0
- package/dist/classes/CanvasEvent.js +7 -0
- package/dist/classes/CanvasEvent.js.map +1 -1
- package/dist/classes/CanvasEvent.mjs +7 -0
- package/dist/classes/CanvasEvent.mjs.map +1 -1
- package/dist/classes/CharacterBaseModel.js +93 -65
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +93 -65
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.js +94 -66
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +94 -66
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.js +1 -1
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +1 -1
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/DialogueBaseModel.d.mts +2 -2
- package/dist/classes/DialogueBaseModel.d.ts +2 -2
- package/dist/classes/DialogueBaseModel.js +5 -5
- package/dist/classes/DialogueBaseModel.js.map +1 -1
- package/dist/classes/DialogueBaseModel.mjs +5 -5
- package/dist/classes/DialogueBaseModel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +1 -1
- package/dist/classes/Label.d.ts +1 -1
- package/dist/classes/Label.js +1 -1
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +1 -1
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/StoredClassModel.js +93 -65
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs +93 -65
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/canvas/CanvasBase.d.mts +5 -1
- package/dist/classes/canvas/CanvasBase.d.ts +5 -1
- package/dist/classes/canvas/CanvasBase.js +7 -0
- package/dist/classes/canvas/CanvasBase.js.map +1 -1
- package/dist/classes/canvas/CanvasBase.mjs +7 -0
- package/dist/classes/canvas/CanvasBase.mjs.map +1 -1
- package/dist/classes/canvas/CanvasContainer.d.mts +4 -1
- package/dist/classes/canvas/CanvasContainer.d.ts +4 -1
- package/dist/classes/canvas/CanvasContainer.js +57 -37
- package/dist/classes/canvas/CanvasContainer.js.map +1 -1
- package/dist/classes/canvas/CanvasContainer.mjs +57 -38
- package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
- package/dist/classes/canvas/CanvasImage.d.mts +4 -2
- package/dist/classes/canvas/CanvasImage.d.ts +4 -2
- package/dist/classes/canvas/CanvasImage.js +33 -20
- package/dist/classes/canvas/CanvasImage.js.map +1 -1
- package/dist/classes/canvas/CanvasImage.mjs +30 -20
- package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
- package/dist/classes/canvas/CanvasSprite.d.mts +5 -2
- package/dist/classes/canvas/CanvasSprite.d.ts +5 -2
- package/dist/classes/canvas/CanvasSprite.js +25 -17
- package/dist/classes/canvas/CanvasSprite.js.map +1 -1
- package/dist/classes/canvas/CanvasSprite.mjs +25 -18
- package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
- package/dist/classes/canvas/CanvasText.d.mts +6 -3
- package/dist/classes/canvas/CanvasText.d.ts +6 -3
- package/dist/classes/canvas/CanvasText.js +25 -17
- package/dist/classes/canvas/CanvasText.js.map +1 -1
- package/dist/classes/canvas/CanvasText.mjs +25 -18
- package/dist/classes/canvas/CanvasText.mjs.map +1 -1
- package/dist/classes/canvas/index.js +184 -158
- package/dist/classes/canvas/index.js.map +1 -1
- package/dist/classes/canvas/index.mjs +184 -158
- package/dist/classes/canvas/index.mjs.map +1 -1
- package/dist/classes/index.d.mts +1 -0
- package/dist/classes/index.d.ts +1 -0
- package/dist/classes/index.js +106 -71
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +106 -71
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.d.mts +2 -1
- package/dist/classes/ticker/FadeAlphaTicker.d.ts +2 -1
- package/dist/classes/ticker/FadeAlphaTicker.js +93 -65
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs +93 -65
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
- package/dist/classes/ticker/MoveTicker.d.mts +2 -1
- package/dist/classes/ticker/MoveTicker.d.ts +2 -1
- package/dist/classes/ticker/MoveTicker.js +93 -65
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs +93 -65
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
- package/dist/classes/ticker/RotateTicker.d.mts +2 -1
- package/dist/classes/ticker/RotateTicker.d.ts +2 -1
- package/dist/classes/ticker/RotateTicker.js +93 -65
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs +93 -65
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
- package/dist/classes/ticker/TickerBase.d.mts +2 -1
- package/dist/classes/ticker/TickerBase.d.ts +2 -1
- package/dist/classes/ticker/TickerBase.js +5 -0
- package/dist/classes/ticker/TickerBase.js.map +1 -1
- package/dist/classes/ticker/TickerBase.mjs +5 -0
- package/dist/classes/ticker/TickerBase.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.d.mts +9 -3
- package/dist/classes/ticker/ZoomTicker.d.ts +9 -3
- package/dist/classes/ticker/ZoomTicker.js +108 -66
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs +106 -66
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
- package/dist/classes/ticker/index.d.mts +2 -1
- package/dist/classes/ticker/index.d.ts +2 -1
- package/dist/classes/ticker/index.js +230 -202
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs +230 -202
- package/dist/classes/ticker/index.mjs.map +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/decorators/CanvasElementDecorator.d.mts +3 -3
- package/dist/decorators/CanvasElementDecorator.d.ts +3 -3
- package/dist/decorators/CanvasElementDecorator.js +63 -43
- package/dist/decorators/CanvasElementDecorator.js.map +1 -1
- package/dist/decorators/CanvasElementDecorator.mjs +62 -42
- package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
- package/dist/decorators/EventDecorator.d.mts +7 -7
- package/dist/decorators/EventDecorator.d.ts +7 -7
- package/dist/decorators/EventDecorator.js +11 -10
- package/dist/decorators/EventDecorator.js.map +1 -1
- package/dist/decorators/EventDecorator.mjs +10 -9
- package/dist/decorators/EventDecorator.mjs.map +1 -1
- package/dist/decorators/LabelDecorator.js +94 -66
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +94 -66
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/TickerDecorator.d.mts +5 -5
- package/dist/decorators/TickerDecorator.d.ts +5 -5
- package/dist/decorators/TickerDecorator.js +6 -5
- package/dist/decorators/TickerDecorator.js.map +1 -1
- package/dist/decorators/TickerDecorator.mjs +6 -5
- package/dist/decorators/TickerDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +96 -66
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +96 -66
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/CanvasUtility.js +56 -37
- package/dist/functions/CanvasUtility.js.map +1 -1
- package/dist/functions/CanvasUtility.mjs +56 -37
- package/dist/functions/CanvasUtility.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +1 -1
- package/dist/functions/DialogueUtility.d.ts +1 -1
- package/dist/functions/DialogueUtility.js +240 -201
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +240 -201
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js +93 -65
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs +93 -65
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js +93 -65
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs +93 -65
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.d.mts +35 -2
- package/dist/functions/ImageUtility.d.ts +35 -2
- package/dist/functions/ImageUtility.js +371 -186
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs +368 -187
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/SavesUtility.d.mts +2 -2
- package/dist/functions/SavesUtility.d.ts +2 -2
- package/dist/functions/SavesUtility.js +141 -71
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +141 -71
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/index.d.mts +6 -3
- package/dist/functions/index.d.ts +6 -3
- package/dist/functions/index.js +277 -81
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +275 -83
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +644 -153
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +642 -155
- package/dist/index.mjs.map +1 -1
- package/dist/interface/IHistoryStep.d.mts +2 -2
- package/dist/interface/IHistoryStep.d.ts +2 -2
- package/dist/interface/ISaveData.d.mts +2 -2
- package/dist/interface/ISaveData.d.ts +2 -2
- package/dist/interface/ITicker.d.mts +2 -1
- package/dist/interface/ITicker.d.ts +2 -1
- package/dist/interface/ITickersSteps.d.mts +12 -3
- package/dist/interface/ITickersSteps.d.ts +12 -3
- package/dist/interface/TickerHistory.d.mts +3 -3
- package/dist/interface/TickerHistory.d.ts +3 -3
- package/dist/interface/canvas/ICanvasBaseMemory.d.mts +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.d.ts +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.d.mts +2 -2
- package/dist/interface/canvas/ICanvasImageMemory.d.ts +2 -2
- package/dist/interface/canvas/ICanvasSpriteMemory.d.mts +1 -2
- package/dist/interface/canvas/ICanvasSpriteMemory.d.ts +1 -2
- package/dist/interface/canvas/ICanvasTextTextMemory.d.mts +1 -2
- package/dist/interface/canvas/ICanvasTextTextMemory.d.ts +1 -2
- package/dist/interface/export/ExportedCanvas.d.mts +2 -2
- package/dist/interface/export/ExportedCanvas.d.ts +2 -2
- package/dist/interface/export/ExportedStep.d.mts +2 -2
- package/dist/interface/export/ExportedStep.d.ts +2 -2
- package/dist/interface/export/index.d.mts +2 -2
- package/dist/interface/export/index.d.ts +2 -2
- package/dist/interface/index.d.mts +2 -2
- package/dist/interface/index.d.ts +2 -2
- package/dist/labels/BaseCanvasElementTestLabel.js +400 -372
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +401 -373
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/{EventsTestLabel.d.mts → CanvasEventsTestLabel.d.mts} +4 -7
- package/dist/labels/{EventsTestLabel.d.ts → CanvasEventsTestLabel.d.ts} +4 -7
- package/dist/labels/{EventsTestLabel.js → CanvasEventsTestLabel.js} +320 -98
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -0
- package/dist/labels/{EventsTestLabel.mjs → CanvasEventsTestLabel.mjs} +320 -98
- package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -0
- package/dist/labels/{TintingTestLabel.d.mts → CustomTickerCanvasElementTestLabel.d.mts} +5 -4
- package/dist/labels/{TintingTestLabel.d.ts → CustomTickerCanvasElementTestLabel.d.ts} +5 -4
- package/dist/labels/CustomTickerCanvasElementTestLabel.js +2792 -0
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -0
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +2786 -0
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -0
- package/dist/labels/{ShowImageTest.js → ImagesAnimationsTestLabel.js} +373 -82
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -0
- package/dist/labels/{ShowImageTest.mjs → ImagesAnimationsTestLabel.mjs} +373 -82
- package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -0
- package/dist/labels/MarkdownTest.js +150 -80
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +150 -80
- package/dist/labels/MarkdownTest.mjs.map +1 -1
- package/dist/labels/StartLabel.js +689 -152
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +690 -153
- package/dist/labels/StartLabel.mjs.map +1 -1
- package/dist/labels/TestConstant.d.mts +3 -1
- package/dist/labels/TestConstant.d.ts +3 -1
- package/dist/labels/TestConstant.js +97 -65
- package/dist/labels/TestConstant.js.map +1 -1
- package/dist/labels/TestConstant.mjs +96 -66
- package/dist/labels/TestConstant.mjs.map +1 -1
- package/dist/labels/TickerTestLabel.js +472 -402
- package/dist/labels/TickerTestLabel.js.map +1 -1
- package/dist/labels/TickerTestLabel.mjs +473 -403
- package/dist/labels/TickerTestLabel.mjs.map +1 -1
- package/dist/labels/index.js +689 -152
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +690 -153
- package/dist/labels/index.mjs.map +1 -1
- package/dist/managers/StepManager.d.mts +5 -4
- package/dist/managers/StepManager.d.ts +5 -4
- package/dist/managers/StepManager.js +140 -70
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +140 -70
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/WindowManager.d.mts +1 -1
- package/dist/managers/WindowManager.d.ts +1 -1
- package/dist/managers/WindowManager.js +84 -60
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs +84 -60
- package/dist/managers/WindowManager.mjs.map +1 -1
- package/dist/managers/index.d.mts +2 -2
- package/dist/managers/index.d.ts +2 -2
- package/dist/managers/index.js +140 -70
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +140 -70
- package/dist/managers/index.mjs.map +1 -1
- package/dist/types/ticker/MoveTickerProps.d.mts +1 -1
- package/dist/types/ticker/MoveTickerProps.d.ts +1 -1
- package/dist/types/ticker/RotateTickerProps.d.mts +1 -1
- package/dist/types/ticker/RotateTickerProps.d.ts +1 -1
- package/package.json +1 -1
- package/dist/labels/EventsTestLabel.js.map +0 -1
- package/dist/labels/EventsTestLabel.mjs.map +0 -1
- package/dist/labels/ShowImageTest.js.map +0 -1
- package/dist/labels/ShowImageTest.mjs.map +0 -1
- package/dist/labels/TintingTestLabel.js +0 -1786
- package/dist/labels/TintingTestLabel.js.map +0 -1
- package/dist/labels/TintingTestLabel.mjs +0 -1780
- package/dist/labels/TintingTestLabel.mjs.map +0 -1
- /package/dist/labels/{ShowImageTest.d.mts → ImagesAnimationsTestLabel.d.mts} +0 -0
- /package/dist/labels/{ShowImageTest.d.ts → ImagesAnimationsTestLabel.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UPDATE_PRIORITY } from 'pixi.js';
|
|
2
|
-
import { T as TickerBase, a as TickerArgsType } from '../TickerBase-
|
|
2
|
+
import { T as TickerBase, a as TickerArgsType } from '../TickerBase-DKYzbzro.mjs';
|
|
3
3
|
import { TickerIdType } from '../types/TickerIdType.mjs';
|
|
4
4
|
import '../types/StorageElementType.mjs';
|
|
5
5
|
|
|
@@ -18,13 +18,13 @@ declare const registeredTickers: {
|
|
|
18
18
|
*/
|
|
19
19
|
declare function tickerDecorator(name?: TickerIdType): (target: typeof TickerBase<any>) => void;
|
|
20
20
|
/**
|
|
21
|
-
* Get a ticker instance by the
|
|
22
|
-
* @param
|
|
21
|
+
* Get a ticker instance by the id.
|
|
22
|
+
* @param tickerId The id of the ticker.
|
|
23
23
|
* @param args The arguments that you want to pass to the ticker.
|
|
24
24
|
* @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.
|
|
25
25
|
* @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
|
|
26
26
|
* @returns The instance of the ticker
|
|
27
27
|
*/
|
|
28
|
-
declare function
|
|
28
|
+
declare function geTickerInstanceById<TArgs extends TickerArgsType>(tickerId: TickerIdType, args: TArgs, duration?: number, priority?: UPDATE_PRIORITY): TickerBase<TArgs> | undefined;
|
|
29
29
|
|
|
30
|
-
export { tickerDecorator as default,
|
|
30
|
+
export { tickerDecorator as default, geTickerInstanceById, registeredTickers };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UPDATE_PRIORITY } from 'pixi.js';
|
|
2
|
-
import { T as TickerBase, a as TickerArgsType } from '../TickerBase-
|
|
2
|
+
import { T as TickerBase, a as TickerArgsType } from '../TickerBase-3rLpDpmb.js';
|
|
3
3
|
import { TickerIdType } from '../types/TickerIdType.js';
|
|
4
4
|
import '../types/StorageElementType.js';
|
|
5
5
|
|
|
@@ -18,13 +18,13 @@ declare const registeredTickers: {
|
|
|
18
18
|
*/
|
|
19
19
|
declare function tickerDecorator(name?: TickerIdType): (target: typeof TickerBase<any>) => void;
|
|
20
20
|
/**
|
|
21
|
-
* Get a ticker instance by the
|
|
22
|
-
* @param
|
|
21
|
+
* Get a ticker instance by the id.
|
|
22
|
+
* @param tickerId The id of the ticker.
|
|
23
23
|
* @param args The arguments that you want to pass to the ticker.
|
|
24
24
|
* @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.
|
|
25
25
|
* @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
|
|
26
26
|
* @returns The instance of the ticker
|
|
27
27
|
*/
|
|
28
|
-
declare function
|
|
28
|
+
declare function geTickerInstanceById<TArgs extends TickerArgsType>(tickerId: TickerIdType, args: TArgs, duration?: number, priority?: UPDATE_PRIORITY): TickerBase<TArgs> | undefined;
|
|
29
29
|
|
|
30
|
-
export { tickerDecorator as default,
|
|
30
|
+
export { tickerDecorator as default, geTickerInstanceById, registeredTickers };
|
|
@@ -12,25 +12,26 @@ function tickerDecorator(name) {
|
|
|
12
12
|
if (registeredTickers[name]) {
|
|
13
13
|
console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`);
|
|
14
14
|
}
|
|
15
|
+
target.prototype.id = name;
|
|
15
16
|
registeredTickers[name] = target;
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
19
20
|
try {
|
|
20
|
-
let ticker = registeredTickers[
|
|
21
|
+
let ticker = registeredTickers[tickerId];
|
|
21
22
|
if (!ticker) {
|
|
22
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
23
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
return new ticker(args, duration, priority);
|
|
26
27
|
} catch (e) {
|
|
27
|
-
console.error(`[Pixi'VN] Error while getting Ticker ${
|
|
28
|
+
console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e);
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
exports.default = tickerDecorator;
|
|
33
|
-
exports.
|
|
34
|
+
exports.geTickerInstanceById = geTickerInstanceById;
|
|
34
35
|
exports.registeredTickers = registeredTickers;
|
|
35
36
|
//# sourceMappingURL=out.js.map
|
|
36
37
|
//# sourceMappingURL=TickerDecorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorators/TickerDecorator.ts"],"names":[],"mappings":";AAOO,IAAM,oBAAiE,CAAC;AAQhE,SAAR,gBAAiC,MAAqB;AACzD,SAAO,SAAU,QAAgC;AAC7C,QAAI,CAAC,MAAM;AACP,aAAO,OAAO;AAAA,IAClB;AACA,QAAI,kBAAkB,IAAI,GAAG;AACzB,cAAQ,KAAK,oBAAoB,IAAI,yCAAyC;AAAA,IAClF;AACA,sBAAkB,IAAI,IAAI;AAAA,EAC9B;AACJ;AAUO,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../src/decorators/TickerDecorator.ts"],"names":[],"mappings":";AAOO,IAAM,oBAAiE,CAAC;AAQhE,SAAR,gBAAiC,MAAqB;AACzD,SAAO,SAAU,QAAgC;AAC7C,QAAI,CAAC,MAAM;AACP,aAAO,OAAO;AAAA,IAClB;AACA,QAAI,kBAAkB,IAAI,GAAG;AACzB,cAAQ,KAAK,oBAAoB,IAAI,yCAAyC;AAAA,IAClF;AACA,WAAO,UAAU,KAAK;AACtB,sBAAkB,IAAI,IAAI;AAAA,EAC9B;AACJ;AAUO,SAAS,qBAAmD,UAAwB,MAAa,UAAmB,UAA2D;AAClL,MAAI;AACA,QAAI,SAAS,kBAAkB,QAAQ;AACvC,QAAI,CAAC,QAAQ;AACT,cAAQ,MAAM,oBAAoB,QAAQ,YAAY;AACtD;AAAA,IACJ;AACA,WAAO,IAAI,OAAO,MAAM,UAAU,QAAQ;AAAA,EAC9C,SACO,GAAG;AACN,YAAQ,MAAM,wCAAwC,QAAQ,IAAI,CAAC;AACnE;AAAA,EACJ;AACJ","sourcesContent":["import { UPDATE_PRIORITY } from \"pixi.js\"\nimport TickerBase, { TickerArgsType } from \"../classes/ticker/TickerBase\"\nimport { TickerIdType } from \"../types/TickerIdType\"\n\n/**\n * A dictionary that contains all tickers registered and avvailable to be used.\n */\nexport const registeredTickers: { [name: TickerIdType]: typeof TickerBase } = {}\n/**\n * Is a decorator that register a ticker in the game.\n * Is a required decorator for use the ticker in the game.\n * Thanks to this decoration the game has the possibility of updating the tickers to the latest modification and saving the game.\n * @param name is th identifier of the label, by default is the name of the class\n * @returns \n */\nexport default function tickerDecorator(name?: TickerIdType) {\n return function (target: typeof TickerBase<any>) {\n if (!name) {\n name = target.name\n }\n if (registeredTickers[name]) {\n console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`)\n }\n target.prototype.id = name\n registeredTickers[name] = target\n }\n}\n\n/**\n * Get a ticker instance by the id.\n * @param tickerId The id of the ticker.\n * @param args The arguments that you want to pass to the ticker.\n * @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.\n * @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.\n * @returns The instance of the ticker\n */\nexport function geTickerInstanceById<TArgs extends TickerArgsType>(tickerId: TickerIdType, args: TArgs, duration?: number, priority?: UPDATE_PRIORITY): TickerBase<TArgs> | undefined {\n try {\n let ticker = registeredTickers[tickerId]\n if (!ticker) {\n console.error(`[Pixi'VN] Ticker ${tickerId} not found`)\n return\n }\n return new ticker(args, duration, priority)\n }\n catch (e) {\n console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e)\n return\n }\n}\n"]}
|
|
@@ -8,23 +8,24 @@ function tickerDecorator(name) {
|
|
|
8
8
|
if (registeredTickers[name]) {
|
|
9
9
|
console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`);
|
|
10
10
|
}
|
|
11
|
+
target.prototype.id = name;
|
|
11
12
|
registeredTickers[name] = target;
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
15
16
|
try {
|
|
16
|
-
let ticker = registeredTickers[
|
|
17
|
+
let ticker = registeredTickers[tickerId];
|
|
17
18
|
if (!ticker) {
|
|
18
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
19
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
return new ticker(args, duration, priority);
|
|
22
23
|
} catch (e) {
|
|
23
|
-
console.error(`[Pixi'VN] Error while getting Ticker ${
|
|
24
|
+
console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e);
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
export { tickerDecorator as default,
|
|
29
|
+
export { tickerDecorator as default, geTickerInstanceById, registeredTickers };
|
|
29
30
|
//# sourceMappingURL=out.js.map
|
|
30
31
|
//# sourceMappingURL=TickerDecorator.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorators/TickerDecorator.ts"],"names":[],"mappings":";AAOO,IAAM,oBAAiE,CAAC;AAQhE,SAAR,gBAAiC,MAAqB;AACzD,SAAO,SAAU,QAAgC;AAC7C,QAAI,CAAC,MAAM;AACP,aAAO,OAAO;AAAA,IAClB;AACA,QAAI,kBAAkB,IAAI,GAAG;AACzB,cAAQ,KAAK,oBAAoB,IAAI,yCAAyC;AAAA,IAClF;AACA,sBAAkB,IAAI,IAAI;AAAA,EAC9B;AACJ;AAUO,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../src/decorators/TickerDecorator.ts"],"names":[],"mappings":";AAOO,IAAM,oBAAiE,CAAC;AAQhE,SAAR,gBAAiC,MAAqB;AACzD,SAAO,SAAU,QAAgC;AAC7C,QAAI,CAAC,MAAM;AACP,aAAO,OAAO;AAAA,IAClB;AACA,QAAI,kBAAkB,IAAI,GAAG;AACzB,cAAQ,KAAK,oBAAoB,IAAI,yCAAyC;AAAA,IAClF;AACA,WAAO,UAAU,KAAK;AACtB,sBAAkB,IAAI,IAAI;AAAA,EAC9B;AACJ;AAUO,SAAS,qBAAmD,UAAwB,MAAa,UAAmB,UAA2D;AAClL,MAAI;AACA,QAAI,SAAS,kBAAkB,QAAQ;AACvC,QAAI,CAAC,QAAQ;AACT,cAAQ,MAAM,oBAAoB,QAAQ,YAAY;AACtD;AAAA,IACJ;AACA,WAAO,IAAI,OAAO,MAAM,UAAU,QAAQ;AAAA,EAC9C,SACO,GAAG;AACN,YAAQ,MAAM,wCAAwC,QAAQ,IAAI,CAAC;AACnE;AAAA,EACJ;AACJ","sourcesContent":["import { UPDATE_PRIORITY } from \"pixi.js\"\nimport TickerBase, { TickerArgsType } from \"../classes/ticker/TickerBase\"\nimport { TickerIdType } from \"../types/TickerIdType\"\n\n/**\n * A dictionary that contains all tickers registered and avvailable to be used.\n */\nexport const registeredTickers: { [name: TickerIdType]: typeof TickerBase } = {}\n/**\n * Is a decorator that register a ticker in the game.\n * Is a required decorator for use the ticker in the game.\n * Thanks to this decoration the game has the possibility of updating the tickers to the latest modification and saving the game.\n * @param name is th identifier of the label, by default is the name of the class\n * @returns \n */\nexport default function tickerDecorator(name?: TickerIdType) {\n return function (target: typeof TickerBase<any>) {\n if (!name) {\n name = target.name\n }\n if (registeredTickers[name]) {\n console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`)\n }\n target.prototype.id = name\n registeredTickers[name] = target\n }\n}\n\n/**\n * Get a ticker instance by the id.\n * @param tickerId The id of the ticker.\n * @param args The arguments that you want to pass to the ticker.\n * @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.\n * @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.\n * @returns The instance of the ticker\n */\nexport function geTickerInstanceById<TArgs extends TickerArgsType>(tickerId: TickerIdType, args: TArgs, duration?: number, priority?: UPDATE_PRIORITY): TickerBase<TArgs> | undefined {\n try {\n let ticker = registeredTickers[tickerId]\n if (!ticker) {\n console.error(`[Pixi'VN] Ticker ${tickerId} not found`)\n return\n }\n return new ticker(args, duration, priority)\n }\n catch (e) {\n console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e)\n return\n }\n}\n"]}
|
|
@@ -18,6 +18,6 @@ import '../classes/Label.mjs';
|
|
|
18
18
|
import '../types/StepHistoryDataType.mjs';
|
|
19
19
|
import '../types/StepLabelType.mjs';
|
|
20
20
|
import '@drincs/pixi-vn/dist/override';
|
|
21
|
-
import '../TickerBase-
|
|
21
|
+
import '../TickerBase-DKYzbzro.mjs';
|
|
22
22
|
import '../types/StorageElementType.mjs';
|
|
23
23
|
import '../types/TickerIdType.mjs';
|
|
@@ -18,6 +18,6 @@ import '../classes/Label.js';
|
|
|
18
18
|
import '../types/StepHistoryDataType.js';
|
|
19
19
|
import '../types/StepLabelType.js';
|
|
20
20
|
import '@drincs/pixi-vn/dist/override';
|
|
21
|
-
import '../TickerBase-
|
|
21
|
+
import '../TickerBase-3rLpDpmb.js';
|
|
22
22
|
import '../types/StorageElementType.js';
|
|
23
23
|
import '../types/TickerIdType.js';
|
package/dist/decorators/index.js
CHANGED
|
@@ -69,17 +69,23 @@ function exportCanvasElement(element) {
|
|
|
69
69
|
return element.memory;
|
|
70
70
|
}
|
|
71
71
|
function importCanvasElement(memory) {
|
|
72
|
-
let element =
|
|
72
|
+
let element = getCanvasElementInstanceById(memory.pixivnId);
|
|
73
73
|
if (element) {
|
|
74
74
|
element.memory = memory;
|
|
75
75
|
} else {
|
|
76
|
-
throw new Error("[Pixi'VN] The element " + memory.
|
|
76
|
+
throw new Error("[Pixi'VN] The element " + memory.pixivnId + " could not be created");
|
|
77
77
|
}
|
|
78
78
|
return element;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// src/classes/canvas/CanvasContainer.ts
|
|
82
|
+
var CANVAS_CONTAINER_ID = "CanvasContainer";
|
|
82
83
|
var CanvasContainer = class extends pixi_js.Container {
|
|
84
|
+
constructor(options) {
|
|
85
|
+
super(options);
|
|
86
|
+
this.pixivnId = CANVAS_CONTAINER_ID;
|
|
87
|
+
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
88
|
+
}
|
|
83
89
|
get memory() {
|
|
84
90
|
let memory = getMemoryContainer(this);
|
|
85
91
|
this.children.forEach((child) => {
|
|
@@ -95,8 +101,12 @@ var CanvasContainer = class extends pixi_js.Container {
|
|
|
95
101
|
}
|
|
96
102
|
};
|
|
97
103
|
function getMemoryContainer(element) {
|
|
104
|
+
let className = "CanvasContainer";
|
|
105
|
+
if (element.hasOwnProperty("pixivnId")) {
|
|
106
|
+
className = element.pixivnId;
|
|
107
|
+
}
|
|
98
108
|
return {
|
|
99
|
-
|
|
109
|
+
pixivnId: className,
|
|
100
110
|
elements: [],
|
|
101
111
|
width: element.width,
|
|
102
112
|
height: element.height,
|
|
@@ -220,43 +230,47 @@ function eventDecorator(name) {
|
|
|
220
230
|
if (registeredEvents[name]) {
|
|
221
231
|
console.info(`[Pixi'VN] Event ${name} already exists, it will be overwritten`);
|
|
222
232
|
}
|
|
233
|
+
target.prototype.id = name;
|
|
223
234
|
registeredEvents[name] = target;
|
|
224
235
|
};
|
|
225
236
|
}
|
|
226
|
-
function
|
|
237
|
+
function getEventTypeById(eventId) {
|
|
227
238
|
try {
|
|
228
|
-
let eventType = registeredEvents[
|
|
239
|
+
let eventType = registeredEvents[eventId];
|
|
229
240
|
if (!eventType) {
|
|
230
|
-
console.error(`[Pixi'VN] Event ${
|
|
241
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
231
242
|
return;
|
|
232
243
|
}
|
|
233
244
|
new eventType();
|
|
234
245
|
return eventType;
|
|
235
246
|
} catch (e) {
|
|
236
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
247
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
237
248
|
return;
|
|
238
249
|
}
|
|
239
250
|
}
|
|
240
|
-
function
|
|
251
|
+
function getEventInstanceById(eventId) {
|
|
241
252
|
try {
|
|
242
|
-
let eventType = registeredEvents[
|
|
253
|
+
let eventType = registeredEvents[eventId];
|
|
243
254
|
if (!eventType) {
|
|
244
|
-
console.error(`[Pixi'VN] Event ${
|
|
255
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
245
256
|
return;
|
|
246
257
|
}
|
|
247
258
|
let event = new eventType();
|
|
248
259
|
return event;
|
|
249
260
|
} catch (e) {
|
|
250
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
261
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
251
262
|
return;
|
|
252
263
|
}
|
|
253
264
|
}
|
|
254
265
|
|
|
255
266
|
// src/classes/canvas/CanvasSprite.ts
|
|
267
|
+
var CANVAS_SPRITE_ID = "CanvasSprite";
|
|
256
268
|
var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
257
|
-
constructor() {
|
|
258
|
-
super(
|
|
269
|
+
constructor(options) {
|
|
270
|
+
super(options);
|
|
271
|
+
this.pixivnId = CANVAS_SPRITE_ID;
|
|
259
272
|
this._onEvents = {};
|
|
273
|
+
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
260
274
|
}
|
|
261
275
|
get memory() {
|
|
262
276
|
return getMemorySprite(this);
|
|
@@ -297,9 +311,9 @@ var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
|
297
311
|
* ```
|
|
298
312
|
*/
|
|
299
313
|
onEvent(event, eventClass) {
|
|
300
|
-
let
|
|
301
|
-
let instance =
|
|
302
|
-
this._onEvents[event] =
|
|
314
|
+
let id = eventClass.prototype.id;
|
|
315
|
+
let instance = getEventInstanceById(id);
|
|
316
|
+
this._onEvents[event] = id;
|
|
303
317
|
if (instance) {
|
|
304
318
|
super.on(event, () => {
|
|
305
319
|
instance.fn(event, this);
|
|
@@ -328,7 +342,7 @@ var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
|
328
342
|
function getMemorySprite(element) {
|
|
329
343
|
let temp = getMemoryContainer(element);
|
|
330
344
|
return __spreadProps(__spreadValues({}, temp), {
|
|
331
|
-
|
|
345
|
+
pixivnId: element.pixivnId,
|
|
332
346
|
textureImage: getTextureMemory(element.texture),
|
|
333
347
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
334
348
|
roundPixels: element.roundPixels,
|
|
@@ -351,8 +365,8 @@ function setMemorySprite(element, memory) {
|
|
|
351
365
|
}
|
|
352
366
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
353
367
|
for (let event in memory.onEvents) {
|
|
354
|
-
let
|
|
355
|
-
let instance =
|
|
368
|
+
let id = memory.onEvents[event];
|
|
369
|
+
let instance = getEventTypeById(id);
|
|
356
370
|
if (instance) {
|
|
357
371
|
element.onEvent(event, instance);
|
|
358
372
|
}
|
|
@@ -360,9 +374,11 @@ function setMemorySprite(element, memory) {
|
|
|
360
374
|
}
|
|
361
375
|
|
|
362
376
|
// src/classes/canvas/CanvasImage.ts
|
|
377
|
+
var CANVAS_IMAGE_ID = "CanvasImage";
|
|
363
378
|
var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
364
379
|
constructor(options, imageLink) {
|
|
365
380
|
super(options);
|
|
381
|
+
this.pixivnId = CANVAS_IMAGE_ID;
|
|
366
382
|
this.imageLink = "";
|
|
367
383
|
if (imageLink) {
|
|
368
384
|
this.imageLink = imageLink;
|
|
@@ -370,12 +386,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
370
386
|
}
|
|
371
387
|
get memory() {
|
|
372
388
|
return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
|
|
373
|
-
|
|
374
|
-
|
|
389
|
+
pixivnId: this.pixivnId,
|
|
390
|
+
imageLink: this.imageLink
|
|
375
391
|
});
|
|
376
392
|
}
|
|
377
393
|
set memory(memory) {
|
|
378
394
|
setMemorySprite(this, memory);
|
|
395
|
+
this.imageLink = memory.imageLink;
|
|
379
396
|
}
|
|
380
397
|
static from(source, skipCache) {
|
|
381
398
|
let sprite = pixi_js.Sprite.from(source, skipCache);
|
|
@@ -403,10 +420,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
403
420
|
});
|
|
404
421
|
}
|
|
405
422
|
};
|
|
423
|
+
var CANVAS_TEXT_ID = "CanvasText";
|
|
406
424
|
var CanvasText = class extends pixi_js.Text {
|
|
407
|
-
constructor() {
|
|
408
|
-
super(
|
|
425
|
+
constructor(options) {
|
|
426
|
+
super(options);
|
|
427
|
+
this.pixivnId = CANVAS_TEXT_ID;
|
|
409
428
|
this._onEvents = {};
|
|
429
|
+
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
410
430
|
}
|
|
411
431
|
get memory() {
|
|
412
432
|
return getMemoryText(this);
|
|
@@ -447,9 +467,9 @@ var CanvasText = class extends pixi_js.Text {
|
|
|
447
467
|
* ```
|
|
448
468
|
*/
|
|
449
469
|
onEvent(event, eventClass) {
|
|
450
|
-
let
|
|
451
|
-
let instance =
|
|
452
|
-
this._onEvents[event] =
|
|
470
|
+
let id = eventClass.prototype.id;
|
|
471
|
+
let instance = getEventInstanceById(id);
|
|
472
|
+
this._onEvents[event] = id;
|
|
453
473
|
if (instance) {
|
|
454
474
|
super.on(event, () => {
|
|
455
475
|
instance.fn(event, this);
|
|
@@ -472,7 +492,7 @@ var CanvasText = class extends pixi_js.Text {
|
|
|
472
492
|
function getMemoryText(element) {
|
|
473
493
|
let temp = getMemoryContainer(element);
|
|
474
494
|
return __spreadProps(__spreadValues({}, temp), {
|
|
475
|
-
|
|
495
|
+
pixivnId: element.pixivnId,
|
|
476
496
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
477
497
|
text: element.text,
|
|
478
498
|
resolution: element.resolution,
|
|
@@ -495,8 +515,8 @@ function setMemoryText(element, memory) {
|
|
|
495
515
|
memory.style && (element.style = memory.style);
|
|
496
516
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
497
517
|
for (let event in memory.onEvents) {
|
|
498
|
-
let
|
|
499
|
-
let instance =
|
|
518
|
+
let id = memory.onEvents[event];
|
|
519
|
+
let instance = getEventTypeById(id);
|
|
500
520
|
if (instance) {
|
|
501
521
|
element.onEvent(event, instance);
|
|
502
522
|
}
|
|
@@ -513,31 +533,32 @@ function canvasElementDecorator(name) {
|
|
|
513
533
|
if (registeredCanvasElement[name]) {
|
|
514
534
|
console.warn(`[Pixi'VN] CanvasElement ${name} already registered`);
|
|
515
535
|
}
|
|
536
|
+
target.prototype.pixivnId = name;
|
|
516
537
|
registeredCanvasElement[name] = target;
|
|
517
538
|
};
|
|
518
539
|
}
|
|
519
|
-
function
|
|
540
|
+
function getCanvasElementInstanceById(canvasId) {
|
|
520
541
|
try {
|
|
521
|
-
let eventType = registeredCanvasElement[
|
|
542
|
+
let eventType = registeredCanvasElement[canvasId];
|
|
522
543
|
if (!eventType) {
|
|
523
|
-
if (
|
|
544
|
+
if (canvasId === CANVAS_CONTAINER_ID) {
|
|
524
545
|
eventType = CanvasContainer;
|
|
525
|
-
} else if (
|
|
546
|
+
} else if (canvasId === CANVAS_IMAGE_ID) {
|
|
526
547
|
eventType = CanvasImage;
|
|
527
|
-
} else if (
|
|
548
|
+
} else if (canvasId === CANVAS_SPRITE_ID) {
|
|
528
549
|
eventType = CanvasSprite;
|
|
529
|
-
} else if (
|
|
550
|
+
} else if (canvasId === CANVAS_TEXT_ID) {
|
|
530
551
|
eventType = CanvasText;
|
|
531
552
|
}
|
|
532
553
|
}
|
|
533
554
|
if (!eventType) {
|
|
534
|
-
console.error(`[Pixi'VN] CanvasElement ${
|
|
555
|
+
console.error(`[Pixi'VN] CanvasElement ${canvasId} not found`);
|
|
535
556
|
return;
|
|
536
557
|
}
|
|
537
558
|
let canvasElement = new eventType();
|
|
538
559
|
return canvasElement;
|
|
539
560
|
} catch (e) {
|
|
540
|
-
console.error(`[Pixi'VN] Error while getting CanvasElement ${
|
|
561
|
+
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasId}`, e);
|
|
541
562
|
return;
|
|
542
563
|
}
|
|
543
564
|
}
|
|
@@ -589,7 +610,7 @@ var Label = class {
|
|
|
589
610
|
this._choiseIndex = choiseIndex;
|
|
590
611
|
}
|
|
591
612
|
/**
|
|
592
|
-
* Get the id of the label
|
|
613
|
+
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
593
614
|
*/
|
|
594
615
|
get id() {
|
|
595
616
|
return this._id;
|
|
@@ -649,9 +670,14 @@ var TickerBase = class {
|
|
|
649
670
|
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
650
671
|
*/
|
|
651
672
|
constructor(args, duration, priority) {
|
|
673
|
+
/**
|
|
674
|
+
* Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}
|
|
675
|
+
*/
|
|
676
|
+
this.id = "ticker_id_not_set";
|
|
652
677
|
this.args = args;
|
|
653
678
|
this.duration = duration;
|
|
654
679
|
this.priority = priority;
|
|
680
|
+
this.id = this.constructor.prototype.id;
|
|
655
681
|
}
|
|
656
682
|
/**
|
|
657
683
|
* The method that will be called every frame.
|
|
@@ -874,8 +900,8 @@ var ZoomTicker = class extends TickerBase {
|
|
|
874
900
|
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
875
901
|
}
|
|
876
902
|
let type = args.type || "zoom";
|
|
877
|
-
let xLimit = Infinity;
|
|
878
|
-
let yLimit = Infinity;
|
|
903
|
+
let xLimit = type === "zoom" ? Infinity : 0;
|
|
904
|
+
let yLimit = type === "zoom" ? Infinity : 0;
|
|
879
905
|
if (args.limit) {
|
|
880
906
|
if (typeof args.limit === "number") {
|
|
881
907
|
xLimit = args.limit;
|
|
@@ -914,7 +940,7 @@ var ZoomTicker = class extends TickerBase {
|
|
|
914
940
|
if (element.scale.x >= xLimit && element.scale.y >= yLimit) {
|
|
915
941
|
element.scale.x = xLimit;
|
|
916
942
|
element.scale.y = yLimit;
|
|
917
|
-
|
|
943
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
918
944
|
}
|
|
919
945
|
} else if (type === "unzoom") {
|
|
920
946
|
if (element.scale.x < xLimit) {
|
|
@@ -926,17 +952,20 @@ var ZoomTicker = class extends TickerBase {
|
|
|
926
952
|
if (element.scale.x <= xLimit && element.scale.y <= yLimit) {
|
|
927
953
|
element.scale.x = xLimit;
|
|
928
954
|
element.scale.y = yLimit;
|
|
929
|
-
|
|
955
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
930
956
|
}
|
|
931
957
|
}
|
|
932
958
|
if (xSpeed < 1e-5 && ySpeed < 1e-5 && !(args.speedProgression && args.speedProgression.type == "linear" && args.speedProgression.amt != 0)) {
|
|
933
|
-
|
|
959
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
934
960
|
}
|
|
935
961
|
}
|
|
936
962
|
});
|
|
937
963
|
if (args.speedProgression)
|
|
938
964
|
updateTickerProgression(args, "speed", args.speedProgression);
|
|
939
965
|
}
|
|
966
|
+
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
967
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
968
|
+
}
|
|
940
969
|
};
|
|
941
970
|
ZoomTicker = __decorateClass([
|
|
942
971
|
tickerDecorator()
|
|
@@ -966,19 +995,20 @@ function tickerDecorator(name) {
|
|
|
966
995
|
if (registeredTickers[name]) {
|
|
967
996
|
console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`);
|
|
968
997
|
}
|
|
998
|
+
target.prototype.id = name;
|
|
969
999
|
registeredTickers[name] = target;
|
|
970
1000
|
};
|
|
971
1001
|
}
|
|
972
|
-
function
|
|
1002
|
+
function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
973
1003
|
try {
|
|
974
|
-
let ticker = registeredTickers[
|
|
1004
|
+
let ticker = registeredTickers[tickerId];
|
|
975
1005
|
if (!ticker) {
|
|
976
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
1006
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
977
1007
|
return;
|
|
978
1008
|
}
|
|
979
1009
|
return new ticker(args, duration, priority);
|
|
980
1010
|
} catch (e) {
|
|
981
|
-
console.error(`[Pixi'VN] Error while getting Ticker ${
|
|
1011
|
+
console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e);
|
|
982
1012
|
return;
|
|
983
1013
|
}
|
|
984
1014
|
}
|
|
@@ -1307,18 +1337,18 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1307
1337
|
* ```
|
|
1308
1338
|
*/
|
|
1309
1339
|
static addTicker(canvasElementTag, ticker) {
|
|
1310
|
-
let
|
|
1340
|
+
let tickerId = ticker.id;
|
|
1311
1341
|
if (typeof canvasElementTag === "string") {
|
|
1312
1342
|
canvasElementTag = [canvasElementTag];
|
|
1313
1343
|
}
|
|
1314
|
-
if (!
|
|
1315
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
1344
|
+
if (!geTickerInstanceById(tickerId, ticker.args, ticker.duration, ticker.priority)) {
|
|
1345
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
1316
1346
|
return;
|
|
1317
1347
|
}
|
|
1318
1348
|
let tickerHistory = {
|
|
1319
1349
|
fn: () => {
|
|
1320
1350
|
},
|
|
1321
|
-
|
|
1351
|
+
id: tickerId,
|
|
1322
1352
|
args: createExportableElement(ticker.args),
|
|
1323
1353
|
canvasElementTags: canvasElementTag,
|
|
1324
1354
|
priority: ticker.priority,
|
|
@@ -1334,11 +1364,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1334
1364
|
_GameWindowManager.removeTicker(id);
|
|
1335
1365
|
}
|
|
1336
1366
|
}, ticker.duration * 1e3);
|
|
1337
|
-
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag,
|
|
1367
|
+
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag, tickerId, timeout.toString(), true);
|
|
1338
1368
|
}
|
|
1339
1369
|
}
|
|
1340
1370
|
static pushTicker(id, tickerData, ticker) {
|
|
1341
|
-
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags,
|
|
1371
|
+
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags, ticker);
|
|
1342
1372
|
_GameWindowManager._currentTickers[id] = tickerData;
|
|
1343
1373
|
tickerData.fn = (t) => {
|
|
1344
1374
|
let data = _GameWindowManager._currentTickers[id];
|
|
@@ -1379,9 +1409,9 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1379
1409
|
if (step.hasOwnProperty("type") && step.type === "pause") {
|
|
1380
1410
|
return step;
|
|
1381
1411
|
}
|
|
1382
|
-
let
|
|
1412
|
+
let tickerId = step.id;
|
|
1383
1413
|
return {
|
|
1384
|
-
ticker:
|
|
1414
|
+
ticker: tickerId,
|
|
1385
1415
|
args: createExportableElement(step.args),
|
|
1386
1416
|
duration: step.duration
|
|
1387
1417
|
};
|
|
@@ -1419,16 +1449,16 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1419
1449
|
_GameWindowManager.addTickerTimeoutInfo(tag, "steps", timeout.toString(), false);
|
|
1420
1450
|
return;
|
|
1421
1451
|
}
|
|
1422
|
-
let ticker =
|
|
1452
|
+
let ticker = geTickerInstanceById(step.ticker, step.args, step.duration, step.priority);
|
|
1423
1453
|
if (!ticker) {
|
|
1424
1454
|
console.error(`[Pixi'VN] Ticker ${step.ticker} not found`);
|
|
1425
1455
|
return;
|
|
1426
1456
|
}
|
|
1427
|
-
let tickerName = ticker.
|
|
1457
|
+
let tickerName = ticker.id;
|
|
1428
1458
|
let tickerHistory = {
|
|
1429
1459
|
fn: () => {
|
|
1430
1460
|
},
|
|
1431
|
-
|
|
1461
|
+
id: tickerName,
|
|
1432
1462
|
args: createExportableElement(ticker.args),
|
|
1433
1463
|
canvasElementTags: [tag],
|
|
1434
1464
|
priority: ticker.priority,
|
|
@@ -1485,26 +1515,26 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1485
1515
|
* ```
|
|
1486
1516
|
*/
|
|
1487
1517
|
static removeAssociationBetweenTickerCanvasElement(tags, ticker) {
|
|
1488
|
-
let
|
|
1518
|
+
let tickerId;
|
|
1489
1519
|
if (typeof ticker === "string") {
|
|
1490
|
-
|
|
1520
|
+
tickerId = ticker;
|
|
1491
1521
|
} else if (ticker instanceof TickerBase) {
|
|
1492
|
-
|
|
1522
|
+
tickerId = ticker.id;
|
|
1493
1523
|
} else {
|
|
1494
|
-
|
|
1524
|
+
tickerId = ticker.prototype.id;
|
|
1495
1525
|
}
|
|
1496
1526
|
if (typeof tags === "string") {
|
|
1497
1527
|
tags = [tags];
|
|
1498
1528
|
}
|
|
1499
1529
|
for (let id in _GameWindowManager._currentTickers) {
|
|
1500
1530
|
let ticker2 = _GameWindowManager._currentTickers[id];
|
|
1501
|
-
if (ticker2.
|
|
1531
|
+
if (ticker2.id === tickerId) {
|
|
1502
1532
|
_GameWindowManager._currentTickers[id].canvasElementTags = ticker2.canvasElementTags.filter((e) => !tags.includes(e));
|
|
1503
1533
|
}
|
|
1504
1534
|
}
|
|
1505
1535
|
for (let timeout in _GameWindowManager._currentTickersTimeouts) {
|
|
1506
1536
|
let TickerTimeout = _GameWindowManager._currentTickersTimeouts[timeout];
|
|
1507
|
-
if (TickerTimeout.ticker ===
|
|
1537
|
+
if (TickerTimeout.ticker === tickerId && TickerTimeout.canBeDeletedBeforeEnd) {
|
|
1508
1538
|
_GameWindowManager._currentTickersTimeouts[timeout].tags = TickerTimeout.tags.filter((t) => !tags.includes(t));
|
|
1509
1539
|
}
|
|
1510
1540
|
}
|
|
@@ -1690,11 +1720,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1690
1720
|
for (let id in currentTickers) {
|
|
1691
1721
|
let t = currentTickers[id];
|
|
1692
1722
|
let tags = t.canvasElementTags;
|
|
1693
|
-
let ticker =
|
|
1723
|
+
let ticker = geTickerInstanceById(t.id, t.args, t.duration, t.priority);
|
|
1694
1724
|
if (ticker) {
|
|
1695
1725
|
_GameWindowManager.addTicker(tags, ticker);
|
|
1696
1726
|
} else {
|
|
1697
|
-
console.error(`[Pixi'VN] Ticker ${t.
|
|
1727
|
+
console.error(`[Pixi'VN] Ticker ${t.id} not found`);
|
|
1698
1728
|
}
|
|
1699
1729
|
}
|
|
1700
1730
|
}
|