@drincs/pixi-vn 0.4.7 → 0.4.9
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-CFEJHstJ.d.mts +73 -0
- package/dist/TickerBase-CjfyD6j5.d.ts +73 -0
- package/dist/classes/CanvasEvent.d.mts +24 -0
- package/dist/classes/CanvasEvent.d.ts +24 -0
- package/dist/classes/CanvasEvent.js +12 -0
- package/dist/classes/CanvasEvent.js.map +1 -0
- package/dist/classes/CanvasEvent.mjs +10 -0
- package/dist/classes/CanvasEvent.mjs.map +1 -0
- package/dist/classes/CharacterBaseModel.d.mts +90 -0
- package/dist/classes/CharacterBaseModel.d.ts +90 -0
- package/dist/classes/CharacterBaseModel.js +1529 -0
- package/dist/classes/CharacterBaseModel.js.map +1 -0
- package/dist/classes/CharacterBaseModel.mjs +1527 -0
- package/dist/classes/CharacterBaseModel.mjs.map +1 -0
- package/dist/classes/ChoiceMenuOptionLabel.d.mts +41 -0
- package/dist/classes/ChoiceMenuOptionLabel.d.ts +41 -0
- package/dist/classes/ChoiceMenuOptionLabel.js +19 -0
- package/dist/classes/ChoiceMenuOptionLabel.js.map +1 -0
- package/dist/classes/ChoiceMenuOptionLabel.mjs +17 -0
- package/dist/classes/ChoiceMenuOptionLabel.mjs.map +1 -0
- package/dist/classes/DialogueBaseModel.d.mts +58 -0
- package/dist/classes/DialogueBaseModel.d.ts +58 -0
- package/dist/classes/DialogueBaseModel.js +51 -0
- package/dist/classes/DialogueBaseModel.js.map +1 -0
- package/dist/classes/DialogueBaseModel.mjs +49 -0
- package/dist/classes/DialogueBaseModel.mjs.map +1 -0
- package/dist/classes/Label.d.mts +45 -0
- package/dist/classes/Label.d.ts +45 -0
- package/dist/classes/Label.js +41 -0
- package/dist/classes/Label.js.map +1 -0
- package/dist/classes/Label.mjs +39 -0
- package/dist/classes/Label.mjs.map +1 -0
- package/dist/classes/StoredClassModel.d.mts +55 -0
- package/dist/classes/StoredClassModel.d.ts +55 -0
- package/dist/classes/StoredClassModel.js +1470 -0
- package/dist/classes/StoredClassModel.js.map +1 -0
- package/dist/classes/StoredClassModel.mjs +1468 -0
- package/dist/classes/StoredClassModel.mjs.map +1 -0
- package/dist/classes/canvas/CanvasBase.d.mts +37 -0
- package/dist/classes/canvas/CanvasBase.d.ts +37 -0
- package/dist/classes/canvas/CanvasBase.js +23 -0
- package/dist/classes/canvas/CanvasBase.js.map +1 -0
- package/dist/classes/canvas/CanvasBase.mjs +21 -0
- package/dist/classes/canvas/CanvasBase.mjs.map +1 -0
- package/dist/classes/canvas/CanvasContainer.d.mts +30 -0
- package/dist/classes/canvas/CanvasContainer.d.ts +30 -0
- package/dist/classes/canvas/CanvasContainer.js +514 -0
- package/dist/classes/canvas/CanvasContainer.js.map +1 -0
- package/dist/classes/canvas/CanvasContainer.mjs +508 -0
- package/dist/classes/canvas/CanvasContainer.mjs.map +1 -0
- package/dist/classes/canvas/CanvasImage.d.mts +50 -0
- package/dist/classes/canvas/CanvasImage.d.ts +50 -0
- package/dist/classes/canvas/CanvasImage.js +326 -0
- package/dist/classes/canvas/CanvasImage.js.map +1 -0
- package/dist/classes/canvas/CanvasImage.mjs +324 -0
- package/dist/classes/canvas/CanvasImage.mjs.map +1 -0
- package/dist/classes/canvas/CanvasSprite.d.mts +90 -0
- package/dist/classes/canvas/CanvasSprite.d.ts +90 -0
- package/dist/classes/canvas/CanvasSprite.js +285 -0
- package/dist/classes/canvas/CanvasSprite.js.map +1 -0
- package/dist/classes/canvas/CanvasSprite.mjs +279 -0
- package/dist/classes/canvas/CanvasSprite.mjs.map +1 -0
- package/dist/classes/canvas/CanvasText.d.mts +79 -0
- package/dist/classes/canvas/CanvasText.d.ts +79 -0
- package/dist/classes/canvas/CanvasText.js +259 -0
- package/dist/classes/canvas/CanvasText.js.map +1 -0
- package/dist/classes/canvas/CanvasText.mjs +253 -0
- package/dist/classes/canvas/CanvasText.mjs.map +1 -0
- package/dist/classes/canvas/index.d.mts +15 -0
- package/dist/classes/canvas/index.d.ts +15 -0
- package/dist/classes/canvas/index.js +528 -0
- package/dist/classes/canvas/index.js.map +1 -0
- package/dist/classes/canvas/index.mjs +522 -0
- package/dist/classes/canvas/index.mjs.map +1 -0
- package/dist/classes/index.d.mts +13 -0
- package/dist/classes/index.d.ts +13 -0
- package/dist/classes/index.js +1633 -0
- package/dist/classes/index.js.map +1 -0
- package/dist/classes/index.mjs +1626 -0
- package/dist/classes/index.mjs.map +1 -0
- package/dist/classes/ticker/TickerBase.d.mts +3 -0
- package/dist/classes/ticker/TickerBase.d.ts +3 -0
- package/dist/classes/ticker/TickerBase.js +29 -0
- package/dist/classes/ticker/TickerBase.js.map +1 -0
- package/dist/classes/ticker/TickerBase.mjs +27 -0
- package/dist/classes/ticker/TickerBase.mjs.map +1 -0
- package/dist/classes/ticker/TickerFadeAlpha.d.mts +31 -0
- package/dist/classes/ticker/TickerFadeAlpha.d.ts +31 -0
- package/dist/classes/ticker/TickerFadeAlpha.js +1330 -0
- package/dist/classes/ticker/TickerFadeAlpha.js.map +1 -0
- package/dist/classes/ticker/TickerFadeAlpha.mjs +1328 -0
- package/dist/classes/ticker/TickerFadeAlpha.mjs.map +1 -0
- package/dist/classes/ticker/TickerMove.d.mts +29 -0
- package/dist/classes/ticker/TickerMove.d.ts +29 -0
- package/dist/classes/ticker/TickerMove.js +1328 -0
- package/dist/classes/ticker/TickerMove.js.map +1 -0
- package/dist/classes/ticker/TickerMove.mjs +1326 -0
- package/dist/classes/ticker/TickerMove.mjs.map +1 -0
- package/dist/classes/ticker/TickerRotate.d.mts +30 -0
- package/dist/classes/ticker/TickerRotate.d.ts +30 -0
- package/dist/classes/ticker/TickerRotate.js +1328 -0
- package/dist/classes/ticker/TickerRotate.js.map +1 -0
- package/dist/classes/ticker/TickerRotate.mjs +1326 -0
- package/dist/classes/ticker/TickerRotate.mjs.map +1 -0
- package/dist/classes/ticker/index.d.mts +10 -0
- package/dist/classes/ticker/index.d.ts +10 -0
- package/dist/classes/ticker/index.js +1330 -0
- package/dist/classes/ticker/index.js.map +1 -0
- package/dist/classes/ticker/index.mjs +1328 -0
- package/dist/classes/ticker/index.mjs.map +1 -0
- package/dist/constants.d.mts +3 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +6 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/decorators/CanvasElementDecorator.d.mts +18 -0
- package/dist/decorators/CanvasElementDecorator.d.ts +18 -0
- package/dist/decorators/CanvasElementDecorator.js +540 -0
- package/dist/decorators/CanvasElementDecorator.js.map +1 -0
- package/dist/decorators/CanvasElementDecorator.mjs +533 -0
- package/dist/decorators/CanvasElementDecorator.mjs.map +1 -0
- package/dist/decorators/CharacterDecorator.d.mts +39 -0
- package/dist/decorators/CharacterDecorator.d.ts +39 -0
- package/dist/decorators/CharacterDecorator.js +37 -0
- package/dist/decorators/CharacterDecorator.js.map +1 -0
- package/dist/decorators/CharacterDecorator.mjs +32 -0
- package/dist/decorators/CharacterDecorator.mjs.map +1 -0
- package/dist/decorators/EventDecorator.d.mts +35 -0
- package/dist/decorators/EventDecorator.d.ts +35 -0
- package/dist/decorators/EventDecorator.js +52 -0
- package/dist/decorators/EventDecorator.js.map +1 -0
- package/dist/decorators/EventDecorator.mjs +45 -0
- package/dist/decorators/EventDecorator.mjs.map +1 -0
- package/dist/decorators/LabelDecorator.d.mts +31 -0
- package/dist/decorators/LabelDecorator.d.ts +31 -0
- package/dist/decorators/LabelDecorator.js +56 -0
- package/dist/decorators/LabelDecorator.js.map +1 -0
- package/dist/decorators/LabelDecorator.mjs +49 -0
- package/dist/decorators/LabelDecorator.mjs.map +1 -0
- package/dist/decorators/TickerDecorator.d.mts +27 -0
- package/dist/decorators/TickerDecorator.d.ts +27 -0
- package/dist/decorators/TickerDecorator.js +36 -0
- package/dist/decorators/TickerDecorator.js.map +1 -0
- package/dist/decorators/TickerDecorator.mjs +30 -0
- package/dist/decorators/TickerDecorator.mjs.map +1 -0
- package/dist/decorators/index.d.mts +22 -0
- package/dist/decorators/index.d.ts +22 -0
- package/dist/decorators/index.js +100 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/index.mjs +92 -0
- package/dist/decorators/index.mjs.map +1 -0
- package/dist/enums/LabelRunModeEnum.d.mts +9 -0
- package/dist/enums/LabelRunModeEnum.d.ts +9 -0
- package/dist/enums/LabelRunModeEnum.js +12 -0
- package/dist/enums/LabelRunModeEnum.js.map +1 -0
- package/dist/enums/LabelRunModeEnum.mjs +10 -0
- package/dist/enums/LabelRunModeEnum.mjs.map +1 -0
- package/dist/enums/index.d.mts +1 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.js +12 -0
- package/dist/enums/index.js.map +1 -0
- package/dist/enums/index.mjs +10 -0
- package/dist/enums/index.mjs.map +1 -0
- package/dist/functions/CanvasUtility.d.mts +25 -0
- package/dist/functions/CanvasUtility.d.ts +25 -0
- package/dist/functions/CanvasUtility.js +510 -0
- package/dist/functions/CanvasUtility.js.map +1 -0
- package/dist/functions/CanvasUtility.mjs +506 -0
- package/dist/functions/CanvasUtility.mjs.map +1 -0
- package/dist/functions/DialogueUtility.d.mts +71 -0
- package/dist/functions/DialogueUtility.d.ts +71 -0
- package/dist/functions/DialogueUtility.js +2189 -0
- package/dist/functions/DialogueUtility.js.map +1 -0
- package/dist/functions/DialogueUtility.mjs +2177 -0
- package/dist/functions/DialogueUtility.mjs.map +1 -0
- package/dist/functions/DiffUtility.d.mts +5 -0
- package/dist/functions/DiffUtility.d.ts +5 -0
- package/dist/functions/DiffUtility.js +57 -0
- package/dist/functions/DiffUtility.js.map +1 -0
- package/dist/functions/DiffUtility.mjs +55 -0
- package/dist/functions/DiffUtility.mjs.map +1 -0
- package/dist/functions/EasterEgg.d.mts +3 -0
- package/dist/functions/EasterEgg.d.ts +3 -0
- package/dist/functions/EasterEgg.js +16 -0
- package/dist/functions/EasterEgg.js.map +1 -0
- package/dist/functions/EasterEgg.mjs +14 -0
- package/dist/functions/EasterEgg.mjs.map +1 -0
- package/dist/functions/ErrorUtility.d.mts +24 -0
- package/dist/functions/ErrorUtility.d.ts +24 -0
- package/dist/functions/ErrorUtility.js +261 -0
- package/dist/functions/ErrorUtility.js.map +1 -0
- package/dist/functions/ErrorUtility.mjs +258 -0
- package/dist/functions/ErrorUtility.mjs.map +1 -0
- package/dist/functions/ExportUtility.d.mts +8 -0
- package/dist/functions/ExportUtility.d.ts +8 -0
- package/dist/functions/ExportUtility.js +16 -0
- package/dist/functions/ExportUtility.js.map +1 -0
- package/dist/functions/ExportUtility.mjs +14 -0
- package/dist/functions/ExportUtility.mjs.map +1 -0
- package/dist/functions/FlagsUtility.d.mts +14 -0
- package/dist/functions/FlagsUtility.d.ts +14 -0
- package/dist/functions/FlagsUtility.js +1436 -0
- package/dist/functions/FlagsUtility.js.map +1 -0
- package/dist/functions/FlagsUtility.mjs +1433 -0
- package/dist/functions/FlagsUtility.mjs.map +1 -0
- package/dist/functions/GameUtility.d.mts +6 -0
- package/dist/functions/GameUtility.d.ts +6 -0
- package/dist/functions/GameUtility.js +1335 -0
- package/dist/functions/GameUtility.js.map +1 -0
- package/dist/functions/GameUtility.mjs +1333 -0
- package/dist/functions/GameUtility.mjs.map +1 -0
- package/dist/functions/ImageUtility.d.mts +51 -0
- package/dist/functions/ImageUtility.d.ts +51 -0
- package/dist/functions/ImageUtility.js +1392 -0
- package/dist/functions/ImageUtility.js.map +1 -0
- package/dist/functions/ImageUtility.mjs +1387 -0
- package/dist/functions/ImageUtility.mjs.map +1 -0
- package/dist/functions/SavesUtility.d.mts +89 -0
- package/dist/functions/SavesUtility.d.ts +89 -0
- package/dist/functions/SavesUtility.js +2081 -0
- package/dist/functions/SavesUtility.js.map +1 -0
- package/dist/functions/SavesUtility.mjs +2071 -0
- package/dist/functions/SavesUtility.mjs.map +1 -0
- package/dist/functions/StepLabelUtility.d.mts +19 -0
- package/dist/functions/StepLabelUtility.d.ts +19 -0
- package/dist/functions/StepLabelUtility.js +21 -0
- package/dist/functions/StepLabelUtility.js.map +1 -0
- package/dist/functions/StepLabelUtility.mjs +14 -0
- package/dist/functions/StepLabelUtility.mjs.map +1 -0
- package/dist/functions/TextureUtility.d.mts +11 -0
- package/dist/functions/TextureUtility.d.ts +11 -0
- package/dist/functions/TextureUtility.js +78 -0
- package/dist/functions/TextureUtility.js.map +1 -0
- package/dist/functions/TextureUtility.mjs +75 -0
- package/dist/functions/TextureUtility.mjs.map +1 -0
- package/dist/functions/TickerUtility.d.mts +13 -0
- package/dist/functions/TickerUtility.d.ts +13 -0
- package/dist/functions/TickerUtility.js +33 -0
- package/dist/functions/TickerUtility.js.map +1 -0
- package/dist/functions/TickerUtility.mjs +31 -0
- package/dist/functions/TickerUtility.mjs.map +1 -0
- package/dist/functions/index.d.mts +40 -0
- package/dist/functions/index.d.ts +40 -0
- package/dist/functions/index.js +2313 -0
- package/dist/functions/index.js.map +1 -0
- package/dist/functions/index.mjs +2289 -0
- package/dist/functions/index.mjs.map +1 -0
- package/dist/index.d.mts +62 -1773
- package/dist/index.d.ts +62 -1773
- package/dist/index.js +89 -197
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -98
- package/dist/index.mjs.map +1 -1
- package/dist/interface/IClassWithArgsHistory.d.mts +25 -0
- package/dist/interface/IClassWithArgsHistory.d.ts +25 -0
- package/dist/interface/IClassWithArgsHistory.js +4 -0
- package/dist/interface/IClassWithArgsHistory.js.map +1 -0
- package/dist/interface/IClassWithArgsHistory.mjs +3 -0
- package/dist/interface/IClassWithArgsHistory.mjs.map +1 -0
- package/dist/interface/IDialogueHistory.d.mts +32 -0
- package/dist/interface/IDialogueHistory.d.ts +32 -0
- package/dist/interface/IDialogueHistory.js +4 -0
- package/dist/interface/IDialogueHistory.js.map +1 -0
- package/dist/interface/IDialogueHistory.mjs +3 -0
- package/dist/interface/IDialogueHistory.mjs.map +1 -0
- package/dist/interface/IHistoryStep.d.mts +74 -0
- package/dist/interface/IHistoryStep.d.ts +74 -0
- package/dist/interface/IHistoryStep.js +4 -0
- package/dist/interface/IHistoryStep.js.map +1 -0
- package/dist/interface/IHistoryStep.mjs +3 -0
- package/dist/interface/IHistoryStep.mjs.map +1 -0
- package/dist/interface/IOpenedLabel.d.mts +8 -0
- package/dist/interface/IOpenedLabel.d.ts +8 -0
- package/dist/interface/IOpenedLabel.js +4 -0
- package/dist/interface/IOpenedLabel.js.map +1 -0
- package/dist/interface/IOpenedLabel.mjs +3 -0
- package/dist/interface/IOpenedLabel.mjs.map +1 -0
- package/dist/interface/ISaveData.d.mts +32 -0
- package/dist/interface/ISaveData.d.ts +32 -0
- package/dist/interface/ISaveData.js +4 -0
- package/dist/interface/ISaveData.js.map +1 -0
- package/dist/interface/ISaveData.mjs +3 -0
- package/dist/interface/ISaveData.mjs.map +1 -0
- package/dist/interface/ITicker.d.mts +3 -0
- package/dist/interface/ITicker.d.ts +3 -0
- package/dist/interface/ITicker.js +4 -0
- package/dist/interface/ITicker.js.map +1 -0
- package/dist/interface/ITicker.mjs +3 -0
- package/dist/interface/ITicker.mjs.map +1 -0
- package/dist/interface/ITickersSteps.d.mts +31 -0
- package/dist/interface/ITickersSteps.d.ts +31 -0
- package/dist/interface/ITickersSteps.js +4 -0
- package/dist/interface/ITickersSteps.js.map +1 -0
- package/dist/interface/ITickersSteps.mjs +3 -0
- package/dist/interface/ITickersSteps.mjs.map +1 -0
- package/dist/interface/TickerProgrationType.d.mts +13 -0
- package/dist/interface/TickerProgrationType.d.ts +13 -0
- package/dist/interface/TickerProgrationType.js +4 -0
- package/dist/interface/TickerProgrationType.js.map +1 -0
- package/dist/interface/TickerProgrationType.mjs +3 -0
- package/dist/interface/TickerProgrationType.mjs.map +1 -0
- package/dist/interface/canvas/ICanvasBaseMemory.d.mts +8 -0
- package/dist/interface/canvas/ICanvasBaseMemory.d.ts +8 -0
- package/dist/interface/canvas/ICanvasBaseMemory.js +4 -0
- package/dist/interface/canvas/ICanvasBaseMemory.js.map +1 -0
- package/dist/interface/canvas/ICanvasBaseMemory.mjs +3 -0
- package/dist/interface/canvas/ICanvasBaseMemory.mjs.map +1 -0
- package/dist/interface/canvas/ICanvasContainerMemory.d.mts +11 -0
- package/dist/interface/canvas/ICanvasContainerMemory.d.ts +11 -0
- package/dist/interface/canvas/ICanvasContainerMemory.js +4 -0
- package/dist/interface/canvas/ICanvasContainerMemory.js.map +1 -0
- package/dist/interface/canvas/ICanvasContainerMemory.mjs +3 -0
- package/dist/interface/canvas/ICanvasContainerMemory.mjs.map +1 -0
- package/dist/interface/canvas/ICanvasImageMemory.d.mts +14 -0
- package/dist/interface/canvas/ICanvasImageMemory.d.ts +14 -0
- package/dist/interface/canvas/ICanvasImageMemory.js +4 -0
- package/dist/interface/canvas/ICanvasImageMemory.js.map +1 -0
- package/dist/interface/canvas/ICanvasImageMemory.mjs +3 -0
- package/dist/interface/canvas/ICanvasImageMemory.mjs.map +1 -0
- package/dist/interface/canvas/ICanvasSpriteMemory.d.mts +19 -0
- package/dist/interface/canvas/ICanvasSpriteMemory.d.ts +19 -0
- package/dist/interface/canvas/ICanvasSpriteMemory.js +4 -0
- package/dist/interface/canvas/ICanvasSpriteMemory.js.map +1 -0
- package/dist/interface/canvas/ICanvasSpriteMemory.mjs +3 -0
- package/dist/interface/canvas/ICanvasSpriteMemory.mjs.map +1 -0
- package/dist/interface/canvas/ICanvasTextTextMemory.d.mts +15 -0
- package/dist/interface/canvas/ICanvasTextTextMemory.d.ts +15 -0
- package/dist/interface/canvas/ICanvasTextTextMemory.js +4 -0
- package/dist/interface/canvas/ICanvasTextTextMemory.js.map +1 -0
- package/dist/interface/canvas/ICanvasTextTextMemory.mjs +3 -0
- package/dist/interface/canvas/ICanvasTextTextMemory.mjs.map +1 -0
- package/dist/interface/canvas/ITextureMemory.d.mts +8 -0
- package/dist/interface/canvas/ITextureMemory.d.ts +8 -0
- package/dist/interface/canvas/ITextureMemory.js +4 -0
- package/dist/interface/canvas/ITextureMemory.js.map +1 -0
- package/dist/interface/canvas/ITextureMemory.mjs +3 -0
- package/dist/interface/canvas/ITextureMemory.mjs.map +1 -0
- package/dist/interface/canvas/index.d.mts +8 -0
- package/dist/interface/canvas/index.d.ts +8 -0
- package/dist/interface/canvas/index.js +4 -0
- package/dist/interface/canvas/index.js.map +1 -0
- package/dist/interface/canvas/index.mjs +3 -0
- package/dist/interface/canvas/index.mjs.map +1 -0
- package/dist/interface/export/ExportedCanvas.d.mts +19 -0
- package/dist/interface/export/ExportedCanvas.d.ts +19 -0
- package/dist/interface/export/ExportedCanvas.js +4 -0
- package/dist/interface/export/ExportedCanvas.js.map +1 -0
- package/dist/interface/export/ExportedCanvas.mjs +3 -0
- package/dist/interface/export/ExportedCanvas.mjs.map +1 -0
- package/dist/interface/export/ExportedStep.d.mts +33 -0
- package/dist/interface/export/ExportedStep.d.ts +33 -0
- package/dist/interface/export/ExportedStep.js +4 -0
- package/dist/interface/export/ExportedStep.js.map +1 -0
- package/dist/interface/export/ExportedStep.mjs +3 -0
- package/dist/interface/export/ExportedStep.mjs.map +1 -0
- package/dist/interface/export/ExportedStorage.d.mts +10 -0
- package/dist/interface/export/ExportedStorage.d.ts +10 -0
- package/dist/interface/export/ExportedStorage.js +4 -0
- package/dist/interface/export/ExportedStorage.js.map +1 -0
- package/dist/interface/export/ExportedStorage.mjs +3 -0
- package/dist/interface/export/ExportedStorage.mjs.map +1 -0
- package/dist/interface/export/index.d.mts +22 -0
- package/dist/interface/export/index.d.ts +22 -0
- package/dist/interface/export/index.js +4 -0
- package/dist/interface/export/index.js.map +1 -0
- package/dist/interface/export/index.mjs +3 -0
- package/dist/interface/export/index.mjs.map +1 -0
- package/dist/interface/index.d.mts +28 -0
- package/dist/interface/index.d.ts +28 -0
- package/dist/interface/index.js +4 -0
- package/dist/interface/index.js.map +1 -0
- package/dist/interface/index.mjs +3 -0
- package/dist/interface/index.mjs.map +1 -0
- package/dist/managers/StepManager.d.mts +209 -0
- package/dist/managers/StepManager.d.ts +209 -0
- package/dist/managers/StepManager.js +2043 -0
- package/dist/managers/StepManager.js.map +1 -0
- package/dist/managers/StepManager.mjs +2037 -0
- package/dist/managers/StepManager.mjs.map +1 -0
- package/dist/managers/StorageManager.d.mts +45 -0
- package/dist/managers/StorageManager.d.ts +45 -0
- package/dist/managers/StorageManager.js +101 -0
- package/dist/managers/StorageManager.js.map +1 -0
- package/dist/managers/StorageManager.mjs +99 -0
- package/dist/managers/StorageManager.mjs.map +1 -0
- package/dist/managers/WindowManager.d.mts +265 -0
- package/dist/managers/WindowManager.d.ts +265 -0
- package/dist/managers/WindowManager.js +1142 -0
- package/dist/managers/WindowManager.js.map +1 -0
- package/dist/managers/WindowManager.mjs +1140 -0
- package/dist/managers/WindowManager.mjs.map +1 -0
- package/dist/managers/index.d.mts +29 -0
- package/dist/managers/index.d.ts +29 -0
- package/dist/managers/index.js +2049 -0
- package/dist/managers/index.js.map +1 -0
- package/dist/managers/index.mjs +2041 -0
- package/dist/managers/index.mjs.map +1 -0
- package/dist/override/StepLabelProps.d.mts +18 -0
- package/dist/override/StepLabelProps.d.ts +18 -0
- package/dist/override/StepLabelProps.js +4 -0
- package/dist/override/StepLabelProps.js.map +1 -0
- package/dist/override/StepLabelProps.mjs +3 -0
- package/dist/override/StepLabelProps.mjs.map +1 -0
- package/dist/override/StepLabelResult.d.mts +19 -0
- package/dist/override/StepLabelResult.d.ts +19 -0
- package/dist/override/StepLabelResult.js +4 -0
- package/dist/override/StepLabelResult.js.map +1 -0
- package/dist/override/StepLabelResult.mjs +3 -0
- package/dist/override/StepLabelResult.mjs.map +1 -0
- package/dist/override/index.d.mts +2 -0
- package/dist/override/index.d.ts +2 -0
- package/dist/override/index.js +4 -0
- package/dist/override/index.js.map +1 -0
- package/dist/override/index.mjs +3 -0
- package/dist/override/index.mjs.map +1 -0
- package/dist/types/CanvasElementTagType.d.mts +3 -0
- package/dist/types/CanvasElementTagType.d.ts +3 -0
- package/dist/types/CanvasElementTagType.js +4 -0
- package/dist/types/CanvasElementTagType.js.map +1 -0
- package/dist/types/CanvasElementTagType.mjs +3 -0
- package/dist/types/CanvasElementTagType.mjs.map +1 -0
- package/dist/types/CanvasEventNamesType.d.mts +6 -0
- package/dist/types/CanvasEventNamesType.d.ts +6 -0
- package/dist/types/CanvasEventNamesType.js +4 -0
- package/dist/types/CanvasEventNamesType.js.map +1 -0
- package/dist/types/CanvasEventNamesType.mjs +3 -0
- package/dist/types/CanvasEventNamesType.mjs.map +1 -0
- package/dist/types/ChoiceMenuOptionsType.d.mts +15 -0
- package/dist/types/ChoiceMenuOptionsType.d.ts +15 -0
- package/dist/types/ChoiceMenuOptionsType.js +4 -0
- package/dist/types/ChoiceMenuOptionsType.js.map +1 -0
- package/dist/types/ChoiceMenuOptionsType.mjs +3 -0
- package/dist/types/ChoiceMenuOptionsType.mjs.map +1 -0
- package/dist/types/EventIdType.d.mts +3 -0
- package/dist/types/EventIdType.d.ts +3 -0
- package/dist/types/EventIdType.js +4 -0
- package/dist/types/EventIdType.js.map +1 -0
- package/dist/types/EventIdType.mjs +3 -0
- package/dist/types/EventIdType.mjs.map +1 -0
- package/dist/types/LabelIdType.d.mts +7 -0
- package/dist/types/LabelIdType.d.ts +7 -0
- package/dist/types/LabelIdType.js +4 -0
- package/dist/types/LabelIdType.js.map +1 -0
- package/dist/types/LabelIdType.mjs +3 -0
- package/dist/types/LabelIdType.mjs.map +1 -0
- package/dist/types/PauseType.d.mts +8 -0
- package/dist/types/PauseType.d.ts +8 -0
- package/dist/types/PauseType.js +15 -0
- package/dist/types/PauseType.js.map +1 -0
- package/dist/types/PauseType.mjs +12 -0
- package/dist/types/PauseType.mjs.map +1 -0
- package/dist/types/RepeatType.d.mts +4 -0
- package/dist/types/RepeatType.d.ts +4 -0
- package/dist/types/RepeatType.js +8 -0
- package/dist/types/RepeatType.js.map +1 -0
- package/dist/types/RepeatType.mjs +6 -0
- package/dist/types/RepeatType.mjs.map +1 -0
- package/dist/types/StepHistoryDataType.d.mts +8 -0
- package/dist/types/StepHistoryDataType.d.ts +8 -0
- package/dist/types/StepHistoryDataType.js +4 -0
- package/dist/types/StepHistoryDataType.js.map +1 -0
- package/dist/types/StepHistoryDataType.mjs +3 -0
- package/dist/types/StepHistoryDataType.mjs.map +1 -0
- package/dist/types/StepLabelType.d.mts +10 -0
- package/dist/types/StepLabelType.d.ts +10 -0
- package/dist/types/StepLabelType.js +4 -0
- package/dist/types/StepLabelType.js.map +1 -0
- package/dist/types/StepLabelType.mjs +3 -0
- package/dist/types/StepLabelType.mjs.map +1 -0
- package/dist/types/StorageElementType.d.mts +10 -0
- package/dist/types/StorageElementType.d.ts +10 -0
- package/dist/types/StorageElementType.js +4 -0
- package/dist/types/StorageElementType.js.map +1 -0
- package/dist/types/StorageElementType.mjs +3 -0
- package/dist/types/StorageElementType.mjs.map +1 -0
- package/dist/types/TickerIdType.d.mts +7 -0
- package/dist/types/TickerIdType.d.ts +7 -0
- package/dist/types/TickerIdType.js +4 -0
- package/dist/types/TickerIdType.js.map +1 -0
- package/dist/types/TickerIdType.mjs +3 -0
- package/dist/types/TickerIdType.mjs.map +1 -0
- package/dist/types/index.d.mts +12 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +15 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/ticker/TickerFadeAlphaProps.d.mts +26 -0
- package/dist/types/ticker/TickerFadeAlphaProps.d.ts +26 -0
- package/dist/types/ticker/TickerFadeAlphaProps.js +4 -0
- package/dist/types/ticker/TickerFadeAlphaProps.js.map +1 -0
- package/dist/types/ticker/TickerFadeAlphaProps.mjs +3 -0
- package/dist/types/ticker/TickerFadeAlphaProps.mjs.map +1 -0
- package/dist/types/ticker/TickerMoveProps.d.mts +26 -0
- package/dist/types/ticker/TickerMoveProps.d.ts +26 -0
- package/dist/types/ticker/TickerMoveProps.js +4 -0
- package/dist/types/ticker/TickerMoveProps.js.map +1 -0
- package/dist/types/ticker/TickerMoveProps.mjs +3 -0
- package/dist/types/ticker/TickerMoveProps.mjs.map +1 -0
- package/dist/types/ticker/TickerRotateProps.d.mts +24 -0
- package/dist/types/ticker/TickerRotateProps.d.ts +24 -0
- package/dist/types/ticker/TickerRotateProps.js +4 -0
- package/dist/types/ticker/TickerRotateProps.js.map +1 -0
- package/dist/types/ticker/TickerRotateProps.mjs +3 -0
- package/dist/types/ticker/TickerRotateProps.mjs.map +1 -0
- package/dist/types/ticker/index.d.mts +3 -0
- package/dist/types/ticker/index.d.ts +3 -0
- package/dist/types/ticker/index.js +4 -0
- package/dist/types/ticker/index.js.map +1 -0
- package/dist/types/ticker/index.mjs +3 -0
- package/dist/types/ticker/index.mjs.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,1529 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('deep-diff');
|
|
4
|
+
require('crypto-js/sha1');
|
|
5
|
+
var pixi_js = require('pixi.js');
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __defProps = Object.defineProperties;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
11
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
+
var __spreadValues = (a, b) => {
|
|
16
|
+
for (var prop in b || (b = {}))
|
|
17
|
+
if (__hasOwnProp.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
if (__getOwnPropSymbols)
|
|
20
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
+
if (__propIsEnum.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
28
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
29
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
30
|
+
if (decorator = decorators[i])
|
|
31
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
32
|
+
if (kind && result)
|
|
33
|
+
__defProp(target, key, result);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __async = (__this, __arguments, generator) => {
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
var fulfilled = (value) => {
|
|
39
|
+
try {
|
|
40
|
+
step(generator.next(value));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var rejected = (value) => {
|
|
46
|
+
try {
|
|
47
|
+
step(generator.throw(value));
|
|
48
|
+
} catch (e) {
|
|
49
|
+
reject(e);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
53
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// src/classes/StoredClassModel.ts
|
|
58
|
+
var StoredClassModel = class {
|
|
59
|
+
/**
|
|
60
|
+
* @param categoryId The id of the category. For example if you are storing a character class, you can use "characters" as categoryId. so all instances of the character class will be stored in the "characters" category.
|
|
61
|
+
* @param id The id of instance of the class. This id must be unique for the category.
|
|
62
|
+
*/
|
|
63
|
+
constructor(categoryId, id) {
|
|
64
|
+
this.categoryId = categoryId;
|
|
65
|
+
this._id = id;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Is id of the stored class. is unique for this class.
|
|
69
|
+
*/
|
|
70
|
+
get id() {
|
|
71
|
+
return this._id;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Update a property in the storage.
|
|
75
|
+
* @param propertyName The name of the property to set.
|
|
76
|
+
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
77
|
+
*/
|
|
78
|
+
setStorageProperty(propertyName, value) {
|
|
79
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
80
|
+
if (!storage) {
|
|
81
|
+
storage = {};
|
|
82
|
+
}
|
|
83
|
+
if (!storage.hasOwnProperty(this.id)) {
|
|
84
|
+
storage[this.id] = {};
|
|
85
|
+
}
|
|
86
|
+
if (value === void 0 || value === null) {
|
|
87
|
+
if (storage[this.id].hasOwnProperty(propertyName)) {
|
|
88
|
+
delete storage[this.id][propertyName];
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
storage[this.id] = __spreadProps(__spreadValues({}, storage[this.id]), { [propertyName]: value });
|
|
92
|
+
}
|
|
93
|
+
if (Object.keys(storage[this.id]).length === 0) {
|
|
94
|
+
delete storage[this.id];
|
|
95
|
+
}
|
|
96
|
+
GameStorageManager.setVariable(this.categoryId, storage);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get a property from the storage.
|
|
100
|
+
* @param propertyName The name of the property to get.
|
|
101
|
+
* @returns The value of the property. If the property is not found, returns undefined.
|
|
102
|
+
*/
|
|
103
|
+
getStorageProperty(propertyName) {
|
|
104
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
105
|
+
if (storage && storage.hasOwnProperty(this.id) && storage[this.id].hasOwnProperty(propertyName)) {
|
|
106
|
+
return storage[this.id][propertyName];
|
|
107
|
+
}
|
|
108
|
+
return void 0;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// src/decorators/CanvasElementDecorator.ts
|
|
113
|
+
var registeredCanvasElement = {};
|
|
114
|
+
function getCanvasElementInstanceByClassName(canvasName) {
|
|
115
|
+
try {
|
|
116
|
+
let eventType = registeredCanvasElement[canvasName];
|
|
117
|
+
if (!eventType) {
|
|
118
|
+
if (canvasName === "CanvasContainer") {
|
|
119
|
+
eventType = CanvasContainer;
|
|
120
|
+
} else if (canvasName === "CanvasImage") {
|
|
121
|
+
eventType = CanvasImage;
|
|
122
|
+
} else if (canvasName === "CanvasSprite") {
|
|
123
|
+
eventType = CanvasSprite;
|
|
124
|
+
} else if (canvasName === "CanvasText") {
|
|
125
|
+
eventType = CanvasText;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (!eventType) {
|
|
129
|
+
console.error(`[Pixi'VN] CanvasElement ${canvasName} not found`);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
let canvasElement = new eventType();
|
|
133
|
+
return canvasElement;
|
|
134
|
+
} catch (e) {
|
|
135
|
+
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasName}`, e);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// src/functions/CanvasUtility.ts
|
|
141
|
+
function getTextureMemory(texture) {
|
|
142
|
+
let sourceTexture = texture.source;
|
|
143
|
+
let textureMemory = {
|
|
144
|
+
image: sourceTexture.label
|
|
145
|
+
};
|
|
146
|
+
return textureMemory;
|
|
147
|
+
}
|
|
148
|
+
function exportCanvasElement(element) {
|
|
149
|
+
return element.memory;
|
|
150
|
+
}
|
|
151
|
+
function importCanvasElement(memory) {
|
|
152
|
+
let element = getCanvasElementInstanceByClassName(memory.className);
|
|
153
|
+
if (element) {
|
|
154
|
+
element.memory = memory;
|
|
155
|
+
} else {
|
|
156
|
+
throw new Error("[Pixi'VN] The element " + memory.className + " could not be created");
|
|
157
|
+
}
|
|
158
|
+
return element;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// src/classes/canvas/CanvasContainer.ts
|
|
162
|
+
var CanvasContainer = class extends pixi_js.Container {
|
|
163
|
+
get memory() {
|
|
164
|
+
let memory = getMemoryContainer(this);
|
|
165
|
+
this.children.forEach((child) => {
|
|
166
|
+
memory.elements.push(exportCanvasElement(child));
|
|
167
|
+
});
|
|
168
|
+
return memory;
|
|
169
|
+
}
|
|
170
|
+
set memory(value) {
|
|
171
|
+
setMemoryContainer(this, value);
|
|
172
|
+
value.elements.forEach((child) => {
|
|
173
|
+
this.addChild(importCanvasElement(child));
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
function getMemoryContainer(element) {
|
|
178
|
+
return {
|
|
179
|
+
className: "CanvasContainer",
|
|
180
|
+
elements: [],
|
|
181
|
+
width: element.width,
|
|
182
|
+
height: element.height,
|
|
183
|
+
isRenderGroup: element.isRenderGroup,
|
|
184
|
+
blendMode: element.blendMode,
|
|
185
|
+
tint: element.tint,
|
|
186
|
+
alpha: element.alpha,
|
|
187
|
+
angle: element.angle,
|
|
188
|
+
renderable: element.renderable,
|
|
189
|
+
rotation: element.rotation,
|
|
190
|
+
scale: { x: element.scale.x, y: element.scale.y },
|
|
191
|
+
pivot: { x: element.pivot.x, y: element.pivot.y },
|
|
192
|
+
position: { x: element.position.x, y: element.position.y },
|
|
193
|
+
skew: { x: element.skew.x, y: element.skew.y },
|
|
194
|
+
visible: element.visible,
|
|
195
|
+
culled: element.culled,
|
|
196
|
+
x: element.x,
|
|
197
|
+
y: element.y,
|
|
198
|
+
boundsArea: element.boundsArea,
|
|
199
|
+
cursor: element.cursor,
|
|
200
|
+
eventMode: element.eventMode,
|
|
201
|
+
interactive: element.interactive,
|
|
202
|
+
interactiveChildren: element.interactiveChildren,
|
|
203
|
+
hitArea: element.hitArea
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function setMemoryContainer(element, memory) {
|
|
207
|
+
memory.width && (element.width = memory.width);
|
|
208
|
+
memory.height && (element.height = memory.height);
|
|
209
|
+
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
210
|
+
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
211
|
+
memory.tint && (element.tint = memory.tint);
|
|
212
|
+
memory.alpha && (element.alpha = memory.alpha);
|
|
213
|
+
memory.angle && (element.angle = memory.angle);
|
|
214
|
+
memory.renderable && (element.renderable = memory.renderable);
|
|
215
|
+
memory.rotation && (element.rotation = memory.rotation);
|
|
216
|
+
if (memory.scale) {
|
|
217
|
+
if (typeof memory.scale === "number") {
|
|
218
|
+
element.scale.set(memory.scale, memory.scale);
|
|
219
|
+
} else {
|
|
220
|
+
element.scale.set(memory.scale.x, memory.scale.y);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (memory.pivot) {
|
|
224
|
+
if (typeof memory.pivot === "number") {
|
|
225
|
+
element.pivot.set(memory.pivot, memory.pivot);
|
|
226
|
+
} else {
|
|
227
|
+
element.pivot.set(memory.pivot.x, memory.pivot.y);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
memory.position && element.position.set(memory.position.x, memory.position.y);
|
|
231
|
+
memory.skew && element.skew.set(memory.skew.x, memory.skew.y);
|
|
232
|
+
memory.visible && (element.visible = memory.visible);
|
|
233
|
+
memory.culled && (element.culled = memory.culled);
|
|
234
|
+
memory.x && (element.x = memory.x);
|
|
235
|
+
memory.y && (element.y = memory.y);
|
|
236
|
+
memory.boundsArea && (element.boundsArea = memory.boundsArea);
|
|
237
|
+
memory.cursor && (element.cursor = memory.cursor);
|
|
238
|
+
memory.eventMode && (element.eventMode = memory.eventMode);
|
|
239
|
+
memory.interactive && (element.interactive = memory.interactive);
|
|
240
|
+
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
241
|
+
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
242
|
+
}
|
|
243
|
+
function getTexture(imageUrl) {
|
|
244
|
+
return __async(this, null, function* () {
|
|
245
|
+
if (pixi_js.Assets.cache.has(imageUrl)) {
|
|
246
|
+
return pixi_js.Assets.get(imageUrl);
|
|
247
|
+
}
|
|
248
|
+
return pixi_js.Assets.load(imageUrl).then((texture) => {
|
|
249
|
+
if (!texture) {
|
|
250
|
+
console.error("[Pixi'VN] Texture not found", imageUrl);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (!(texture instanceof pixi_js.Texture)) {
|
|
254
|
+
console.error("[Pixi'VN] File not is a image", imageUrl);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
return texture;
|
|
258
|
+
}).catch((e) => {
|
|
259
|
+
console.error("[Pixi'VN] Error loading image", e);
|
|
260
|
+
return;
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
function getTextStyle(style) {
|
|
265
|
+
let fill = style.fill;
|
|
266
|
+
if (fill instanceof Object) {
|
|
267
|
+
console.warn("[Pixi'VN] CanvasText.style.fill is a FillGradient or FillPattern, this is not supported yet.", fill);
|
|
268
|
+
fill = "#00FF00";
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
align: style.align,
|
|
272
|
+
breakWords: style.breakWords,
|
|
273
|
+
dropShadow: style.dropShadow,
|
|
274
|
+
fill,
|
|
275
|
+
fontFamily: style.fontFamily,
|
|
276
|
+
fontSize: style.fontSize,
|
|
277
|
+
fontStyle: style.fontStyle,
|
|
278
|
+
fontVariant: style.fontVariant,
|
|
279
|
+
fontWeight: style.fontWeight,
|
|
280
|
+
leading: style.leading,
|
|
281
|
+
letterSpacing: style.letterSpacing,
|
|
282
|
+
lineHeight: style.lineHeight,
|
|
283
|
+
padding: style.padding,
|
|
284
|
+
stroke: style.stroke,
|
|
285
|
+
textBaseline: style.textBaseline,
|
|
286
|
+
trim: style.trim,
|
|
287
|
+
whiteSpace: style.whiteSpace,
|
|
288
|
+
wordWrap: style.wordWrap,
|
|
289
|
+
wordWrapWidth: style.wordWrapWidth
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// src/decorators/EventDecorator.ts
|
|
294
|
+
var registeredEvents = {};
|
|
295
|
+
function getEventTypeByClassName(eventName) {
|
|
296
|
+
try {
|
|
297
|
+
let eventType = registeredEvents[eventName];
|
|
298
|
+
if (!eventType) {
|
|
299
|
+
console.error(`[Pixi'VN] Event ${eventName} not found`);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
new eventType();
|
|
303
|
+
return eventType;
|
|
304
|
+
} catch (e) {
|
|
305
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventName}`, e);
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
function getEventInstanceByClassName(eventName) {
|
|
310
|
+
try {
|
|
311
|
+
let eventType = registeredEvents[eventName];
|
|
312
|
+
if (!eventType) {
|
|
313
|
+
console.error(`[Pixi'VN] Event ${eventName} not found`);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
let event = new eventType();
|
|
317
|
+
return event;
|
|
318
|
+
} catch (e) {
|
|
319
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventName}`, e);
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// src/classes/canvas/CanvasSprite.ts
|
|
325
|
+
var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
326
|
+
constructor() {
|
|
327
|
+
super(...arguments);
|
|
328
|
+
this._onEvents = {};
|
|
329
|
+
}
|
|
330
|
+
get memory() {
|
|
331
|
+
return getMemorySprite(this);
|
|
332
|
+
}
|
|
333
|
+
set memory(value) {
|
|
334
|
+
setMemorySprite(this, value);
|
|
335
|
+
}
|
|
336
|
+
get onEvents() {
|
|
337
|
+
return this._onEvents;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* is same function as on(), but it keeps in memory the children.
|
|
341
|
+
* @param event The event type, e.g., 'click', 'mousedown', 'mouseup', 'pointerdown', etc.
|
|
342
|
+
* @param eventClass The class that extends CanvasEvent.
|
|
343
|
+
* @returns
|
|
344
|
+
* @example
|
|
345
|
+
* ```typescript
|
|
346
|
+
* \@eventDecorator()
|
|
347
|
+
* export class EventTest extends CanvasEvent<CanvasSprite> {
|
|
348
|
+
* override fn(event: CanvasEventNamesType, sprite: CanvasSprite): void {
|
|
349
|
+
* if (event === 'pointerdown') {
|
|
350
|
+
* sprite.scale.x *= 1.25;
|
|
351
|
+
* sprite.scale.y *= 1.25;
|
|
352
|
+
* }
|
|
353
|
+
* }
|
|
354
|
+
* }
|
|
355
|
+
* ```
|
|
356
|
+
*
|
|
357
|
+
* ```typescript
|
|
358
|
+
* let sprite = addImage("alien", 'https://pixijs.com/assets/eggHead.png')
|
|
359
|
+
* await sprite.load()
|
|
360
|
+
*
|
|
361
|
+
* sprite.eventMode = 'static';
|
|
362
|
+
* sprite.cursor = 'pointer';
|
|
363
|
+
* sprite.onEvent('pointerdown', EventTest);
|
|
364
|
+
*
|
|
365
|
+
* GameWindowManager.addCanvasElement("bunny", sprite);
|
|
366
|
+
* ```
|
|
367
|
+
*/
|
|
368
|
+
onEvent(event, eventClass) {
|
|
369
|
+
let className = eventClass.name;
|
|
370
|
+
let instance = getEventInstanceByClassName(className);
|
|
371
|
+
this._onEvents[event] = className;
|
|
372
|
+
if (instance) {
|
|
373
|
+
super.on(event, () => {
|
|
374
|
+
instance.fn(event, this);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
return this;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* on() does not keep in memory the event class, use onEvent() instead
|
|
381
|
+
* @deprecated
|
|
382
|
+
* @private
|
|
383
|
+
* @param event
|
|
384
|
+
* @param fn
|
|
385
|
+
* @param context
|
|
386
|
+
*/
|
|
387
|
+
on(event, fn, context) {
|
|
388
|
+
return super.on(event, fn, context);
|
|
389
|
+
}
|
|
390
|
+
static from(source, skipCache) {
|
|
391
|
+
let sprite = pixi_js.Sprite.from(source, skipCache);
|
|
392
|
+
let mySprite = new _CanvasSprite();
|
|
393
|
+
mySprite.texture = sprite.texture;
|
|
394
|
+
return mySprite;
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
function getMemorySprite(element) {
|
|
398
|
+
let temp = getMemoryContainer(element);
|
|
399
|
+
return __spreadProps(__spreadValues({}, temp), {
|
|
400
|
+
className: "CanvasSprite",
|
|
401
|
+
textureImage: getTextureMemory(element.texture),
|
|
402
|
+
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
403
|
+
roundPixels: element.roundPixels,
|
|
404
|
+
onEvents: element.onEvents
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
function setMemorySprite(element, memory) {
|
|
408
|
+
setMemoryContainer(element, memory);
|
|
409
|
+
getTexture(memory.textureImage.image).then((texture) => {
|
|
410
|
+
if (texture) {
|
|
411
|
+
element.texture = texture;
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
if (memory.anchor) {
|
|
415
|
+
if (typeof memory.anchor === "number") {
|
|
416
|
+
element.anchor.set(memory.anchor, memory.anchor);
|
|
417
|
+
} else {
|
|
418
|
+
element.anchor.set(memory.anchor.x, memory.anchor.y);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
422
|
+
for (let event in memory.onEvents) {
|
|
423
|
+
let className = memory.onEvents[event];
|
|
424
|
+
let instance = getEventTypeByClassName(className);
|
|
425
|
+
if (instance) {
|
|
426
|
+
element.onEvent(event, instance);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// src/classes/canvas/CanvasImage.ts
|
|
432
|
+
var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
433
|
+
constructor(options, imageLink) {
|
|
434
|
+
super(options);
|
|
435
|
+
this.imageLink = "";
|
|
436
|
+
if (imageLink) {
|
|
437
|
+
this.imageLink = imageLink;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
get memory() {
|
|
441
|
+
return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
|
|
442
|
+
className: "CanvasImage",
|
|
443
|
+
textureImage: { image: this.imageLink }
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
set memory(memory) {
|
|
447
|
+
setMemorySprite(this, memory);
|
|
448
|
+
}
|
|
449
|
+
static from(source, skipCache) {
|
|
450
|
+
let sprite = pixi_js.Sprite.from(source, skipCache);
|
|
451
|
+
let mySprite = new _CanvasImage();
|
|
452
|
+
mySprite.texture = sprite.texture;
|
|
453
|
+
return mySprite;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Load the image from the link and set the texture of the sprite.
|
|
457
|
+
* @param image The link of the image. If it is not set, it will use the imageLink property.
|
|
458
|
+
* @returns A promise that resolves when the image is loaded.
|
|
459
|
+
*/
|
|
460
|
+
load(image) {
|
|
461
|
+
return __async(this, null, function* () {
|
|
462
|
+
if (!image) {
|
|
463
|
+
image = this.imageLink;
|
|
464
|
+
}
|
|
465
|
+
return getTexture(this.imageLink).then((texture) => {
|
|
466
|
+
if (texture) {
|
|
467
|
+
this.texture = texture;
|
|
468
|
+
}
|
|
469
|
+
}).catch((e) => {
|
|
470
|
+
console.error("[Pixi'VN] Error into CanvasImage.load()", e);
|
|
471
|
+
});
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
var CanvasText = class extends pixi_js.Text {
|
|
476
|
+
constructor() {
|
|
477
|
+
super(...arguments);
|
|
478
|
+
this._onEvents = {};
|
|
479
|
+
}
|
|
480
|
+
get memory() {
|
|
481
|
+
return getMemoryText(this);
|
|
482
|
+
}
|
|
483
|
+
set memory(value) {
|
|
484
|
+
setMemoryText(this, value);
|
|
485
|
+
}
|
|
486
|
+
get onEvents() {
|
|
487
|
+
return this._onEvents;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* is same function as on(), but it keeps in memory the children.
|
|
491
|
+
* @param event The event type, e.g., 'click', 'mousedown', 'mouseup', 'pointerdown', etc.
|
|
492
|
+
* @param eventClass The class that extends CanvasEvent.
|
|
493
|
+
* @returns
|
|
494
|
+
* @example
|
|
495
|
+
* ```typescript
|
|
496
|
+
* \@eventDecorator()
|
|
497
|
+
* export class EventTest extends CanvasEvent<CanvasText> {
|
|
498
|
+
* override fn(event: CanvasEventNamesType, text: CanvasText): void {
|
|
499
|
+
* if (event === 'pointerdown') {
|
|
500
|
+
* text.scale.x *= 1.25;
|
|
501
|
+
* text.scale.y *= 1.25;
|
|
502
|
+
* }
|
|
503
|
+
* }
|
|
504
|
+
* }
|
|
505
|
+
* ```
|
|
506
|
+
*
|
|
507
|
+
* ```typescript
|
|
508
|
+
* const text = new CanvasText();
|
|
509
|
+
* text.text = "Hello World"
|
|
510
|
+
*
|
|
511
|
+
* text.eventMode = 'static';
|
|
512
|
+
* text.cursor = 'pointer';
|
|
513
|
+
* text.onEvent('pointerdown', EventTest);
|
|
514
|
+
*
|
|
515
|
+
* GameWindowManager.addCanvasElement("text", text);
|
|
516
|
+
* ```
|
|
517
|
+
*/
|
|
518
|
+
onEvent(event, eventClass) {
|
|
519
|
+
let className = eventClass.name;
|
|
520
|
+
let instance = getEventInstanceByClassName(className);
|
|
521
|
+
this._onEvents[event] = className;
|
|
522
|
+
if (instance) {
|
|
523
|
+
super.on(event, () => {
|
|
524
|
+
instance.fn(event, this);
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
return this;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* on() does not keep in memory the event class, use onEvent() instead
|
|
531
|
+
* @deprecated
|
|
532
|
+
* @private
|
|
533
|
+
* @param event
|
|
534
|
+
* @param fn
|
|
535
|
+
* @param context
|
|
536
|
+
*/
|
|
537
|
+
on(event, fn, context) {
|
|
538
|
+
return super.on(event, fn, context);
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
function getMemoryText(element) {
|
|
542
|
+
let temp = getMemoryContainer(element);
|
|
543
|
+
return __spreadProps(__spreadValues({}, temp), {
|
|
544
|
+
className: "CanvasText",
|
|
545
|
+
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
546
|
+
text: element.text,
|
|
547
|
+
resolution: element.resolution,
|
|
548
|
+
style: getTextStyle(element.style),
|
|
549
|
+
roundPixels: element.roundPixels,
|
|
550
|
+
onEvents: element.onEvents
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
function setMemoryText(element, memory) {
|
|
554
|
+
setMemoryContainer(element, memory);
|
|
555
|
+
if (memory.anchor) {
|
|
556
|
+
if (typeof memory.anchor === "number") {
|
|
557
|
+
element.anchor.set(memory.anchor, memory.anchor);
|
|
558
|
+
} else {
|
|
559
|
+
element.anchor.set(memory.anchor.x, memory.anchor.y);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
memory.text && (element.text = memory.text);
|
|
563
|
+
memory.resolution && (element.resolution = memory.resolution);
|
|
564
|
+
memory.style && (element.style = memory.style);
|
|
565
|
+
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
566
|
+
for (let event in memory.onEvents) {
|
|
567
|
+
let className = memory.onEvents[event];
|
|
568
|
+
let instance = getEventTypeByClassName(className);
|
|
569
|
+
if (instance) {
|
|
570
|
+
element.onEvent(event, instance);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// src/classes/ticker/TickerBase.ts
|
|
576
|
+
var TickerBase = class {
|
|
577
|
+
/**
|
|
578
|
+
* @param args The arguments that you want to pass to the ticker.
|
|
579
|
+
* @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.
|
|
580
|
+
* @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
|
|
581
|
+
*/
|
|
582
|
+
constructor(args, duration, priority) {
|
|
583
|
+
this.args = args;
|
|
584
|
+
this.duration = duration;
|
|
585
|
+
this.priority = priority;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* The method that will be called every frame.
|
|
589
|
+
* This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
|
|
590
|
+
* @param t The ticker that is calling this method
|
|
591
|
+
* @param args The arguments that you passed when you added the ticker
|
|
592
|
+
* @param tags The tags of the canvas elements that are connected to this ticker
|
|
593
|
+
*/
|
|
594
|
+
fn(_t, _args, _tags) {
|
|
595
|
+
throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
// src/decorators/TickerDecorator.ts
|
|
600
|
+
var registeredTickers = {};
|
|
601
|
+
function tickerDecorator(name) {
|
|
602
|
+
return function(target) {
|
|
603
|
+
if (!name) {
|
|
604
|
+
name = target.name;
|
|
605
|
+
}
|
|
606
|
+
if (registeredTickers[name]) {
|
|
607
|
+
console.warn(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`);
|
|
608
|
+
}
|
|
609
|
+
registeredTickers[name] = target;
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
function geTickerInstanceByClassName(tickerName, args, duration, priority) {
|
|
613
|
+
try {
|
|
614
|
+
let ticker = registeredTickers[tickerName];
|
|
615
|
+
if (!ticker) {
|
|
616
|
+
console.error(`[Pixi'VN] Ticker ${tickerName} not found`);
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
return new ticker(args, duration, priority);
|
|
620
|
+
} catch (e) {
|
|
621
|
+
console.error(`[Pixi'VN] Error while getting Ticker ${tickerName}`, e);
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// src/classes/ticker/TickerFadeAlpha.ts
|
|
627
|
+
var TickerFadeAlpha = class extends TickerBase {
|
|
628
|
+
/**
|
|
629
|
+
* The method that will be called every frame to fade the alpha of the canvas element of the canvas.
|
|
630
|
+
* @param delta The delta time
|
|
631
|
+
* @param args The arguments that are passed to the ticker
|
|
632
|
+
* @param tags The tags of the canvas element that are connected to this ticker
|
|
633
|
+
*/
|
|
634
|
+
fn(t, args, tags) {
|
|
635
|
+
let type = args.type === void 0 ? "hide" : args.type;
|
|
636
|
+
let speed = args.speed === void 0 ? 0.1 : args.speed;
|
|
637
|
+
let limit = args.limit === void 0 ? type === "hide" ? 0 : 1 : args.limit;
|
|
638
|
+
let removeElementAfter = args.tagToRemoveAfter || [];
|
|
639
|
+
if (typeof removeElementAfter === "string") {
|
|
640
|
+
removeElementAfter = [removeElementAfter];
|
|
641
|
+
}
|
|
642
|
+
if (type === "hide" && limit < 0) {
|
|
643
|
+
limit = 0;
|
|
644
|
+
}
|
|
645
|
+
if (type === "show" && limit > 1) {
|
|
646
|
+
limit = 1;
|
|
647
|
+
}
|
|
648
|
+
tags.filter((tag) => {
|
|
649
|
+
var _a;
|
|
650
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
651
|
+
if (args.startOnlyIfHaveTexture) {
|
|
652
|
+
if (element && element instanceof pixi_js.Sprite && ((_a = element.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
653
|
+
return false;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
return true;
|
|
657
|
+
}).forEach((tag) => {
|
|
658
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
659
|
+
if (element && element instanceof pixi_js.Container) {
|
|
660
|
+
if (type === "show" && element.alpha < limit) {
|
|
661
|
+
element.alpha += speed * t.deltaTime;
|
|
662
|
+
} else if (type === "hide" && element.alpha > limit) {
|
|
663
|
+
element.alpha -= speed * t.deltaTime;
|
|
664
|
+
} else {
|
|
665
|
+
element.alpha = limit;
|
|
666
|
+
GameWindowManager.removeAssociationBetweenTickerCanvasElement(tag, this);
|
|
667
|
+
GameWindowManager.removeCanvasElement(removeElementAfter);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
TickerFadeAlpha = __decorateClass([
|
|
674
|
+
tickerDecorator()
|
|
675
|
+
], TickerFadeAlpha);
|
|
676
|
+
|
|
677
|
+
// src/functions/TickerUtility.ts
|
|
678
|
+
function updateTickerProgression(args, propertyName, progression) {
|
|
679
|
+
if (args.hasOwnProperty(propertyName) && typeof args[propertyName] !== "number") {
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
if (args[propertyName] !== void 0 && progression && args[propertyName] !== progression.limit) {
|
|
683
|
+
if (progression.type === "linear") {
|
|
684
|
+
args[propertyName] += progression.amt;
|
|
685
|
+
if (progression.limit !== void 0) {
|
|
686
|
+
if (args[propertyName] > progression.limit && progression.amt > 0) {
|
|
687
|
+
args[propertyName] = progression.limit;
|
|
688
|
+
} else if (args[propertyName] < progression.limit && progression.amt < 0) {
|
|
689
|
+
args[propertyName] = progression.limit;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
} else if (progression.type === "exponential") {
|
|
693
|
+
args[propertyName] += args[propertyName] * progression.percentage;
|
|
694
|
+
if (progression.limit !== void 0) {
|
|
695
|
+
if (args[propertyName] > progression.limit && progression.percentage > 0) {
|
|
696
|
+
args[propertyName] = progression.limit;
|
|
697
|
+
} else if (args[propertyName] < progression.limit && progression.percentage < 0) {
|
|
698
|
+
args[propertyName] = progression.limit;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
// src/classes/ticker/TickerMove.ts
|
|
706
|
+
var TickerMove = class extends TickerBase {
|
|
707
|
+
/**
|
|
708
|
+
* The method that will be called every frame to move the canvas element of the canvas.
|
|
709
|
+
* @param t The ticker that is calling this method
|
|
710
|
+
* @param args The arguments that are passed to the ticker
|
|
711
|
+
* @param tags The tags of the canvas element that are connected to this ticker
|
|
712
|
+
*/
|
|
713
|
+
fn(t, args, tags) {
|
|
714
|
+
let speed = args.speed === void 0 ? 0.1 : args.speed;
|
|
715
|
+
let destination = args.destination;
|
|
716
|
+
tags.filter((tag) => {
|
|
717
|
+
var _a;
|
|
718
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
719
|
+
if (args.startOnlyIfHaveTexture) {
|
|
720
|
+
if (element && element instanceof pixi_js.Sprite && ((_a = element.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
721
|
+
return false;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
return true;
|
|
725
|
+
}).forEach((tag) => {
|
|
726
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
727
|
+
if (element && element instanceof pixi_js.Container) {
|
|
728
|
+
let xDistance = destination.x - element.x;
|
|
729
|
+
if (xDistance != 0) {
|
|
730
|
+
element.x += xDistance / speed * t.deltaTime;
|
|
731
|
+
let newDistance = destination.x - element.x;
|
|
732
|
+
if (xDistance < 0 && newDistance > 0 || xDistance > 0 && newDistance < 0) {
|
|
733
|
+
element.x = destination.x;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
let yDistance = destination.y - element.y;
|
|
737
|
+
if (yDistance != 0) {
|
|
738
|
+
element.y += yDistance / speed * t.deltaTime;
|
|
739
|
+
let newDistance = destination.y - element.y;
|
|
740
|
+
if (yDistance < 0 && newDistance > 0 || yDistance > 0 && newDistance < 0) {
|
|
741
|
+
element.y = destination.y;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
if (args.speedProgression)
|
|
747
|
+
updateTickerProgression(args, "speed", args.speedProgression);
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
TickerMove = __decorateClass([
|
|
751
|
+
tickerDecorator()
|
|
752
|
+
], TickerMove);
|
|
753
|
+
var TickerRotate = class extends TickerBase {
|
|
754
|
+
/**
|
|
755
|
+
* The method that will be called every frame to rotate the canvas element of the canvas.
|
|
756
|
+
* @param delta The delta time
|
|
757
|
+
* @param args The arguments that are passed to the ticker
|
|
758
|
+
* @param tags The tags of the canvas element that are connected to this ticker
|
|
759
|
+
*/
|
|
760
|
+
fn(t, args, tags) {
|
|
761
|
+
let speed = args.speed === void 0 ? 0.1 : args.speed;
|
|
762
|
+
let clockwise = args.clockwise === void 0 ? true : args.clockwise;
|
|
763
|
+
tags.filter((tag) => {
|
|
764
|
+
var _a;
|
|
765
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
766
|
+
if (args.startOnlyIfHaveTexture) {
|
|
767
|
+
if (element && element instanceof pixi_js.Sprite && ((_a = element.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
768
|
+
return false;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
return true;
|
|
772
|
+
}).forEach((tag) => {
|
|
773
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
774
|
+
if (element && element instanceof pixi_js.Container) {
|
|
775
|
+
if (clockwise)
|
|
776
|
+
element.rotation += speed * t.deltaTime;
|
|
777
|
+
else
|
|
778
|
+
element.rotation -= speed * t.deltaTime;
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
if (args.speedProgression)
|
|
782
|
+
updateTickerProgression(args, "speed", args.speedProgression);
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
TickerRotate = __decorateClass([
|
|
786
|
+
tickerDecorator()
|
|
787
|
+
], TickerRotate);
|
|
788
|
+
|
|
789
|
+
// src/functions/ExportUtility.ts
|
|
790
|
+
function createExportableElement(element) {
|
|
791
|
+
try {
|
|
792
|
+
let elementString = JSON.stringify(element);
|
|
793
|
+
return JSON.parse(elementString);
|
|
794
|
+
} catch (e) {
|
|
795
|
+
console.error("[Pixi'VN] Error creating exportable element", e);
|
|
796
|
+
throw new Error("[Pixi'VN] Error creating exportable element");
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
// src/managers/StorageManager.ts
|
|
801
|
+
var _GameStorageManager = class _GameStorageManager {
|
|
802
|
+
constructor() {
|
|
803
|
+
}
|
|
804
|
+
static get keysSystem() {
|
|
805
|
+
return {
|
|
806
|
+
CURRENT_DIALOGUE_MEMORY_KEY: "___current_dialogue_memory___",
|
|
807
|
+
LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY: "___last_dialogue_added_in_step_memory___",
|
|
808
|
+
CURRENT_MENU_OPTIONS_MEMORY_KEY: "___current_menu_options_memory___",
|
|
809
|
+
LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY: "___last_menu_options_added_in_step_memory___",
|
|
810
|
+
CHARACTER_CATEGORY_KEY: "___character___",
|
|
811
|
+
FLAGS_CATEGORY_KEY: "___flags___"
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Set a variable in the storage
|
|
816
|
+
* @param key The key of the variable
|
|
817
|
+
* @param value The value of the variable. If undefined, the variable will be removed
|
|
818
|
+
* @returns
|
|
819
|
+
*/
|
|
820
|
+
static setVariable(key, value) {
|
|
821
|
+
key = key.toLowerCase();
|
|
822
|
+
if (value === void 0 || value === null) {
|
|
823
|
+
if (_GameStorageManager.storage.hasOwnProperty(key)) {
|
|
824
|
+
delete _GameStorageManager.storage[key];
|
|
825
|
+
}
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
_GameStorageManager.storage[key] = value;
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Get a variable from the storage
|
|
832
|
+
* @param key The key of the variable
|
|
833
|
+
* @returns The value of the variable. If the variable does not exist, it will return undefined
|
|
834
|
+
*/
|
|
835
|
+
static getVariable(key) {
|
|
836
|
+
key = key.toLowerCase();
|
|
837
|
+
if (_GameStorageManager.storage.hasOwnProperty(key)) {
|
|
838
|
+
return _GameStorageManager.storage[key];
|
|
839
|
+
}
|
|
840
|
+
return void 0;
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Remove a variable from the storage
|
|
844
|
+
* @param key The key of the variable
|
|
845
|
+
* @returns
|
|
846
|
+
*/
|
|
847
|
+
static removeVariable(key) {
|
|
848
|
+
key = key.toLowerCase();
|
|
849
|
+
if (_GameStorageManager.storage.hasOwnProperty(key)) {
|
|
850
|
+
delete _GameStorageManager.storage[key];
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Clear the storage and the oidsUsed
|
|
855
|
+
* @returns
|
|
856
|
+
*/
|
|
857
|
+
static clear() {
|
|
858
|
+
_GameStorageManager.storage = {};
|
|
859
|
+
}
|
|
860
|
+
static exportJson() {
|
|
861
|
+
return JSON.stringify(this.export());
|
|
862
|
+
}
|
|
863
|
+
static export() {
|
|
864
|
+
return createExportableElement(_GameStorageManager.storage);
|
|
865
|
+
}
|
|
866
|
+
static importJson(dataString) {
|
|
867
|
+
_GameStorageManager.import(JSON.parse(dataString));
|
|
868
|
+
}
|
|
869
|
+
static import(data) {
|
|
870
|
+
_GameStorageManager.clear();
|
|
871
|
+
try {
|
|
872
|
+
if (data) {
|
|
873
|
+
_GameStorageManager.storage = data;
|
|
874
|
+
} else {
|
|
875
|
+
console.warn("[Pixi'VN] No storage data found");
|
|
876
|
+
}
|
|
877
|
+
} catch (e) {
|
|
878
|
+
console.error("[Pixi'VN] Error importing data", e);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
_GameStorageManager.storage = {};
|
|
883
|
+
var GameStorageManager = _GameStorageManager;
|
|
884
|
+
|
|
885
|
+
// src/functions/EasterEgg.ts
|
|
886
|
+
function asciiArtLog() {
|
|
887
|
+
console.info(`
|
|
888
|
+
____ _ _ ___ ___ _
|
|
889
|
+
| _ \\(_)_ _(_| ) \\ / / \\ | |
|
|
890
|
+
| |_) | \\ \\/ / |/ \\ \\ / /| \\| |
|
|
891
|
+
| __/| |> <| | \\ V / | |\\ |
|
|
892
|
+
|_| |_/_/\\_\\_| \\_/ |_| \\_|
|
|
893
|
+
`);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
// src/types/PauseType.ts
|
|
897
|
+
var PauseValueType = "Pause";
|
|
898
|
+
|
|
899
|
+
// src/types/RepeatType.ts
|
|
900
|
+
var Repeat = "Repeat";
|
|
901
|
+
|
|
902
|
+
// src/managers/WindowManager.ts
|
|
903
|
+
var _GameWindowManager = class _GameWindowManager {
|
|
904
|
+
constructor() {
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* The PIXI Application instance.
|
|
908
|
+
* It not recommended to use this property directly.
|
|
909
|
+
*/
|
|
910
|
+
static get app() {
|
|
911
|
+
if (!_GameWindowManager._app) {
|
|
912
|
+
throw new Error("[Pixi'VN] GameWindowManager.app is undefined");
|
|
913
|
+
}
|
|
914
|
+
return _GameWindowManager._app;
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* If the manager is initialized.
|
|
918
|
+
*/
|
|
919
|
+
static get isInitialized() {
|
|
920
|
+
return _GameWindowManager._isInitialized;
|
|
921
|
+
}
|
|
922
|
+
static get screen() {
|
|
923
|
+
return _GameWindowManager.app.screen;
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Initialize the PIXI Application and the interface div.
|
|
927
|
+
* This method should be called before any other method.
|
|
928
|
+
* @param element The html element where I will put the canvas. Example: document.body
|
|
929
|
+
* @param width The width of the canvas
|
|
930
|
+
* @param height The height of the canvas
|
|
931
|
+
* @param options The options of PIXI Application
|
|
932
|
+
* @example
|
|
933
|
+
* ```typescript
|
|
934
|
+
* const body = document.body
|
|
935
|
+
* if (!body) {
|
|
936
|
+
* throw new Error('body element not found')
|
|
937
|
+
* }
|
|
938
|
+
* await GameWindowManager.initialize(body, 1920, 1080, {
|
|
939
|
+
* backgroundColor: "#303030"
|
|
940
|
+
* })
|
|
941
|
+
* ```
|
|
942
|
+
*/
|
|
943
|
+
static initialize(element, width, height, options) {
|
|
944
|
+
return __async(this, null, function* () {
|
|
945
|
+
_GameWindowManager.canvasWidth = width;
|
|
946
|
+
_GameWindowManager.canvasHeight = height;
|
|
947
|
+
_GameWindowManager._app = new pixi_js.Application();
|
|
948
|
+
return _GameWindowManager.app.init(__spreadValues({
|
|
949
|
+
resolution: window.devicePixelRatio || 1,
|
|
950
|
+
autoDensity: true,
|
|
951
|
+
width,
|
|
952
|
+
height
|
|
953
|
+
}, options)).then(() => {
|
|
954
|
+
_GameWindowManager._isInitialized = true;
|
|
955
|
+
this.addCanvasIntoElement(element);
|
|
956
|
+
window.addEventListener("resize", _GameWindowManager.resize);
|
|
957
|
+
_GameWindowManager.resize();
|
|
958
|
+
asciiArtLog();
|
|
959
|
+
});
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Add the canvas into a html element.
|
|
964
|
+
* @param element it is the html element where I will put the canvas. Example: document.body
|
|
965
|
+
*/
|
|
966
|
+
static addCanvasIntoElement(element) {
|
|
967
|
+
if (_GameWindowManager.isInitialized) {
|
|
968
|
+
element.appendChild(_GameWindowManager.app.canvas);
|
|
969
|
+
} else {
|
|
970
|
+
console.error("[Pixi'VN] GameWindowManager is not initialized");
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Initialize the interface div and add it into a html element.
|
|
975
|
+
* @param element it is the html element where I will put the interface div. Example: document.getElementById('root')
|
|
976
|
+
* @example
|
|
977
|
+
* ```typescript
|
|
978
|
+
* const root = document.getElementById('root')
|
|
979
|
+
* if (!root) {
|
|
980
|
+
* throw new Error('root element not found')
|
|
981
|
+
* }
|
|
982
|
+
* GameWindowManager.initializeHTMLLayout(root)
|
|
983
|
+
* const reactRoot = createRoot(GameWindowManager.htmlLayout)
|
|
984
|
+
* reactRoot.render(
|
|
985
|
+
* <App />
|
|
986
|
+
* )
|
|
987
|
+
* ```
|
|
988
|
+
*/
|
|
989
|
+
static initializeHTMLLayout(element) {
|
|
990
|
+
let div = document.createElement("div");
|
|
991
|
+
div.style.position = "absolute";
|
|
992
|
+
div.style.pointerEvents = "none";
|
|
993
|
+
element.appendChild(div);
|
|
994
|
+
_GameWindowManager.htmlLayout = div;
|
|
995
|
+
_GameWindowManager.resize();
|
|
996
|
+
}
|
|
997
|
+
/* Resize Metods */
|
|
998
|
+
/**
|
|
999
|
+
* This method returns the scale of the screen.
|
|
1000
|
+
*/
|
|
1001
|
+
static get screenScale() {
|
|
1002
|
+
let screenWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
|
1003
|
+
let screenHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
|
1004
|
+
return Math.min(screenWidth / _GameWindowManager.canvasWidth, screenHeight / _GameWindowManager.canvasHeight);
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* This method returns the width of the screen enlarged by the scale.
|
|
1008
|
+
*/
|
|
1009
|
+
static get screenWidth() {
|
|
1010
|
+
return Math.floor(_GameWindowManager.screenScale * _GameWindowManager.canvasWidth);
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* This method returns the height of the screen enlarged by the scale.
|
|
1014
|
+
*/
|
|
1015
|
+
static get screenHeight() {
|
|
1016
|
+
return Math.floor(_GameWindowManager.screenScale * _GameWindowManager.canvasHeight);
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* This method returns the horizontal margin of the screen.
|
|
1020
|
+
*/
|
|
1021
|
+
static get horizontalMargin() {
|
|
1022
|
+
let screenWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
|
1023
|
+
return (screenWidth - _GameWindowManager.screenWidth) / 2;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* This method returns the vertical margin of the screen.
|
|
1027
|
+
*/
|
|
1028
|
+
static get verticalMargin() {
|
|
1029
|
+
let screenHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
|
1030
|
+
return (screenHeight - _GameWindowManager.screenHeight) / 2;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* This method is called when the screen is resized.
|
|
1034
|
+
*/
|
|
1035
|
+
static resize() {
|
|
1036
|
+
if (_GameWindowManager.isInitialized) {
|
|
1037
|
+
let style = _GameWindowManager.app.canvas.style;
|
|
1038
|
+
style.width = `${_GameWindowManager.screenWidth}px`;
|
|
1039
|
+
style.height = `${_GameWindowManager.screenHeight}px`;
|
|
1040
|
+
style.marginLeft = `${_GameWindowManager.horizontalMargin}px`;
|
|
1041
|
+
style.marginRight = `${_GameWindowManager.horizontalMargin}px`;
|
|
1042
|
+
style.marginTop = `${_GameWindowManager.verticalMargin}px`;
|
|
1043
|
+
style.marginBottom = `${_GameWindowManager.verticalMargin}px`;
|
|
1044
|
+
}
|
|
1045
|
+
if (_GameWindowManager.htmlLayout) {
|
|
1046
|
+
_GameWindowManager.htmlLayout.style.width = `${_GameWindowManager.screenWidth}px`;
|
|
1047
|
+
_GameWindowManager.htmlLayout.style.height = `${_GameWindowManager.screenHeight}px`;
|
|
1048
|
+
_GameWindowManager.htmlLayout.style.marginLeft = `${_GameWindowManager.horizontalMargin}px`;
|
|
1049
|
+
_GameWindowManager.htmlLayout.style.marginRight = `${_GameWindowManager.horizontalMargin}px`;
|
|
1050
|
+
_GameWindowManager.htmlLayout.style.marginTop = `${_GameWindowManager.verticalMargin}px`;
|
|
1051
|
+
_GameWindowManager.htmlLayout.style.marginBottom = `${_GameWindowManager.verticalMargin}px`;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
/* Edit Canvas Elements Methods */
|
|
1055
|
+
/**
|
|
1056
|
+
* This is a dictionary that contains all Canvas Elements of Canvas, currently.
|
|
1057
|
+
*/
|
|
1058
|
+
static get currentCanvasElements() {
|
|
1059
|
+
return _GameWindowManager._children;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Add a canvas element to the canvas.
|
|
1063
|
+
* If there is a canvas element with the same tag, it will be removed.
|
|
1064
|
+
* @param tag The tag of the canvas element.
|
|
1065
|
+
* @param canvasElement The canvas elements to be added.
|
|
1066
|
+
* @example
|
|
1067
|
+
* ```typescript
|
|
1068
|
+
* const texture = await Assets.load('https://pixijs.com/assets/bunny.png');
|
|
1069
|
+
* const sprite = CanvasSprite.from(texture);
|
|
1070
|
+
* GameWindowManager.addCanvasElement("bunny", sprite);
|
|
1071
|
+
* ```
|
|
1072
|
+
*/
|
|
1073
|
+
static addCanvasElement(tag, canvasElement) {
|
|
1074
|
+
if (_GameWindowManager._children[tag]) {
|
|
1075
|
+
_GameWindowManager.removeCanvasElement(tag);
|
|
1076
|
+
}
|
|
1077
|
+
_GameWindowManager.app.stage.addChild(canvasElement);
|
|
1078
|
+
_GameWindowManager._children[tag] = canvasElement;
|
|
1079
|
+
_GameWindowManager.childrenTagsOrder.push(tag);
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Remove a canvas element from the canvas.
|
|
1083
|
+
* And remove all tickers that are not connected to any canvas element.
|
|
1084
|
+
* @param tag The tag of the canvas element to be removed.
|
|
1085
|
+
* @returns
|
|
1086
|
+
* @example
|
|
1087
|
+
* ```typescript
|
|
1088
|
+
* GameWindowManager.removeCanvasElement("bunny");
|
|
1089
|
+
* ```
|
|
1090
|
+
*/
|
|
1091
|
+
static removeCanvasElement(tag) {
|
|
1092
|
+
if (typeof tag === "string") {
|
|
1093
|
+
tag = [tag];
|
|
1094
|
+
}
|
|
1095
|
+
tag.forEach((t) => {
|
|
1096
|
+
if (_GameWindowManager._children[t]) {
|
|
1097
|
+
_GameWindowManager.app.stage.removeChild(_GameWindowManager._children[t]);
|
|
1098
|
+
delete _GameWindowManager._children[t];
|
|
1099
|
+
}
|
|
1100
|
+
});
|
|
1101
|
+
_GameWindowManager.removeTickersWithoutAssociatedCanvasElement();
|
|
1102
|
+
_GameWindowManager.childrenTagsOrder = _GameWindowManager.childrenTagsOrder.filter((t) => !tag.includes(t));
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Get a canvas element by the tag.
|
|
1106
|
+
* @param tag The tag of the canvas element.
|
|
1107
|
+
* @returns The canvas element.
|
|
1108
|
+
* @example
|
|
1109
|
+
* ```typescript
|
|
1110
|
+
* const sprite = GameWindowManager.getCanvasElement<CanvasSprite>("bunny");
|
|
1111
|
+
* ```
|
|
1112
|
+
*/
|
|
1113
|
+
static getCanvasElement(tag) {
|
|
1114
|
+
return _GameWindowManager._children[tag];
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* Check if a DisplayObject is on the canvas.
|
|
1118
|
+
* @param pixiElement The DisplayObject to be checked.
|
|
1119
|
+
* @returns If the DisplayObject is on the canvas.
|
|
1120
|
+
*/
|
|
1121
|
+
static canvasElementIsOnCanvas(pixiElement) {
|
|
1122
|
+
return _GameWindowManager.app.stage.children.includes(pixiElement);
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Remove all canvas elements from the canvas.
|
|
1126
|
+
* And remove all tickers that are not connected to any canvas element.
|
|
1127
|
+
*/
|
|
1128
|
+
static removeCanvasElements() {
|
|
1129
|
+
_GameWindowManager.app.stage.removeChildren();
|
|
1130
|
+
_GameWindowManager._children = {};
|
|
1131
|
+
_GameWindowManager.childrenTagsOrder = [];
|
|
1132
|
+
_GameWindowManager.removeTickers();
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Edit the tag of a canvas element.
|
|
1136
|
+
* @param oldTag The old tag of the canvas element.
|
|
1137
|
+
* @param newTag The new tag of the canvas element.
|
|
1138
|
+
*/
|
|
1139
|
+
static editTagCanvasElement(oldTag, newTag) {
|
|
1140
|
+
if (_GameWindowManager._children[oldTag]) {
|
|
1141
|
+
_GameWindowManager._children[newTag] = _GameWindowManager._children[oldTag];
|
|
1142
|
+
delete _GameWindowManager._children[oldTag];
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
/** Edit Tickers Methods */
|
|
1146
|
+
/**
|
|
1147
|
+
* Currently tickers that are running.
|
|
1148
|
+
*/
|
|
1149
|
+
static get currentTickers() {
|
|
1150
|
+
return _GameWindowManager._currentTickers;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* The steps of the tickers
|
|
1154
|
+
*/
|
|
1155
|
+
static get currentTickersSteps() {
|
|
1156
|
+
return _GameWindowManager._currentTickersSteps;
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Run a ticker.
|
|
1160
|
+
* @param canvasEslementTag The tag of the canvas element that will use the ticker.
|
|
1161
|
+
* @param ticker The ticker class to be run.
|
|
1162
|
+
* @param args The arguments to be used in the ticker.
|
|
1163
|
+
* @param duration The time to be used in the ticker. This number is in milliseconds. If it is undefined, the ticker will run forever.
|
|
1164
|
+
* @param priority The priority to be used in the ticker.
|
|
1165
|
+
* @returns
|
|
1166
|
+
* @example
|
|
1167
|
+
* ```typescript
|
|
1168
|
+
* GameWindowManager.addTicker("alien", new TickerRotate({ speed: 0.2 }))
|
|
1169
|
+
* ```
|
|
1170
|
+
*/
|
|
1171
|
+
static addTicker(canvasElementTag, ticker) {
|
|
1172
|
+
let tickerName = ticker.constructor.name;
|
|
1173
|
+
if (typeof canvasElementTag === "string") {
|
|
1174
|
+
canvasElementTag = [canvasElementTag];
|
|
1175
|
+
}
|
|
1176
|
+
let t = geTickerInstanceByClassName(tickerName, ticker.args, ticker.duration, ticker.priority);
|
|
1177
|
+
if (!t) {
|
|
1178
|
+
console.error(`[Pixi'VN] Ticker ${tickerName} not found`);
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(canvasElementTag, ticker);
|
|
1182
|
+
let tickerHistory = {
|
|
1183
|
+
fn: () => {
|
|
1184
|
+
},
|
|
1185
|
+
className: tickerName,
|
|
1186
|
+
args: ticker.args,
|
|
1187
|
+
canvasElementTags: canvasElementTag,
|
|
1188
|
+
priority: ticker.priority,
|
|
1189
|
+
duration: ticker.duration
|
|
1190
|
+
};
|
|
1191
|
+
_GameWindowManager.pushTicker(tickerHistory, t);
|
|
1192
|
+
_GameWindowManager.removeTickersWithoutAssociatedCanvasElement();
|
|
1193
|
+
if (ticker.duration) {
|
|
1194
|
+
let timeout = setTimeout(() => {
|
|
1195
|
+
_GameWindowManager.removeTickerTimeoutInfo(timeout);
|
|
1196
|
+
_GameWindowManager.nextTickerStep(canvasElementTag);
|
|
1197
|
+
}, ticker.duration);
|
|
1198
|
+
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag, tickerName, timeout.toString());
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
static pushTicker(tickerData, ticker) {
|
|
1202
|
+
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags, tickerData);
|
|
1203
|
+
_GameWindowManager._currentTickers.push(tickerData);
|
|
1204
|
+
tickerData.fn = (t) => {
|
|
1205
|
+
ticker == null ? void 0 : ticker.fn(t, tickerData.args, tickerData.canvasElementTags);
|
|
1206
|
+
};
|
|
1207
|
+
_GameWindowManager.app.ticker.add(tickerData.fn, void 0, tickerData.priority);
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Run a sequence of tickers.
|
|
1211
|
+
* @param tag The tag of canvas element that will use the tickers.
|
|
1212
|
+
* @param steps The steps of the tickers.
|
|
1213
|
+
* @returns
|
|
1214
|
+
* @example
|
|
1215
|
+
* ```typescript
|
|
1216
|
+
* GameWindowManager.addTickersSteps("alien", [
|
|
1217
|
+
* new TickerRotate({ speed: 0.1, clockwise: true }, 2000),
|
|
1218
|
+
* Pause(500),
|
|
1219
|
+
* new TickerRotate({ speed: 0.2, clockwise: false }, 2000),
|
|
1220
|
+
* Repeat,
|
|
1221
|
+
* ])
|
|
1222
|
+
* ```
|
|
1223
|
+
*/
|
|
1224
|
+
static addTickersSteps(tag, steps) {
|
|
1225
|
+
if (steps.length == 0) {
|
|
1226
|
+
console.warn("[Pixi'VN] The steps of the tickers is empty");
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
let alredyExists = _GameWindowManager._currentTickersSteps[tag] !== void 0;
|
|
1230
|
+
_GameWindowManager._currentTickersSteps[tag] = {
|
|
1231
|
+
currentStepNumber: 0,
|
|
1232
|
+
steps: steps.map((s) => {
|
|
1233
|
+
if (s === Repeat) {
|
|
1234
|
+
return s;
|
|
1235
|
+
}
|
|
1236
|
+
if (!s.duration) {
|
|
1237
|
+
console.warn("[Pixi'VN] Duration is not defined, so it will be set to 1000");
|
|
1238
|
+
s.duration = 1e3;
|
|
1239
|
+
}
|
|
1240
|
+
if (s.hasOwnProperty("type") && s.type === PauseValueType) {
|
|
1241
|
+
return s;
|
|
1242
|
+
}
|
|
1243
|
+
let tickerName = s.constructor.name;
|
|
1244
|
+
return {
|
|
1245
|
+
ticker: tickerName,
|
|
1246
|
+
args: s.args,
|
|
1247
|
+
duration: s.duration
|
|
1248
|
+
};
|
|
1249
|
+
})
|
|
1250
|
+
};
|
|
1251
|
+
if (!alredyExists) {
|
|
1252
|
+
_GameWindowManager.runTickersSteps(tag);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
static runTickersSteps(tag) {
|
|
1256
|
+
let step = _GameWindowManager._currentTickersSteps[tag].steps[_GameWindowManager._currentTickersSteps[tag].currentStepNumber];
|
|
1257
|
+
if (step === Repeat) {
|
|
1258
|
+
step = _GameWindowManager._currentTickersSteps[tag].steps[0];
|
|
1259
|
+
_GameWindowManager._currentTickersSteps[tag].currentStepNumber = 0;
|
|
1260
|
+
if (step === Repeat) {
|
|
1261
|
+
console.error("[Pixi'VN] TikersSteps has a RepeatType in the first step");
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
if (step.hasOwnProperty("type") && step.type === PauseValueType) {
|
|
1266
|
+
let timeout = setTimeout(() => {
|
|
1267
|
+
_GameWindowManager.removeTickerTimeoutInfo(timeout);
|
|
1268
|
+
_GameWindowManager.nextTickerStep(tag);
|
|
1269
|
+
}, step.duration);
|
|
1270
|
+
_GameWindowManager.addTickerTimeoutInfo(tag, "steps", timeout.toString());
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
let ticker = geTickerInstanceByClassName(step.ticker, step.args, step.duration, step.priority);
|
|
1274
|
+
if (!ticker) {
|
|
1275
|
+
console.error(`[Pixi'VN] Ticker ${step.ticker} not found`);
|
|
1276
|
+
return;
|
|
1277
|
+
}
|
|
1278
|
+
_GameWindowManager.addTicker(tag, ticker);
|
|
1279
|
+
}
|
|
1280
|
+
static nextTickerStep(tag) {
|
|
1281
|
+
if (typeof tag === "string") {
|
|
1282
|
+
tag = [tag];
|
|
1283
|
+
}
|
|
1284
|
+
tag.forEach((tag2) => {
|
|
1285
|
+
if (_GameWindowManager._currentTickersSteps[tag2]) {
|
|
1286
|
+
let steps = _GameWindowManager._currentTickersSteps[tag2];
|
|
1287
|
+
if (steps.currentStepNumber + 1 < steps.steps.length) {
|
|
1288
|
+
steps.currentStepNumber++;
|
|
1289
|
+
_GameWindowManager._currentTickersSteps[tag2] = steps;
|
|
1290
|
+
_GameWindowManager.runTickersSteps(tag2);
|
|
1291
|
+
} else {
|
|
1292
|
+
delete _GameWindowManager._currentTickersSteps[tag2];
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1297
|
+
/**
|
|
1298
|
+
* Remove a connection between a canvas element and a ticker.
|
|
1299
|
+
* And remove the ticker if there is no canvas element connected to it.
|
|
1300
|
+
* @param tag The tag of the canvas element that will use the ticker.
|
|
1301
|
+
* @param ticker The ticker class to be removed.
|
|
1302
|
+
* @example
|
|
1303
|
+
* ```typescript
|
|
1304
|
+
* GameWindowManager.removeAssociationBetweenTickerCanvasElement("alien", TickerRotate)
|
|
1305
|
+
* ```
|
|
1306
|
+
*/
|
|
1307
|
+
static removeAssociationBetweenTickerCanvasElement(tag, ticker) {
|
|
1308
|
+
let tickerName;
|
|
1309
|
+
if (ticker instanceof TickerBase) {
|
|
1310
|
+
tickerName = ticker.constructor.name;
|
|
1311
|
+
} else {
|
|
1312
|
+
tickerName = ticker.name;
|
|
1313
|
+
}
|
|
1314
|
+
if (typeof tag === "string") {
|
|
1315
|
+
tag = [tag];
|
|
1316
|
+
}
|
|
1317
|
+
_GameWindowManager._currentTickers = _GameWindowManager._currentTickers.map((t) => {
|
|
1318
|
+
if (t.className === tickerName) {
|
|
1319
|
+
t.canvasElementTags = t.canvasElementTags.filter((e) => !tag.includes(e));
|
|
1320
|
+
}
|
|
1321
|
+
return t;
|
|
1322
|
+
});
|
|
1323
|
+
for (let timeout in _GameWindowManager.currentTickersTimeouts) {
|
|
1324
|
+
let t = _GameWindowManager.currentTickersTimeouts[timeout].tags.filter((e) => !tag.includes(e));
|
|
1325
|
+
if (t.length == 0) {
|
|
1326
|
+
_GameWindowManager.removeTickerTimeoutInfo(timeout);
|
|
1327
|
+
} else {
|
|
1328
|
+
_GameWindowManager.currentTickersTimeouts[timeout].tags = t;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
_GameWindowManager.removeTickersWithoutAssociatedCanvasElement();
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* Remove all tickers that are not connected to any existing canvas element.
|
|
1335
|
+
*/
|
|
1336
|
+
static removeTickersWithoutAssociatedCanvasElement() {
|
|
1337
|
+
let currentTickers = _GameWindowManager._currentTickers.map((t) => {
|
|
1338
|
+
t.canvasElementTags = t.canvasElementTags.filter((e) => _GameWindowManager._children[e]);
|
|
1339
|
+
return t;
|
|
1340
|
+
});
|
|
1341
|
+
currentTickers.filter((t) => t.canvasElementTags.length === 0).forEach((t) => {
|
|
1342
|
+
_GameWindowManager.app.ticker.remove(t.fn);
|
|
1343
|
+
});
|
|
1344
|
+
currentTickers = currentTickers.filter((t) => t.canvasElementTags.length > 0);
|
|
1345
|
+
_GameWindowManager._currentTickers = currentTickers;
|
|
1346
|
+
for (let tag in _GameWindowManager._currentTickersSteps) {
|
|
1347
|
+
if (_GameWindowManager._children[tag] === void 0) {
|
|
1348
|
+
delete _GameWindowManager._currentTickersSteps[tag];
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
static addTickerTimeoutInfo(tags, ticker, timeout) {
|
|
1353
|
+
if (typeof tags === "string") {
|
|
1354
|
+
tags = [tags];
|
|
1355
|
+
}
|
|
1356
|
+
_GameWindowManager.currentTickersTimeouts[timeout] = {
|
|
1357
|
+
tags,
|
|
1358
|
+
ticker
|
|
1359
|
+
};
|
|
1360
|
+
}
|
|
1361
|
+
static removeTickerTimeoutInfo(timeout) {
|
|
1362
|
+
if (typeof timeout !== "string") {
|
|
1363
|
+
timeout = timeout.toString();
|
|
1364
|
+
}
|
|
1365
|
+
if (_GameWindowManager.currentTickersTimeouts[timeout]) {
|
|
1366
|
+
delete _GameWindowManager.currentTickersTimeouts[timeout];
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* Remove all tickers from the canvas.
|
|
1371
|
+
*/
|
|
1372
|
+
static removeTickers() {
|
|
1373
|
+
_GameWindowManager._currentTickersSteps = {};
|
|
1374
|
+
_GameWindowManager._currentTickers.forEach((t) => {
|
|
1375
|
+
_GameWindowManager.app.ticker.remove(t.fn);
|
|
1376
|
+
});
|
|
1377
|
+
_GameWindowManager._currentTickers = [];
|
|
1378
|
+
for (let timeout in _GameWindowManager.currentTickersTimeouts) {
|
|
1379
|
+
_GameWindowManager.removeTickerTimeoutInfo(timeout);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* Clear the canvas and the tickers.
|
|
1384
|
+
*/
|
|
1385
|
+
static clear() {
|
|
1386
|
+
_GameWindowManager.removeCanvasElements();
|
|
1387
|
+
}
|
|
1388
|
+
/* Export and Import Methods */
|
|
1389
|
+
/**
|
|
1390
|
+
* Export the canvas and the tickers to a JSON string.
|
|
1391
|
+
* @returns The JSON string.
|
|
1392
|
+
*/
|
|
1393
|
+
static exportJson() {
|
|
1394
|
+
return JSON.stringify(this.export());
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* Export the canvas and the tickers to an object.
|
|
1398
|
+
* @returns The object.
|
|
1399
|
+
*/
|
|
1400
|
+
static export() {
|
|
1401
|
+
let currentElements = {};
|
|
1402
|
+
for (let tag in _GameWindowManager._children) {
|
|
1403
|
+
currentElements[tag] = exportCanvasElement(_GameWindowManager._children[tag]);
|
|
1404
|
+
}
|
|
1405
|
+
return {
|
|
1406
|
+
currentTickers: createExportableElement(_GameWindowManager._currentTickers),
|
|
1407
|
+
currentElements: createExportableElement(currentElements),
|
|
1408
|
+
childrenTagsOrder: createExportableElement(_GameWindowManager.childrenTagsOrder)
|
|
1409
|
+
};
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Import the canvas and the tickers from a JSON string.
|
|
1413
|
+
* @param dataString The JSON string.
|
|
1414
|
+
*/
|
|
1415
|
+
static importJson(dataString) {
|
|
1416
|
+
_GameWindowManager.import(JSON.parse(dataString));
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Import the canvas and the tickers from an object.
|
|
1420
|
+
* @param data The object.
|
|
1421
|
+
*/
|
|
1422
|
+
static import(data) {
|
|
1423
|
+
_GameWindowManager.clear();
|
|
1424
|
+
try {
|
|
1425
|
+
if (data.hasOwnProperty("childrenTagsOrder") && data.hasOwnProperty("currentElements")) {
|
|
1426
|
+
let currentElements = data["currentElements"];
|
|
1427
|
+
let childrenTagsOrder = data["childrenTagsOrder"];
|
|
1428
|
+
childrenTagsOrder.forEach((tag) => {
|
|
1429
|
+
if (currentElements[tag]) {
|
|
1430
|
+
let element = importCanvasElement(currentElements[tag]);
|
|
1431
|
+
_GameWindowManager.addCanvasElement(tag, element);
|
|
1432
|
+
_GameWindowManager.childrenTagsOrder.push(tag);
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
} else {
|
|
1436
|
+
console.error("[Pixi'VN] The data does not have the properties childrenTagsOrder and currentElements");
|
|
1437
|
+
return;
|
|
1438
|
+
}
|
|
1439
|
+
if (data.hasOwnProperty("currentTickers")) {
|
|
1440
|
+
let currentTickers = data["currentTickers"];
|
|
1441
|
+
currentTickers.forEach((t) => {
|
|
1442
|
+
let tags = t.canvasElementTags;
|
|
1443
|
+
let ticker = geTickerInstanceByClassName(t.className, t.args, t.duration, t.priority);
|
|
1444
|
+
if (ticker) {
|
|
1445
|
+
_GameWindowManager.addTicker(tags, ticker);
|
|
1446
|
+
} else {
|
|
1447
|
+
console.error(`[Pixi'VN] Ticker ${t.className} not found`);
|
|
1448
|
+
}
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
} catch (e) {
|
|
1452
|
+
console.error("[Pixi'VN] Error importing data", e);
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
_GameWindowManager._app = void 0;
|
|
1457
|
+
_GameWindowManager._isInitialized = false;
|
|
1458
|
+
_GameWindowManager._children = {};
|
|
1459
|
+
/**
|
|
1460
|
+
* The order of the children tags.
|
|
1461
|
+
*/
|
|
1462
|
+
_GameWindowManager.childrenTagsOrder = [];
|
|
1463
|
+
_GameWindowManager._currentTickers = [];
|
|
1464
|
+
_GameWindowManager._currentTickersSteps = {};
|
|
1465
|
+
_GameWindowManager.currentTickersTimeouts = {};
|
|
1466
|
+
var GameWindowManager = _GameWindowManager;
|
|
1467
|
+
|
|
1468
|
+
// src/classes/CharacterBaseModel.ts
|
|
1469
|
+
var CharacterBaseModel = class extends StoredClassModel {
|
|
1470
|
+
/**
|
|
1471
|
+
* @param id The id of the character.
|
|
1472
|
+
* @param props The properties of the character.
|
|
1473
|
+
*/
|
|
1474
|
+
constructor(id, props) {
|
|
1475
|
+
super(GameStorageManager.keysSystem.CHARACTER_CATEGORY_KEY, id);
|
|
1476
|
+
this.defaultName = "";
|
|
1477
|
+
this.defaultName = props.name;
|
|
1478
|
+
this.defaultSurname = props.surname;
|
|
1479
|
+
this.defaultAge = props.age;
|
|
1480
|
+
this._icon = props.icon;
|
|
1481
|
+
this._color = props.color;
|
|
1482
|
+
}
|
|
1483
|
+
/***
|
|
1484
|
+
* The name of the character.
|
|
1485
|
+
* If you set undefined, it will return the default name.
|
|
1486
|
+
*/
|
|
1487
|
+
get name() {
|
|
1488
|
+
return this.getStorageProperty("name") || this.defaultName;
|
|
1489
|
+
}
|
|
1490
|
+
set name(value) {
|
|
1491
|
+
this.setStorageProperty("name", value);
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* The surname of the character.
|
|
1495
|
+
* If you set undefined, it will return the default surname.
|
|
1496
|
+
*/
|
|
1497
|
+
get surname() {
|
|
1498
|
+
return this.getStorageProperty("surname") || this.defaultSurname;
|
|
1499
|
+
}
|
|
1500
|
+
set surname(value) {
|
|
1501
|
+
this.setStorageProperty("surname", value);
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* The age of the character.
|
|
1505
|
+
* If you set undefined, it will return the default age.
|
|
1506
|
+
*/
|
|
1507
|
+
get age() {
|
|
1508
|
+
return this.getStorageProperty("age") || this.defaultAge;
|
|
1509
|
+
}
|
|
1510
|
+
set age(value) {
|
|
1511
|
+
this.setStorageProperty("age", value);
|
|
1512
|
+
}
|
|
1513
|
+
/**
|
|
1514
|
+
* The icon of the character.
|
|
1515
|
+
*/
|
|
1516
|
+
get icon() {
|
|
1517
|
+
return this._icon;
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* The color of the character.
|
|
1521
|
+
*/
|
|
1522
|
+
get color() {
|
|
1523
|
+
return this._color;
|
|
1524
|
+
}
|
|
1525
|
+
};
|
|
1526
|
+
|
|
1527
|
+
module.exports = CharacterBaseModel;
|
|
1528
|
+
//# sourceMappingURL=out.js.map
|
|
1529
|
+
//# sourceMappingURL=CharacterBaseModel.js.map
|