@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,3 +1,4 @@
|
|
|
1
1
|
import 'pixi.js';
|
|
2
|
-
export { a as TickerArgsType, T as default } from '../../TickerBase-
|
|
2
|
+
export { a as TickerArgsType, T as default } from '../../TickerBase-DKYzbzro.mjs';
|
|
3
3
|
import '../../types/StorageElementType.mjs';
|
|
4
|
+
import '../../types/TickerIdType.mjs';
|
|
@@ -8,9 +8,14 @@ var TickerBase = class {
|
|
|
8
8
|
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
9
9
|
*/
|
|
10
10
|
constructor(args, duration, priority) {
|
|
11
|
+
/**
|
|
12
|
+
* Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}
|
|
13
|
+
*/
|
|
14
|
+
this.id = "ticker_id_not_set";
|
|
11
15
|
this.args = args;
|
|
12
16
|
this.duration = duration;
|
|
13
17
|
this.priority = priority;
|
|
18
|
+
this.id = this.constructor.prototype.id;
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
21
|
* The method that will be called every frame.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/classes/ticker/TickerBase.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../../src/classes/ticker/TickerBase.ts"],"names":[],"mappings":";AA6CA,IAAqB,aAArB,MAAwF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpF,YAAY,MAAa,UAAmB,UAA4B;AASxE;AAAA;AAAA;AAAA,cAAmB;AARf,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,WAAW;AAChB,SAAK,KAAK,KAAK,YAAY,UAAU;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,GAAG,SAAiB,OAAc,OAA0B,WAAyB;AAAE,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAAE;AACtK","sourcesContent":["import { Ticker, UPDATE_PRIORITY } from \"pixi.js\"\nimport { tickerDecorator } from \"../../decorators\"\nimport { geTickerInstanceById } from \"../../decorators/TickerDecorator\"\nimport ITicker from \"../../interface/ITicker\"\nimport { GameWindowManager } from \"../../managers\"\nimport { StorageElementType } from \"../../types/StorageElementType\"\nimport { TickerIdType } from \"../../types/TickerIdType\"\n\nexport type TickerArgsType = { [id: string]: StorageElementType } | {\n tagToRemoveAfter?: string[] | string,\n [id: string]: StorageElementType\n}[]\n\n/**\n * A class is used to create a ticker element to add into a Pixi Application.\n * You can use GameWindowManager.addTicker() to add this element into the application.\n * This class should be extended and the fn method should be overridden.\n * You must use the {@link tickerDecorator} to register the ticker in the game.\n * In Ren'Py is a transform.\n * @example\n * ```typescript\n * \\@tickerDecorator() // this is equivalent to tickerDecorator(\"RotateTicker\")\n * export class RotateTicker extends TickerBase<{ speed?: number }> {\n * override fn(\n * t: Ticker, // the ticker that is calling this method\n * args: { // the arguments that you passed when you added the ticker\n * speed?: number,\n * },\n * tags: string[], // the tags of the canvas elements that are connected to this ticker\n * tickerId: string, // the id of the ticker. You can use this to get the ticker from the GameWindowManager.currentTickers\n * ): void {\n * let speed = args.speed === undefined ? 0.1 : args.speed\n * tags.forEach((tag) => {\n * let element = GameWindowManager.getCanvasElement(tag)\n * if (element && element instanceof Container) {\n * if (clockwise)\n * element.rotation += speed * t.deltaTime\n * else\n * element.rotation -= speed * t.deltaTime\n * }\n * })\n * }\n * }\n * ```\n */\nexport default class TickerBase<TArgs extends TickerArgsType> implements ITicker<TArgs> {\n /**\n * @param args The arguments that you want to pass to the ticker.\n * @param duration The duration of the ticker in seconds. If is undefined, the step will end only when the animation is finished (if the animation doesn't have a goal to reach then it won't finish). @default undefined\n * @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL\n */\n constructor(args: TArgs, duration?: number, priority?: UPDATE_PRIORITY) {\n this.args = args\n this.duration = duration\n this.priority = priority\n this.id = this.constructor.prototype.id\n }\n /**\n * Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}\n */\n id: TickerIdType = 'ticker_id_not_set'\n args: TArgs\n duration?: number\n priority?: UPDATE_PRIORITY\n /**\n * The method that will be called every frame.\n * This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.\n * @param _ticker The ticker that is calling this method\n * @param _args The arguments that you passed when you added the ticker\n * @param _tags The tags of the canvas elements that are connected to this ticker\n * @param _tickerId The id of the ticker. You can use this to get the ticker from the {@link GameWindowManager.currentTickers}\n */\n fn(_ticker: Ticker, _args: TArgs, _tags: string | string[], _tickerId: string): void { throw new Error(\"[Pixi'VN] The method TickerBase.fn() must be overridden\") }\n}\n"]}
|
|
@@ -6,9 +6,14 @@ var TickerBase = class {
|
|
|
6
6
|
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
7
7
|
*/
|
|
8
8
|
constructor(args, duration, priority) {
|
|
9
|
+
/**
|
|
10
|
+
* Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}
|
|
11
|
+
*/
|
|
12
|
+
this.id = "ticker_id_not_set";
|
|
9
13
|
this.args = args;
|
|
10
14
|
this.duration = duration;
|
|
11
15
|
this.priority = priority;
|
|
16
|
+
this.id = this.constructor.prototype.id;
|
|
12
17
|
}
|
|
13
18
|
/**
|
|
14
19
|
* The method that will be called every frame.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/classes/ticker/TickerBase.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../../src/classes/ticker/TickerBase.ts"],"names":[],"mappings":";AA6CA,IAAqB,aAArB,MAAwF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpF,YAAY,MAAa,UAAmB,UAA4B;AASxE;AAAA;AAAA;AAAA,cAAmB;AARf,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,WAAW;AAChB,SAAK,KAAK,KAAK,YAAY,UAAU;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,GAAG,SAAiB,OAAc,OAA0B,WAAyB;AAAE,UAAM,IAAI,MAAM,yDAAyD;AAAA,EAAE;AACtK","sourcesContent":["import { Ticker, UPDATE_PRIORITY } from \"pixi.js\"\nimport { tickerDecorator } from \"../../decorators\"\nimport { geTickerInstanceById } from \"../../decorators/TickerDecorator\"\nimport ITicker from \"../../interface/ITicker\"\nimport { GameWindowManager } from \"../../managers\"\nimport { StorageElementType } from \"../../types/StorageElementType\"\nimport { TickerIdType } from \"../../types/TickerIdType\"\n\nexport type TickerArgsType = { [id: string]: StorageElementType } | {\n tagToRemoveAfter?: string[] | string,\n [id: string]: StorageElementType\n}[]\n\n/**\n * A class is used to create a ticker element to add into a Pixi Application.\n * You can use GameWindowManager.addTicker() to add this element into the application.\n * This class should be extended and the fn method should be overridden.\n * You must use the {@link tickerDecorator} to register the ticker in the game.\n * In Ren'Py is a transform.\n * @example\n * ```typescript\n * \\@tickerDecorator() // this is equivalent to tickerDecorator(\"RotateTicker\")\n * export class RotateTicker extends TickerBase<{ speed?: number }> {\n * override fn(\n * t: Ticker, // the ticker that is calling this method\n * args: { // the arguments that you passed when you added the ticker\n * speed?: number,\n * },\n * tags: string[], // the tags of the canvas elements that are connected to this ticker\n * tickerId: string, // the id of the ticker. You can use this to get the ticker from the GameWindowManager.currentTickers\n * ): void {\n * let speed = args.speed === undefined ? 0.1 : args.speed\n * tags.forEach((tag) => {\n * let element = GameWindowManager.getCanvasElement(tag)\n * if (element && element instanceof Container) {\n * if (clockwise)\n * element.rotation += speed * t.deltaTime\n * else\n * element.rotation -= speed * t.deltaTime\n * }\n * })\n * }\n * }\n * ```\n */\nexport default class TickerBase<TArgs extends TickerArgsType> implements ITicker<TArgs> {\n /**\n * @param args The arguments that you want to pass to the ticker.\n * @param duration The duration of the ticker in seconds. If is undefined, the step will end only when the animation is finished (if the animation doesn't have a goal to reach then it won't finish). @default undefined\n * @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL\n */\n constructor(args: TArgs, duration?: number, priority?: UPDATE_PRIORITY) {\n this.args = args\n this.duration = duration\n this.priority = priority\n this.id = this.constructor.prototype.id\n }\n /**\n * Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}\n */\n id: TickerIdType = 'ticker_id_not_set'\n args: TArgs\n duration?: number\n priority?: UPDATE_PRIORITY\n /**\n * The method that will be called every frame.\n * This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.\n * @param _ticker The ticker that is calling this method\n * @param _args The arguments that you passed when you added the ticker\n * @param _tags The tags of the canvas elements that are connected to this ticker\n * @param _tickerId The id of the ticker. You can use this to get the ticker from the {@link GameWindowManager.currentTickers}\n */\n fn(_ticker: Ticker, _args: TArgs, _tags: string | string[], _tickerId: string): void { throw new Error(\"[Pixi'VN] The method TickerBase.fn() must be overridden\") }\n}\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Ticker } from 'pixi.js';
|
|
2
|
-
import { T as TickerBase } from '../../TickerBase-
|
|
1
|
+
import { Ticker, Container, UPDATE_PRIORITY, ContainerChild } from 'pixi.js';
|
|
2
|
+
import { T as TickerBase } from '../../TickerBase-DKYzbzro.mjs';
|
|
3
3
|
import { ZoomTickerProps } from '../../types/ticker/ZoomTickerProps.mjs';
|
|
4
4
|
import '../../types/StorageElementType.mjs';
|
|
5
|
+
import '../../types/TickerIdType.mjs';
|
|
5
6
|
import '../../interface/TickerProgrationType.mjs';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -20,6 +21,11 @@ import '../../interface/TickerProgrationType.mjs';
|
|
|
20
21
|
*/
|
|
21
22
|
declare class ZoomTicker extends TickerBase<ZoomTickerProps> {
|
|
22
23
|
fn(ticker: Ticker, args: ZoomTickerProps, tags: string[], tickerId: string): void;
|
|
24
|
+
onEndOfTicker<T extends Container = Container>(tag: string, tickerId: string, _element: T, tagToRemoveAfter: string[] | string): void;
|
|
25
|
+
}
|
|
26
|
+
declare class ZoomInOutTicker extends ZoomTicker {
|
|
27
|
+
constructor(props: ZoomTickerProps, duration?: number, priority?: UPDATE_PRIORITY);
|
|
28
|
+
onEndOfTicker<T extends Container = Container<ContainerChild>>(tag: string, tickerId: string, element: T, tagToRemoveAfter: string[] | string): void;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
export { ZoomTicker as default };
|
|
31
|
+
export { ZoomInOutTicker, ZoomTicker as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Ticker } from 'pixi.js';
|
|
2
|
-
import { T as TickerBase } from '../../TickerBase-
|
|
1
|
+
import { Ticker, Container, UPDATE_PRIORITY, ContainerChild } from 'pixi.js';
|
|
2
|
+
import { T as TickerBase } from '../../TickerBase-3rLpDpmb.js';
|
|
3
3
|
import { ZoomTickerProps } from '../../types/ticker/ZoomTickerProps.js';
|
|
4
4
|
import '../../types/StorageElementType.js';
|
|
5
|
+
import '../../types/TickerIdType.js';
|
|
5
6
|
import '../../interface/TickerProgrationType.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -20,6 +21,11 @@ import '../../interface/TickerProgrationType.js';
|
|
|
20
21
|
*/
|
|
21
22
|
declare class ZoomTicker extends TickerBase<ZoomTickerProps> {
|
|
22
23
|
fn(ticker: Ticker, args: ZoomTickerProps, tags: string[], tickerId: string): void;
|
|
24
|
+
onEndOfTicker<T extends Container = Container>(tag: string, tickerId: string, _element: T, tagToRemoveAfter: string[] | string): void;
|
|
25
|
+
}
|
|
26
|
+
declare class ZoomInOutTicker extends ZoomTicker {
|
|
27
|
+
constructor(props: ZoomTickerProps, duration?: number, priority?: UPDATE_PRIORITY);
|
|
28
|
+
onEndOfTicker<T extends Container = Container<ContainerChild>>(tag: string, tickerId: string, element: T, tagToRemoveAfter: string[] | string): void;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
export { ZoomTicker as default };
|
|
31
|
+
export { ZoomInOutTicker, ZoomTicker as default };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var pixi_js = require('pixi.js');
|
|
4
6
|
require('deep-diff');
|
|
5
7
|
var sha1 = require('crypto-js/sha1');
|
|
@@ -69,17 +71,23 @@ function exportCanvasElement(element) {
|
|
|
69
71
|
return element.memory;
|
|
70
72
|
}
|
|
71
73
|
function importCanvasElement(memory) {
|
|
72
|
-
let element =
|
|
74
|
+
let element = getCanvasElementInstanceById(memory.pixivnId);
|
|
73
75
|
if (element) {
|
|
74
76
|
element.memory = memory;
|
|
75
77
|
} else {
|
|
76
|
-
throw new Error("[Pixi'VN] The element " + memory.
|
|
78
|
+
throw new Error("[Pixi'VN] The element " + memory.pixivnId + " could not be created");
|
|
77
79
|
}
|
|
78
80
|
return element;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
// src/classes/canvas/CanvasContainer.ts
|
|
84
|
+
var CANVAS_CONTAINER_ID = "CanvasContainer";
|
|
82
85
|
var CanvasContainer = class extends pixi_js.Container {
|
|
86
|
+
constructor(options) {
|
|
87
|
+
super(options);
|
|
88
|
+
this.pixivnId = CANVAS_CONTAINER_ID;
|
|
89
|
+
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
90
|
+
}
|
|
83
91
|
get memory() {
|
|
84
92
|
let memory = getMemoryContainer(this);
|
|
85
93
|
this.children.forEach((child) => {
|
|
@@ -95,8 +103,12 @@ var CanvasContainer = class extends pixi_js.Container {
|
|
|
95
103
|
}
|
|
96
104
|
};
|
|
97
105
|
function getMemoryContainer(element) {
|
|
106
|
+
let className = "CanvasContainer";
|
|
107
|
+
if (element.hasOwnProperty("pixivnId")) {
|
|
108
|
+
className = element.pixivnId;
|
|
109
|
+
}
|
|
98
110
|
return {
|
|
99
|
-
|
|
111
|
+
pixivnId: className,
|
|
100
112
|
elements: [],
|
|
101
113
|
width: element.width,
|
|
102
114
|
height: element.height,
|
|
@@ -212,40 +224,43 @@ function getTextStyle(style) {
|
|
|
212
224
|
|
|
213
225
|
// src/decorators/EventDecorator.ts
|
|
214
226
|
var registeredEvents = {};
|
|
215
|
-
function
|
|
227
|
+
function getEventTypeById(eventId) {
|
|
216
228
|
try {
|
|
217
|
-
let eventType = registeredEvents[
|
|
229
|
+
let eventType = registeredEvents[eventId];
|
|
218
230
|
if (!eventType) {
|
|
219
|
-
console.error(`[Pixi'VN] Event ${
|
|
231
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
220
232
|
return;
|
|
221
233
|
}
|
|
222
234
|
new eventType();
|
|
223
235
|
return eventType;
|
|
224
236
|
} catch (e) {
|
|
225
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
237
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
226
238
|
return;
|
|
227
239
|
}
|
|
228
240
|
}
|
|
229
|
-
function
|
|
241
|
+
function getEventInstanceById(eventId) {
|
|
230
242
|
try {
|
|
231
|
-
let eventType = registeredEvents[
|
|
243
|
+
let eventType = registeredEvents[eventId];
|
|
232
244
|
if (!eventType) {
|
|
233
|
-
console.error(`[Pixi'VN] Event ${
|
|
245
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
234
246
|
return;
|
|
235
247
|
}
|
|
236
248
|
let event = new eventType();
|
|
237
249
|
return event;
|
|
238
250
|
} catch (e) {
|
|
239
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
251
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
240
252
|
return;
|
|
241
253
|
}
|
|
242
254
|
}
|
|
243
255
|
|
|
244
256
|
// src/classes/canvas/CanvasSprite.ts
|
|
257
|
+
var CANVAS_SPRITE_ID = "CanvasSprite";
|
|
245
258
|
var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
246
|
-
constructor() {
|
|
247
|
-
super(
|
|
259
|
+
constructor(options) {
|
|
260
|
+
super(options);
|
|
261
|
+
this.pixivnId = CANVAS_SPRITE_ID;
|
|
248
262
|
this._onEvents = {};
|
|
263
|
+
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
249
264
|
}
|
|
250
265
|
get memory() {
|
|
251
266
|
return getMemorySprite(this);
|
|
@@ -286,9 +301,9 @@ var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
|
286
301
|
* ```
|
|
287
302
|
*/
|
|
288
303
|
onEvent(event, eventClass) {
|
|
289
|
-
let
|
|
290
|
-
let instance =
|
|
291
|
-
this._onEvents[event] =
|
|
304
|
+
let id = eventClass.prototype.id;
|
|
305
|
+
let instance = getEventInstanceById(id);
|
|
306
|
+
this._onEvents[event] = id;
|
|
292
307
|
if (instance) {
|
|
293
308
|
super.on(event, () => {
|
|
294
309
|
instance.fn(event, this);
|
|
@@ -317,7 +332,7 @@ var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
|
317
332
|
function getMemorySprite(element) {
|
|
318
333
|
let temp = getMemoryContainer(element);
|
|
319
334
|
return __spreadProps(__spreadValues({}, temp), {
|
|
320
|
-
|
|
335
|
+
pixivnId: element.pixivnId,
|
|
321
336
|
textureImage: getTextureMemory(element.texture),
|
|
322
337
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
323
338
|
roundPixels: element.roundPixels,
|
|
@@ -340,8 +355,8 @@ function setMemorySprite(element, memory) {
|
|
|
340
355
|
}
|
|
341
356
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
342
357
|
for (let event in memory.onEvents) {
|
|
343
|
-
let
|
|
344
|
-
let instance =
|
|
358
|
+
let id = memory.onEvents[event];
|
|
359
|
+
let instance = getEventTypeById(id);
|
|
345
360
|
if (instance) {
|
|
346
361
|
element.onEvent(event, instance);
|
|
347
362
|
}
|
|
@@ -349,9 +364,11 @@ function setMemorySprite(element, memory) {
|
|
|
349
364
|
}
|
|
350
365
|
|
|
351
366
|
// src/classes/canvas/CanvasImage.ts
|
|
367
|
+
var CANVAS_IMAGE_ID = "CanvasImage";
|
|
352
368
|
var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
353
369
|
constructor(options, imageLink) {
|
|
354
370
|
super(options);
|
|
371
|
+
this.pixivnId = CANVAS_IMAGE_ID;
|
|
355
372
|
this.imageLink = "";
|
|
356
373
|
if (imageLink) {
|
|
357
374
|
this.imageLink = imageLink;
|
|
@@ -359,12 +376,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
359
376
|
}
|
|
360
377
|
get memory() {
|
|
361
378
|
return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
|
|
362
|
-
|
|
363
|
-
|
|
379
|
+
pixivnId: this.pixivnId,
|
|
380
|
+
imageLink: this.imageLink
|
|
364
381
|
});
|
|
365
382
|
}
|
|
366
383
|
set memory(memory) {
|
|
367
384
|
setMemorySprite(this, memory);
|
|
385
|
+
this.imageLink = memory.imageLink;
|
|
368
386
|
}
|
|
369
387
|
static from(source, skipCache) {
|
|
370
388
|
let sprite = pixi_js.Sprite.from(source, skipCache);
|
|
@@ -392,10 +410,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
392
410
|
});
|
|
393
411
|
}
|
|
394
412
|
};
|
|
413
|
+
var CANVAS_TEXT_ID = "CanvasText";
|
|
395
414
|
var CanvasText = class extends pixi_js.Text {
|
|
396
|
-
constructor() {
|
|
397
|
-
super(
|
|
415
|
+
constructor(options) {
|
|
416
|
+
super(options);
|
|
417
|
+
this.pixivnId = CANVAS_TEXT_ID;
|
|
398
418
|
this._onEvents = {};
|
|
419
|
+
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
399
420
|
}
|
|
400
421
|
get memory() {
|
|
401
422
|
return getMemoryText(this);
|
|
@@ -436,9 +457,9 @@ var CanvasText = class extends pixi_js.Text {
|
|
|
436
457
|
* ```
|
|
437
458
|
*/
|
|
438
459
|
onEvent(event, eventClass) {
|
|
439
|
-
let
|
|
440
|
-
let instance =
|
|
441
|
-
this._onEvents[event] =
|
|
460
|
+
let id = eventClass.prototype.id;
|
|
461
|
+
let instance = getEventInstanceById(id);
|
|
462
|
+
this._onEvents[event] = id;
|
|
442
463
|
if (instance) {
|
|
443
464
|
super.on(event, () => {
|
|
444
465
|
instance.fn(event, this);
|
|
@@ -461,7 +482,7 @@ var CanvasText = class extends pixi_js.Text {
|
|
|
461
482
|
function getMemoryText(element) {
|
|
462
483
|
let temp = getMemoryContainer(element);
|
|
463
484
|
return __spreadProps(__spreadValues({}, temp), {
|
|
464
|
-
|
|
485
|
+
pixivnId: element.pixivnId,
|
|
465
486
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
466
487
|
text: element.text,
|
|
467
488
|
resolution: element.resolution,
|
|
@@ -484,8 +505,8 @@ function setMemoryText(element, memory) {
|
|
|
484
505
|
memory.style && (element.style = memory.style);
|
|
485
506
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
486
507
|
for (let event in memory.onEvents) {
|
|
487
|
-
let
|
|
488
|
-
let instance =
|
|
508
|
+
let id = memory.onEvents[event];
|
|
509
|
+
let instance = getEventTypeById(id);
|
|
489
510
|
if (instance) {
|
|
490
511
|
element.onEvent(event, instance);
|
|
491
512
|
}
|
|
@@ -494,28 +515,28 @@ function setMemoryText(element, memory) {
|
|
|
494
515
|
|
|
495
516
|
// src/decorators/CanvasElementDecorator.ts
|
|
496
517
|
var registeredCanvasElement = {};
|
|
497
|
-
function
|
|
518
|
+
function getCanvasElementInstanceById(canvasId) {
|
|
498
519
|
try {
|
|
499
|
-
let eventType = registeredCanvasElement[
|
|
520
|
+
let eventType = registeredCanvasElement[canvasId];
|
|
500
521
|
if (!eventType) {
|
|
501
|
-
if (
|
|
522
|
+
if (canvasId === CANVAS_CONTAINER_ID) {
|
|
502
523
|
eventType = CanvasContainer;
|
|
503
|
-
} else if (
|
|
524
|
+
} else if (canvasId === CANVAS_IMAGE_ID) {
|
|
504
525
|
eventType = CanvasImage;
|
|
505
|
-
} else if (
|
|
526
|
+
} else if (canvasId === CANVAS_SPRITE_ID) {
|
|
506
527
|
eventType = CanvasSprite;
|
|
507
|
-
} else if (
|
|
528
|
+
} else if (canvasId === CANVAS_TEXT_ID) {
|
|
508
529
|
eventType = CanvasText;
|
|
509
530
|
}
|
|
510
531
|
}
|
|
511
532
|
if (!eventType) {
|
|
512
|
-
console.error(`[Pixi'VN] CanvasElement ${
|
|
533
|
+
console.error(`[Pixi'VN] CanvasElement ${canvasId} not found`);
|
|
513
534
|
return;
|
|
514
535
|
}
|
|
515
536
|
let canvasElement = new eventType();
|
|
516
537
|
return canvasElement;
|
|
517
538
|
} catch (e) {
|
|
518
|
-
console.error(`[Pixi'VN] Error while getting CanvasElement ${
|
|
539
|
+
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasId}`, e);
|
|
519
540
|
return;
|
|
520
541
|
}
|
|
521
542
|
}
|
|
@@ -528,9 +549,14 @@ var TickerBase = class {
|
|
|
528
549
|
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
529
550
|
*/
|
|
530
551
|
constructor(args, duration, priority) {
|
|
552
|
+
/**
|
|
553
|
+
* Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}
|
|
554
|
+
*/
|
|
555
|
+
this.id = "ticker_id_not_set";
|
|
531
556
|
this.args = args;
|
|
532
557
|
this.duration = duration;
|
|
533
558
|
this.priority = priority;
|
|
559
|
+
this.id = this.constructor.prototype.id;
|
|
534
560
|
}
|
|
535
561
|
/**
|
|
536
562
|
* The method that will be called every frame.
|
|
@@ -758,19 +784,20 @@ function tickerDecorator(name) {
|
|
|
758
784
|
if (registeredTickers[name]) {
|
|
759
785
|
console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`);
|
|
760
786
|
}
|
|
787
|
+
target.prototype.id = name;
|
|
761
788
|
registeredTickers[name] = target;
|
|
762
789
|
};
|
|
763
790
|
}
|
|
764
|
-
function
|
|
791
|
+
function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
765
792
|
try {
|
|
766
|
-
let ticker = registeredTickers[
|
|
793
|
+
let ticker = registeredTickers[tickerId];
|
|
767
794
|
if (!ticker) {
|
|
768
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
795
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
769
796
|
return;
|
|
770
797
|
}
|
|
771
798
|
return new ticker(args, duration, priority);
|
|
772
799
|
} catch (e) {
|
|
773
|
-
console.error(`[Pixi'VN] Error while getting Ticker ${
|
|
800
|
+
console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e);
|
|
774
801
|
return;
|
|
775
802
|
}
|
|
776
803
|
}
|
|
@@ -1099,18 +1126,18 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1099
1126
|
* ```
|
|
1100
1127
|
*/
|
|
1101
1128
|
static addTicker(canvasElementTag, ticker) {
|
|
1102
|
-
let
|
|
1129
|
+
let tickerId = ticker.id;
|
|
1103
1130
|
if (typeof canvasElementTag === "string") {
|
|
1104
1131
|
canvasElementTag = [canvasElementTag];
|
|
1105
1132
|
}
|
|
1106
|
-
if (!
|
|
1107
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
1133
|
+
if (!geTickerInstanceById(tickerId, ticker.args, ticker.duration, ticker.priority)) {
|
|
1134
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
1108
1135
|
return;
|
|
1109
1136
|
}
|
|
1110
1137
|
let tickerHistory = {
|
|
1111
1138
|
fn: () => {
|
|
1112
1139
|
},
|
|
1113
|
-
|
|
1140
|
+
id: tickerId,
|
|
1114
1141
|
args: createExportableElement(ticker.args),
|
|
1115
1142
|
canvasElementTags: canvasElementTag,
|
|
1116
1143
|
priority: ticker.priority,
|
|
@@ -1126,11 +1153,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1126
1153
|
_GameWindowManager.removeTicker(id);
|
|
1127
1154
|
}
|
|
1128
1155
|
}, ticker.duration * 1e3);
|
|
1129
|
-
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag,
|
|
1156
|
+
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag, tickerId, timeout.toString(), true);
|
|
1130
1157
|
}
|
|
1131
1158
|
}
|
|
1132
1159
|
static pushTicker(id, tickerData, ticker) {
|
|
1133
|
-
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags,
|
|
1160
|
+
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags, ticker);
|
|
1134
1161
|
_GameWindowManager._currentTickers[id] = tickerData;
|
|
1135
1162
|
tickerData.fn = (t) => {
|
|
1136
1163
|
let data = _GameWindowManager._currentTickers[id];
|
|
@@ -1171,9 +1198,9 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1171
1198
|
if (step.hasOwnProperty("type") && step.type === "pause") {
|
|
1172
1199
|
return step;
|
|
1173
1200
|
}
|
|
1174
|
-
let
|
|
1201
|
+
let tickerId = step.id;
|
|
1175
1202
|
return {
|
|
1176
|
-
ticker:
|
|
1203
|
+
ticker: tickerId,
|
|
1177
1204
|
args: createExportableElement(step.args),
|
|
1178
1205
|
duration: step.duration
|
|
1179
1206
|
};
|
|
@@ -1211,16 +1238,16 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1211
1238
|
_GameWindowManager.addTickerTimeoutInfo(tag, "steps", timeout.toString(), false);
|
|
1212
1239
|
return;
|
|
1213
1240
|
}
|
|
1214
|
-
let ticker =
|
|
1241
|
+
let ticker = geTickerInstanceById(step.ticker, step.args, step.duration, step.priority);
|
|
1215
1242
|
if (!ticker) {
|
|
1216
1243
|
console.error(`[Pixi'VN] Ticker ${step.ticker} not found`);
|
|
1217
1244
|
return;
|
|
1218
1245
|
}
|
|
1219
|
-
let tickerName = ticker.
|
|
1246
|
+
let tickerName = ticker.id;
|
|
1220
1247
|
let tickerHistory = {
|
|
1221
1248
|
fn: () => {
|
|
1222
1249
|
},
|
|
1223
|
-
|
|
1250
|
+
id: tickerName,
|
|
1224
1251
|
args: createExportableElement(ticker.args),
|
|
1225
1252
|
canvasElementTags: [tag],
|
|
1226
1253
|
priority: ticker.priority,
|
|
@@ -1277,26 +1304,26 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1277
1304
|
* ```
|
|
1278
1305
|
*/
|
|
1279
1306
|
static removeAssociationBetweenTickerCanvasElement(tags, ticker) {
|
|
1280
|
-
let
|
|
1307
|
+
let tickerId;
|
|
1281
1308
|
if (typeof ticker === "string") {
|
|
1282
|
-
|
|
1309
|
+
tickerId = ticker;
|
|
1283
1310
|
} else if (ticker instanceof TickerBase) {
|
|
1284
|
-
|
|
1311
|
+
tickerId = ticker.id;
|
|
1285
1312
|
} else {
|
|
1286
|
-
|
|
1313
|
+
tickerId = ticker.prototype.id;
|
|
1287
1314
|
}
|
|
1288
1315
|
if (typeof tags === "string") {
|
|
1289
1316
|
tags = [tags];
|
|
1290
1317
|
}
|
|
1291
1318
|
for (let id in _GameWindowManager._currentTickers) {
|
|
1292
1319
|
let ticker2 = _GameWindowManager._currentTickers[id];
|
|
1293
|
-
if (ticker2.
|
|
1320
|
+
if (ticker2.id === tickerId) {
|
|
1294
1321
|
_GameWindowManager._currentTickers[id].canvasElementTags = ticker2.canvasElementTags.filter((e) => !tags.includes(e));
|
|
1295
1322
|
}
|
|
1296
1323
|
}
|
|
1297
1324
|
for (let timeout in _GameWindowManager._currentTickersTimeouts) {
|
|
1298
1325
|
let TickerTimeout = _GameWindowManager._currentTickersTimeouts[timeout];
|
|
1299
|
-
if (TickerTimeout.ticker ===
|
|
1326
|
+
if (TickerTimeout.ticker === tickerId && TickerTimeout.canBeDeletedBeforeEnd) {
|
|
1300
1327
|
_GameWindowManager._currentTickersTimeouts[timeout].tags = TickerTimeout.tags.filter((t) => !tags.includes(t));
|
|
1301
1328
|
}
|
|
1302
1329
|
}
|
|
@@ -1482,11 +1509,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1482
1509
|
for (let id in currentTickers) {
|
|
1483
1510
|
let t = currentTickers[id];
|
|
1484
1511
|
let tags = t.canvasElementTags;
|
|
1485
|
-
let ticker =
|
|
1512
|
+
let ticker = geTickerInstanceById(t.id, t.args, t.duration, t.priority);
|
|
1486
1513
|
if (ticker) {
|
|
1487
1514
|
_GameWindowManager.addTicker(tags, ticker);
|
|
1488
1515
|
} else {
|
|
1489
|
-
console.error(`[Pixi'VN] Ticker ${t.
|
|
1516
|
+
console.error(`[Pixi'VN] Ticker ${t.id} not found`);
|
|
1490
1517
|
}
|
|
1491
1518
|
}
|
|
1492
1519
|
}
|
|
@@ -1532,8 +1559,8 @@ exports.default = class ZoomTicker extends TickerBase {
|
|
|
1532
1559
|
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
1533
1560
|
}
|
|
1534
1561
|
let type = args.type || "zoom";
|
|
1535
|
-
let xLimit = Infinity;
|
|
1536
|
-
let yLimit = Infinity;
|
|
1562
|
+
let xLimit = type === "zoom" ? Infinity : 0;
|
|
1563
|
+
let yLimit = type === "zoom" ? Infinity : 0;
|
|
1537
1564
|
if (args.limit) {
|
|
1538
1565
|
if (typeof args.limit === "number") {
|
|
1539
1566
|
xLimit = args.limit;
|
|
@@ -1572,7 +1599,7 @@ exports.default = class ZoomTicker extends TickerBase {
|
|
|
1572
1599
|
if (element.scale.x >= xLimit && element.scale.y >= yLimit) {
|
|
1573
1600
|
element.scale.x = xLimit;
|
|
1574
1601
|
element.scale.y = yLimit;
|
|
1575
|
-
|
|
1602
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
1576
1603
|
}
|
|
1577
1604
|
} else if (type === "unzoom") {
|
|
1578
1605
|
if (element.scale.x < xLimit) {
|
|
@@ -1584,22 +1611,37 @@ exports.default = class ZoomTicker extends TickerBase {
|
|
|
1584
1611
|
if (element.scale.x <= xLimit && element.scale.y <= yLimit) {
|
|
1585
1612
|
element.scale.x = xLimit;
|
|
1586
1613
|
element.scale.y = yLimit;
|
|
1587
|
-
|
|
1614
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
1588
1615
|
}
|
|
1589
1616
|
}
|
|
1590
1617
|
if (xSpeed < 1e-5 && ySpeed < 1e-5 && !(args.speedProgression && args.speedProgression.type == "linear" && args.speedProgression.amt != 0)) {
|
|
1591
|
-
|
|
1618
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
1592
1619
|
}
|
|
1593
1620
|
}
|
|
1594
1621
|
});
|
|
1595
1622
|
if (args.speedProgression)
|
|
1596
1623
|
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1597
1624
|
}
|
|
1625
|
+
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
1626
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
1627
|
+
}
|
|
1598
1628
|
};
|
|
1599
1629
|
exports.default = __decorateClass([
|
|
1600
1630
|
tickerDecorator()
|
|
1601
1631
|
], exports.default);
|
|
1632
|
+
var ZoomInOutTicker = class extends exports.default {
|
|
1633
|
+
constructor(props, duration, priority) {
|
|
1634
|
+
super(props, duration, priority);
|
|
1635
|
+
}
|
|
1636
|
+
onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2) {
|
|
1637
|
+
if (element.children.length > 0) {
|
|
1638
|
+
let elementChild = element.children[0];
|
|
1639
|
+
GameWindowManager.addCanvasElement(tag, elementChild);
|
|
1640
|
+
}
|
|
1641
|
+
super.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1602
1644
|
|
|
1603
|
-
|
|
1645
|
+
exports.ZoomInOutTicker = ZoomInOutTicker;
|
|
1604
1646
|
//# sourceMappingURL=out.js.map
|
|
1605
1647
|
//# sourceMappingURL=ZoomTicker.js.map
|