@drincs/pixi-vn 0.6.1 → 0.6.3
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 +8 -1
- package/dist/classes/CanvasEvent.js.map +1 -1
- package/dist/classes/CanvasEvent.mjs +8 -1
- package/dist/classes/CanvasEvent.mjs.map +1 -1
- package/dist/classes/CharacterBaseModel.js +105 -77
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +105 -77
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.js +106 -78
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +106 -78
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.js +2 -2
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +2 -2
- 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 +6 -6
- package/dist/classes/DialogueBaseModel.js.map +1 -1
- package/dist/classes/DialogueBaseModel.mjs +6 -6
- 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 +2 -2
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +2 -2
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/StoredClassModel.js +105 -77
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs +105 -77
- 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 +8 -1
- package/dist/classes/canvas/CanvasBase.js.map +1 -1
- package/dist/classes/canvas/CanvasBase.mjs +8 -1
- 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 +67 -47
- package/dist/classes/canvas/CanvasContainer.js.map +1 -1
- package/dist/classes/canvas/CanvasContainer.mjs +67 -48
- 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 +34 -23
- package/dist/classes/canvas/CanvasImage.js.map +1 -1
- package/dist/classes/canvas/CanvasImage.mjs +31 -23
- 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 +26 -20
- package/dist/classes/canvas/CanvasSprite.js.map +1 -1
- package/dist/classes/canvas/CanvasSprite.mjs +26 -21
- 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 +35 -27
- package/dist/classes/canvas/CanvasText.js.map +1 -1
- package/dist/classes/canvas/CanvasText.mjs +35 -28
- package/dist/classes/canvas/CanvasText.mjs.map +1 -1
- package/dist/classes/canvas/index.js +192 -166
- package/dist/classes/canvas/index.js.map +1 -1
- package/dist/classes/canvas/index.mjs +192 -166
- 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 +118 -83
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +118 -83
- 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 +105 -77
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs +105 -77
- 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 +105 -77
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs +105 -77
- 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 +105 -77
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs +105 -77
- 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 +6 -1
- package/dist/classes/ticker/TickerBase.js.map +1 -1
- package/dist/classes/ticker/TickerBase.mjs +6 -1
- 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 +120 -78
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs +118 -78
- 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 +242 -214
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs +242 -214
- 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 +2 -2
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +2 -2
- 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 +73 -53
- package/dist/decorators/CanvasElementDecorator.js.map +1 -1
- package/dist/decorators/CanvasElementDecorator.mjs +72 -52
- package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
- package/dist/decorators/CharacterDecorator.js +1 -1
- package/dist/decorators/CharacterDecorator.js.map +1 -1
- package/dist/decorators/CharacterDecorator.mjs +1 -1
- package/dist/decorators/CharacterDecorator.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 +12 -11
- package/dist/decorators/EventDecorator.js.map +1 -1
- package/dist/decorators/EventDecorator.mjs +11 -10
- package/dist/decorators/EventDecorator.mjs.map +1 -1
- package/dist/decorators/LabelDecorator.js +106 -78
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +106 -78
- 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 +7 -6
- package/dist/decorators/TickerDecorator.js.map +1 -1
- package/dist/decorators/TickerDecorator.mjs +7 -6
- 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 +108 -78
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +108 -78
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/CanvasUtility.js +66 -47
- package/dist/functions/CanvasUtility.js.map +1 -1
- package/dist/functions/CanvasUtility.mjs +66 -47
- 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 +250 -211
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +250 -211
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/DiffUtility.js +1 -1
- package/dist/functions/DiffUtility.js.map +1 -1
- package/dist/functions/DiffUtility.mjs +1 -1
- package/dist/functions/DiffUtility.mjs.map +1 -1
- package/dist/functions/EasterEgg.js +1 -1
- package/dist/functions/EasterEgg.js.map +1 -1
- package/dist/functions/EasterEgg.mjs +1 -1
- package/dist/functions/EasterEgg.mjs.map +1 -1
- package/dist/functions/ExportUtility.js +1 -1
- package/dist/functions/ExportUtility.js.map +1 -1
- package/dist/functions/ExportUtility.mjs +1 -1
- package/dist/functions/ExportUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js +105 -77
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs +105 -77
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js +105 -77
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs +105 -77
- 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 +381 -196
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs +378 -197
- 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 +153 -83
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +153 -83
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/StepLabelUtility.js +1 -1
- package/dist/functions/StepLabelUtility.js.map +1 -1
- package/dist/functions/StepLabelUtility.mjs +1 -1
- package/dist/functions/StepLabelUtility.mjs.map +1 -1
- package/dist/functions/TextureUtility.js +10 -8
- package/dist/functions/TextureUtility.js.map +1 -1
- package/dist/functions/TextureUtility.mjs +10 -8
- package/dist/functions/TextureUtility.mjs.map +1 -1
- package/dist/functions/TickerUtility.js +1 -1
- package/dist/functions/TickerUtility.js.map +1 -1
- package/dist/functions/TickerUtility.mjs +1 -1
- package/dist/functions/TickerUtility.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 +289 -93
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +287 -95
- 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 +758 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +756 -167
- package/dist/index.mjs.map +1 -1
- package/dist/interface/CharacterBaseModelProps.js +1 -1
- package/dist/interface/CharacterBaseModelProps.js.map +1 -1
- package/dist/interface/CharacterBaseModelProps.mjs +1 -1
- package/dist/interface/CharacterBaseModelProps.mjs.map +1 -1
- package/dist/interface/DialogueHistory.js +1 -1
- package/dist/interface/DialogueHistory.js.map +1 -1
- package/dist/interface/DialogueHistory.mjs +1 -1
- package/dist/interface/DialogueHistory.mjs.map +1 -1
- package/dist/interface/IHistoryStep.d.mts +2 -2
- package/dist/interface/IHistoryStep.d.ts +2 -2
- package/dist/interface/IHistoryStep.js +1 -1
- package/dist/interface/IHistoryStep.js.map +1 -1
- package/dist/interface/IHistoryStep.mjs +1 -1
- package/dist/interface/IHistoryStep.mjs.map +1 -1
- package/dist/interface/IOpenedLabel.js +1 -1
- package/dist/interface/IOpenedLabel.js.map +1 -1
- package/dist/interface/IOpenedLabel.mjs +1 -1
- package/dist/interface/IOpenedLabel.mjs.map +1 -1
- package/dist/interface/ISaveData.d.mts +2 -2
- package/dist/interface/ISaveData.d.ts +2 -2
- package/dist/interface/ISaveData.js +1 -1
- package/dist/interface/ISaveData.js.map +1 -1
- package/dist/interface/ISaveData.mjs +1 -1
- package/dist/interface/ISaveData.mjs.map +1 -1
- package/dist/interface/ITicker.d.mts +2 -1
- package/dist/interface/ITicker.d.ts +2 -1
- package/dist/interface/ITicker.js +1 -1
- package/dist/interface/ITicker.js.map +1 -1
- package/dist/interface/ITicker.mjs +1 -1
- package/dist/interface/ITicker.mjs.map +1 -1
- package/dist/interface/ITickersSteps.d.mts +12 -3
- package/dist/interface/ITickersSteps.d.ts +12 -3
- package/dist/interface/ITickersSteps.js +1 -1
- package/dist/interface/ITickersSteps.js.map +1 -1
- package/dist/interface/ITickersSteps.mjs +1 -1
- package/dist/interface/ITickersSteps.mjs.map +1 -1
- package/dist/interface/TickerHistory.d.mts +3 -3
- package/dist/interface/TickerHistory.d.ts +3 -3
- package/dist/interface/TickerHistory.js +1 -1
- package/dist/interface/TickerHistory.js.map +1 -1
- package/dist/interface/TickerHistory.mjs +1 -1
- package/dist/interface/TickerHistory.mjs.map +1 -1
- package/dist/interface/TickerProgrationType.js +1 -1
- package/dist/interface/TickerProgrationType.js.map +1 -1
- package/dist/interface/TickerProgrationType.mjs +1 -1
- package/dist/interface/TickerProgrationType.mjs.map +1 -1
- package/dist/interface/TickerTimeoutHistory.js +1 -1
- package/dist/interface/TickerTimeoutHistory.js.map +1 -1
- package/dist/interface/TickerTimeoutHistory.mjs +1 -1
- package/dist/interface/TickerTimeoutHistory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.d.mts +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.d.ts +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.js +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasContainerMemory.js +1 -1
- package/dist/interface/canvas/ICanvasContainerMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasContainerMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasContainerMemory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.d.mts +2 -2
- package/dist/interface/canvas/ICanvasImageMemory.d.ts +2 -2
- package/dist/interface/canvas/ICanvasImageMemory.js +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.d.mts +1 -2
- package/dist/interface/canvas/ICanvasSpriteMemory.d.ts +1 -2
- package/dist/interface/canvas/ICanvasSpriteMemory.js +1 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.d.mts +1 -2
- package/dist/interface/canvas/ICanvasTextTextMemory.d.ts +1 -2
- package/dist/interface/canvas/ICanvasTextTextMemory.js +1 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.mjs.map +1 -1
- package/dist/interface/canvas/ITextureMemory.js +1 -1
- package/dist/interface/canvas/ITextureMemory.js.map +1 -1
- package/dist/interface/canvas/ITextureMemory.mjs +1 -1
- package/dist/interface/canvas/ITextureMemory.mjs.map +1 -1
- package/dist/interface/canvas/index.js +1 -1
- package/dist/interface/canvas/index.js.map +1 -1
- package/dist/interface/canvas/index.mjs +1 -1
- package/dist/interface/canvas/index.mjs.map +1 -1
- package/dist/interface/export/ExportedCanvas.d.mts +2 -2
- package/dist/interface/export/ExportedCanvas.d.ts +2 -2
- package/dist/interface/export/ExportedCanvas.js +1 -1
- package/dist/interface/export/ExportedCanvas.js.map +1 -1
- package/dist/interface/export/ExportedCanvas.mjs +1 -1
- package/dist/interface/export/ExportedCanvas.mjs.map +1 -1
- package/dist/interface/export/ExportedStep.d.mts +2 -2
- package/dist/interface/export/ExportedStep.d.ts +2 -2
- package/dist/interface/export/ExportedStep.js +1 -1
- package/dist/interface/export/ExportedStep.js.map +1 -1
- package/dist/interface/export/ExportedStep.mjs +1 -1
- package/dist/interface/export/ExportedStep.mjs.map +1 -1
- package/dist/interface/export/ExportedStorage.js +1 -1
- package/dist/interface/export/ExportedStorage.js.map +1 -1
- package/dist/interface/export/ExportedStorage.mjs +1 -1
- package/dist/interface/export/ExportedStorage.mjs.map +1 -1
- package/dist/interface/export/index.d.mts +2 -2
- package/dist/interface/export/index.d.ts +2 -2
- package/dist/interface/export/index.js +1 -1
- package/dist/interface/export/index.js.map +1 -1
- package/dist/interface/export/index.mjs +1 -1
- package/dist/interface/export/index.mjs.map +1 -1
- package/dist/interface/index.d.mts +2 -2
- package/dist/interface/index.d.ts +2 -2
- package/dist/interface/index.js +1 -1
- package/dist/interface/index.js.map +1 -1
- package/dist/interface/index.mjs +1 -1
- package/dist/interface/index.mjs.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.js +1317 -395
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +1318 -396
- 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} +332 -110
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -0
- package/dist/labels/{EventsTestLabel.mjs → CanvasEventsTestLabel.mjs} +332 -110
- 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/{TickerTestLabel.js → CustomTickerCanvasElementTestLabel.js} +674 -490
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -0
- package/dist/labels/{TickerTestLabel.mjs → CustomTickerCanvasElementTestLabel.mjs} +675 -491
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -0
- package/dist/labels/{ShowImageTest.js → ImagesAnimationsTestLabel.js} +385 -94
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -0
- package/dist/labels/{ShowImageTest.mjs → ImagesAnimationsTestLabel.mjs} +385 -94
- package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -0
- package/dist/labels/MarkdownTest.js +162 -92
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +162 -92
- package/dist/labels/MarkdownTest.mjs.map +1 -1
- package/dist/labels/StartLabel.js +803 -164
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +804 -165
- 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 +109 -77
- package/dist/labels/TestConstant.js.map +1 -1
- package/dist/labels/TestConstant.mjs +108 -78
- package/dist/labels/TestConstant.mjs.map +1 -1
- package/dist/labels/index.js +803 -164
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +804 -165
- 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 +152 -82
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +152 -82
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/StorageManager.js +1 -1
- package/dist/managers/StorageManager.js.map +1 -1
- package/dist/managers/StorageManager.mjs +1 -1
- package/dist/managers/StorageManager.mjs.map +1 -1
- package/dist/managers/WindowManager.d.mts +2 -2
- package/dist/managers/WindowManager.d.ts +2 -2
- package/dist/managers/WindowManager.js +96 -72
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs +96 -72
- 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 +152 -82
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +152 -82
- package/dist/managers/index.mjs.map +1 -1
- package/dist/override/StepLabelProps.js +1 -1
- package/dist/override/StepLabelProps.js.map +1 -1
- package/dist/override/StepLabelProps.mjs +1 -1
- package/dist/override/StepLabelProps.mjs.map +1 -1
- package/dist/override/StepLabelResult.js +1 -1
- package/dist/override/StepLabelResult.js.map +1 -1
- package/dist/override/StepLabelResult.mjs +1 -1
- package/dist/override/StepLabelResult.mjs.map +1 -1
- package/dist/override/index.js +1 -1
- package/dist/override/index.js.map +1 -1
- package/dist/override/index.mjs +1 -1
- package/dist/override/index.mjs.map +1 -1
- package/dist/types/CanvasElementTagType.js +1 -1
- package/dist/types/CanvasElementTagType.js.map +1 -1
- package/dist/types/CanvasElementTagType.mjs +1 -1
- package/dist/types/CanvasElementTagType.mjs.map +1 -1
- package/dist/types/CanvasEventNamesType.js +1 -1
- package/dist/types/CanvasEventNamesType.js.map +1 -1
- package/dist/types/CanvasEventNamesType.mjs +1 -1
- package/dist/types/CanvasEventNamesType.mjs.map +1 -1
- package/dist/types/ChoiceMenuOptionsType.js +1 -1
- package/dist/types/ChoiceMenuOptionsType.js.map +1 -1
- package/dist/types/ChoiceMenuOptionsType.mjs +1 -1
- package/dist/types/ChoiceMenuOptionsType.mjs.map +1 -1
- package/dist/types/CloseType.js +1 -1
- package/dist/types/CloseType.js.map +1 -1
- package/dist/types/CloseType.mjs +1 -1
- package/dist/types/CloseType.mjs.map +1 -1
- package/dist/types/EventIdType.js +1 -1
- package/dist/types/EventIdType.js.map +1 -1
- package/dist/types/EventIdType.mjs +1 -1
- package/dist/types/EventIdType.mjs.map +1 -1
- package/dist/types/HistoryChoiceMenuOption.js +1 -1
- package/dist/types/HistoryChoiceMenuOption.js.map +1 -1
- package/dist/types/HistoryChoiceMenuOption.mjs +1 -1
- package/dist/types/HistoryChoiceMenuOption.mjs.map +1 -1
- package/dist/types/LabelIdType.js +1 -1
- package/dist/types/LabelIdType.js.map +1 -1
- package/dist/types/LabelIdType.mjs +1 -1
- package/dist/types/LabelIdType.mjs.map +1 -1
- package/dist/types/LabelRunModeType.js +1 -1
- package/dist/types/LabelRunModeType.js.map +1 -1
- package/dist/types/LabelRunModeType.mjs +1 -1
- package/dist/types/LabelRunModeType.mjs.map +1 -1
- package/dist/types/PauseType.js +1 -1
- package/dist/types/PauseType.js.map +1 -1
- package/dist/types/PauseType.mjs +1 -1
- package/dist/types/PauseType.mjs.map +1 -1
- package/dist/types/RepeatType.js +1 -1
- package/dist/types/RepeatType.js.map +1 -1
- package/dist/types/RepeatType.mjs +1 -1
- package/dist/types/RepeatType.mjs.map +1 -1
- package/dist/types/StepHistoryDataType.js +1 -1
- package/dist/types/StepHistoryDataType.js.map +1 -1
- package/dist/types/StepHistoryDataType.mjs +1 -1
- package/dist/types/StepHistoryDataType.mjs.map +1 -1
- package/dist/types/StepLabelType.js +1 -1
- package/dist/types/StepLabelType.js.map +1 -1
- package/dist/types/StepLabelType.mjs +1 -1
- package/dist/types/StepLabelType.mjs.map +1 -1
- package/dist/types/StorageElementType.js +1 -1
- package/dist/types/StorageElementType.js.map +1 -1
- package/dist/types/StorageElementType.mjs +1 -1
- package/dist/types/StorageElementType.mjs.map +1 -1
- package/dist/types/TickerIdType.js +1 -1
- package/dist/types/TickerIdType.js.map +1 -1
- package/dist/types/TickerIdType.mjs +1 -1
- package/dist/types/TickerIdType.mjs.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/ticker/FadeAlphaTickerProps.js +1 -1
- package/dist/types/ticker/FadeAlphaTickerProps.js.map +1 -1
- package/dist/types/ticker/FadeAlphaTickerProps.mjs +1 -1
- package/dist/types/ticker/FadeAlphaTickerProps.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/MoveTickerProps.js +1 -1
- package/dist/types/ticker/MoveTickerProps.js.map +1 -1
- package/dist/types/ticker/MoveTickerProps.mjs +1 -1
- package/dist/types/ticker/MoveTickerProps.mjs.map +1 -1
- package/dist/types/ticker/RotateTickerProps.d.mts +1 -1
- package/dist/types/ticker/RotateTickerProps.d.ts +1 -1
- package/dist/types/ticker/RotateTickerProps.js +1 -1
- package/dist/types/ticker/RotateTickerProps.js.map +1 -1
- package/dist/types/ticker/RotateTickerProps.mjs +1 -1
- package/dist/types/ticker/RotateTickerProps.mjs.map +1 -1
- package/dist/types/ticker/TagToRemoveAfterType.js +1 -1
- package/dist/types/ticker/TagToRemoveAfterType.js.map +1 -1
- package/dist/types/ticker/TagToRemoveAfterType.mjs +1 -1
- package/dist/types/ticker/TagToRemoveAfterType.mjs.map +1 -1
- package/dist/types/ticker/ZoomTickerProps.js +1 -1
- package/dist/types/ticker/ZoomTickerProps.js.map +1 -1
- package/dist/types/ticker/ZoomTickerProps.mjs +1 -1
- package/dist/types/ticker/ZoomTickerProps.mjs.map +1 -1
- package/dist/types/ticker/index.js +1 -1
- package/dist/types/ticker/index.js.map +1 -1
- package/dist/types/ticker/index.mjs +1 -1
- package/dist/types/ticker/index.mjs.map +1 -1
- package/package.json +4 -4
- 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/TickerTestLabel.d.mts +0 -9
- package/dist/labels/TickerTestLabel.d.ts +0 -9
- package/dist/labels/TickerTestLabel.js.map +0 -1
- package/dist/labels/TickerTestLabel.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
|
@@ -56,138 +56,6 @@ var __async = (__this, __arguments, generator) => {
|
|
|
56
56
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
// src/decorators/CanvasElementDecorator.ts
|
|
61
|
-
var registeredCanvasElement = {};
|
|
62
|
-
function getCanvasElementInstanceByClassName(canvasName) {
|
|
63
|
-
try {
|
|
64
|
-
let eventType = registeredCanvasElement[canvasName];
|
|
65
|
-
if (!eventType) {
|
|
66
|
-
if (canvasName === "CanvasContainer") {
|
|
67
|
-
eventType = CanvasContainer;
|
|
68
|
-
} else if (canvasName === "CanvasImage") {
|
|
69
|
-
eventType = CanvasImage;
|
|
70
|
-
} else if (canvasName === "CanvasSprite") {
|
|
71
|
-
eventType = CanvasSprite;
|
|
72
|
-
} else if (canvasName === "CanvasText") {
|
|
73
|
-
eventType = CanvasText;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (!eventType) {
|
|
77
|
-
console.error(`[Pixi'VN] CanvasElement ${canvasName} not found`);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
let canvasElement = new eventType();
|
|
81
|
-
return canvasElement;
|
|
82
|
-
} catch (e) {
|
|
83
|
-
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasName}`, e);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// src/functions/CanvasUtility.ts
|
|
89
|
-
function getTextureMemory(texture) {
|
|
90
|
-
let sourceTexture = texture.source;
|
|
91
|
-
let textureMemory = {
|
|
92
|
-
image: sourceTexture.label
|
|
93
|
-
};
|
|
94
|
-
return textureMemory;
|
|
95
|
-
}
|
|
96
|
-
function exportCanvasElement(element) {
|
|
97
|
-
return element.memory;
|
|
98
|
-
}
|
|
99
|
-
function importCanvasElement(memory) {
|
|
100
|
-
let element = getCanvasElementInstanceByClassName(memory.className);
|
|
101
|
-
if (element) {
|
|
102
|
-
element.memory = memory;
|
|
103
|
-
} else {
|
|
104
|
-
throw new Error("[Pixi'VN] The element " + memory.className + " could not be created");
|
|
105
|
-
}
|
|
106
|
-
return element;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// src/classes/canvas/CanvasContainer.ts
|
|
110
|
-
var CanvasContainer = class extends pixi_js.Container {
|
|
111
|
-
get memory() {
|
|
112
|
-
let memory = getMemoryContainer(this);
|
|
113
|
-
this.children.forEach((child) => {
|
|
114
|
-
memory.elements.push(exportCanvasElement(child));
|
|
115
|
-
});
|
|
116
|
-
return memory;
|
|
117
|
-
}
|
|
118
|
-
set memory(value) {
|
|
119
|
-
setMemoryContainer(this, value);
|
|
120
|
-
value.elements.forEach((child) => {
|
|
121
|
-
this.addChild(importCanvasElement(child));
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
function getMemoryContainer(element) {
|
|
126
|
-
return {
|
|
127
|
-
className: "CanvasContainer",
|
|
128
|
-
elements: [],
|
|
129
|
-
width: element.width,
|
|
130
|
-
height: element.height,
|
|
131
|
-
isRenderGroup: element.isRenderGroup,
|
|
132
|
-
blendMode: element.blendMode,
|
|
133
|
-
tint: element.tint,
|
|
134
|
-
alpha: element.alpha,
|
|
135
|
-
angle: element.angle,
|
|
136
|
-
renderable: element.renderable,
|
|
137
|
-
rotation: element.rotation,
|
|
138
|
-
scale: { x: element.scale.x, y: element.scale.y },
|
|
139
|
-
pivot: { x: element.pivot.x, y: element.pivot.y },
|
|
140
|
-
position: { x: element.position.x, y: element.position.y },
|
|
141
|
-
skew: { x: element.skew.x, y: element.skew.y },
|
|
142
|
-
visible: element.visible,
|
|
143
|
-
culled: element.culled,
|
|
144
|
-
x: element.x,
|
|
145
|
-
y: element.y,
|
|
146
|
-
boundsArea: element.boundsArea,
|
|
147
|
-
cursor: element.cursor,
|
|
148
|
-
eventMode: element.eventMode,
|
|
149
|
-
interactive: element.interactive,
|
|
150
|
-
interactiveChildren: element.interactiveChildren,
|
|
151
|
-
hitArea: element.hitArea
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function setMemoryContainer(element, memory) {
|
|
155
|
-
memory.width && (element.width = memory.width);
|
|
156
|
-
memory.height && (element.height = memory.height);
|
|
157
|
-
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
158
|
-
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
159
|
-
memory.tint && (element.tint = memory.tint);
|
|
160
|
-
memory.alpha && (element.alpha = memory.alpha);
|
|
161
|
-
memory.angle && (element.angle = memory.angle);
|
|
162
|
-
memory.renderable && (element.renderable = memory.renderable);
|
|
163
|
-
memory.rotation && (element.rotation = memory.rotation);
|
|
164
|
-
if (memory.scale) {
|
|
165
|
-
if (typeof memory.scale === "number") {
|
|
166
|
-
element.scale.set(memory.scale, memory.scale);
|
|
167
|
-
} else {
|
|
168
|
-
element.scale.set(memory.scale.x, memory.scale.y);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (memory.pivot) {
|
|
172
|
-
if (typeof memory.pivot === "number") {
|
|
173
|
-
element.pivot.set(memory.pivot, memory.pivot);
|
|
174
|
-
} else {
|
|
175
|
-
element.pivot.set(memory.pivot.x, memory.pivot.y);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
memory.position && element.position.set(memory.position.x, memory.position.y);
|
|
179
|
-
memory.skew && element.skew.set(memory.skew.x, memory.skew.y);
|
|
180
|
-
memory.visible && (element.visible = memory.visible);
|
|
181
|
-
memory.culled && (element.culled = memory.culled);
|
|
182
|
-
memory.x && (element.x = memory.x);
|
|
183
|
-
memory.y && (element.y = memory.y);
|
|
184
|
-
memory.boundsArea && (element.boundsArea = memory.boundsArea);
|
|
185
|
-
memory.cursor && (element.cursor = memory.cursor);
|
|
186
|
-
memory.eventMode && (element.eventMode = memory.eventMode);
|
|
187
|
-
memory.interactive && (element.interactive = memory.interactive);
|
|
188
|
-
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
189
|
-
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
190
|
-
}
|
|
191
59
|
function getTexture(imageUrl) {
|
|
192
60
|
return __async(this, null, function* () {
|
|
193
61
|
if (pixi_js.Assets.cache.has(imageUrl)) {
|
|
@@ -209,17 +77,19 @@ function getTexture(imageUrl) {
|
|
|
209
77
|
});
|
|
210
78
|
});
|
|
211
79
|
}
|
|
212
|
-
function
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
console.warn("[Pixi'VN] CanvasText.style.fill is a FillGradient or FillPattern, this is not supported yet.", fill);
|
|
216
|
-
fill = "#00FF00";
|
|
80
|
+
function getFillGradientFillPattern(prop, propName) {
|
|
81
|
+
if (!(prop instanceof Object)) {
|
|
82
|
+
return prop;
|
|
217
83
|
}
|
|
84
|
+
console.warn(`[Pixi'VN] CanvasText.style.${propName} is a FillGradient or FillPattern, this is not supported yet.`, prop);
|
|
85
|
+
return void 0;
|
|
86
|
+
}
|
|
87
|
+
function getTextStyle(style) {
|
|
218
88
|
return {
|
|
219
89
|
align: style.align,
|
|
220
90
|
breakWords: style.breakWords,
|
|
221
91
|
dropShadow: style.dropShadow,
|
|
222
|
-
fill,
|
|
92
|
+
fill: getFillGradientFillPattern(style.stroke, "fill"),
|
|
223
93
|
fontFamily: style.fontFamily,
|
|
224
94
|
fontSize: style.fontSize,
|
|
225
95
|
fontStyle: style.fontStyle,
|
|
@@ -229,7 +99,7 @@ function getTextStyle(style) {
|
|
|
229
99
|
letterSpacing: style.letterSpacing,
|
|
230
100
|
lineHeight: style.lineHeight,
|
|
231
101
|
padding: style.padding,
|
|
232
|
-
stroke: style.stroke,
|
|
102
|
+
stroke: getFillGradientFillPattern(style.stroke, "stroke"),
|
|
233
103
|
textBaseline: style.textBaseline,
|
|
234
104
|
trim: style.trim,
|
|
235
105
|
whiteSpace: style.whiteSpace,
|
|
@@ -240,40 +110,43 @@ function getTextStyle(style) {
|
|
|
240
110
|
|
|
241
111
|
// src/decorators/EventDecorator.ts
|
|
242
112
|
var registeredEvents = {};
|
|
243
|
-
function
|
|
113
|
+
function getEventTypeById(eventId) {
|
|
244
114
|
try {
|
|
245
|
-
let eventType = registeredEvents[
|
|
115
|
+
let eventType = registeredEvents[eventId];
|
|
246
116
|
if (!eventType) {
|
|
247
|
-
console.error(`[Pixi'VN] Event ${
|
|
117
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
248
118
|
return;
|
|
249
119
|
}
|
|
250
120
|
new eventType();
|
|
251
121
|
return eventType;
|
|
252
122
|
} catch (e) {
|
|
253
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
123
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
254
124
|
return;
|
|
255
125
|
}
|
|
256
126
|
}
|
|
257
|
-
function
|
|
127
|
+
function getEventInstanceById(eventId) {
|
|
258
128
|
try {
|
|
259
|
-
let eventType = registeredEvents[
|
|
129
|
+
let eventType = registeredEvents[eventId];
|
|
260
130
|
if (!eventType) {
|
|
261
|
-
console.error(`[Pixi'VN] Event ${
|
|
131
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
262
132
|
return;
|
|
263
133
|
}
|
|
264
134
|
let event = new eventType();
|
|
265
135
|
return event;
|
|
266
136
|
} catch (e) {
|
|
267
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
137
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
268
138
|
return;
|
|
269
139
|
}
|
|
270
140
|
}
|
|
271
141
|
|
|
272
142
|
// src/classes/canvas/CanvasSprite.ts
|
|
143
|
+
var CANVAS_SPRITE_ID = "CanvasSprite";
|
|
273
144
|
var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
274
|
-
constructor() {
|
|
275
|
-
super(
|
|
145
|
+
constructor(options) {
|
|
146
|
+
super(options);
|
|
147
|
+
this.pixivnId = CANVAS_SPRITE_ID;
|
|
276
148
|
this._onEvents = {};
|
|
149
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_SPRITE_ID;
|
|
277
150
|
}
|
|
278
151
|
get memory() {
|
|
279
152
|
return getMemorySprite(this);
|
|
@@ -314,9 +187,9 @@ var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
|
314
187
|
* ```
|
|
315
188
|
*/
|
|
316
189
|
onEvent(event, eventClass) {
|
|
317
|
-
let
|
|
318
|
-
let instance =
|
|
319
|
-
this._onEvents[event] =
|
|
190
|
+
let id = eventClass.prototype.id;
|
|
191
|
+
let instance = getEventInstanceById(id);
|
|
192
|
+
this._onEvents[event] = id;
|
|
320
193
|
if (instance) {
|
|
321
194
|
super.on(event, () => {
|
|
322
195
|
instance.fn(event, this);
|
|
@@ -345,7 +218,7 @@ var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
|
345
218
|
function getMemorySprite(element) {
|
|
346
219
|
let temp = getMemoryContainer(element);
|
|
347
220
|
return __spreadProps(__spreadValues({}, temp), {
|
|
348
|
-
|
|
221
|
+
pixivnId: element.pixivnId,
|
|
349
222
|
textureImage: getTextureMemory(element.texture),
|
|
350
223
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
351
224
|
roundPixels: element.roundPixels,
|
|
@@ -368,8 +241,8 @@ function setMemorySprite(element, memory) {
|
|
|
368
241
|
}
|
|
369
242
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
370
243
|
for (let event in memory.onEvents) {
|
|
371
|
-
let
|
|
372
|
-
let instance =
|
|
244
|
+
let id = memory.onEvents[event];
|
|
245
|
+
let instance = getEventTypeById(id);
|
|
373
246
|
if (instance) {
|
|
374
247
|
element.onEvent(event, instance);
|
|
375
248
|
}
|
|
@@ -377,9 +250,11 @@ function setMemorySprite(element, memory) {
|
|
|
377
250
|
}
|
|
378
251
|
|
|
379
252
|
// src/classes/canvas/CanvasImage.ts
|
|
253
|
+
var CANVAS_IMAGE_ID = "CanvasImage";
|
|
380
254
|
var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
381
255
|
constructor(options, imageLink) {
|
|
382
256
|
super(options);
|
|
257
|
+
this.pixivnId = CANVAS_IMAGE_ID;
|
|
383
258
|
this.imageLink = "";
|
|
384
259
|
if (imageLink) {
|
|
385
260
|
this.imageLink = imageLink;
|
|
@@ -387,12 +262,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
387
262
|
}
|
|
388
263
|
get memory() {
|
|
389
264
|
return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
|
|
390
|
-
|
|
391
|
-
|
|
265
|
+
pixivnId: this.pixivnId,
|
|
266
|
+
imageLink: this.imageLink
|
|
392
267
|
});
|
|
393
268
|
}
|
|
394
269
|
set memory(memory) {
|
|
395
270
|
setMemorySprite(this, memory);
|
|
271
|
+
this.imageLink = memory.imageLink;
|
|
396
272
|
}
|
|
397
273
|
static from(source, skipCache) {
|
|
398
274
|
let sprite = pixi_js.Sprite.from(source, skipCache);
|
|
@@ -420,10 +296,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
420
296
|
});
|
|
421
297
|
}
|
|
422
298
|
};
|
|
299
|
+
var CANVAS_TEXT_ID = "CanvasText";
|
|
423
300
|
var CanvasText = class extends pixi_js.Text {
|
|
424
|
-
constructor() {
|
|
425
|
-
super(
|
|
301
|
+
constructor(options) {
|
|
302
|
+
super(options);
|
|
303
|
+
this.pixivnId = CANVAS_TEXT_ID;
|
|
426
304
|
this._onEvents = {};
|
|
305
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_TEXT_ID;
|
|
427
306
|
}
|
|
428
307
|
get memory() {
|
|
429
308
|
return getMemoryText(this);
|
|
@@ -464,9 +343,9 @@ var CanvasText = class extends pixi_js.Text {
|
|
|
464
343
|
* ```
|
|
465
344
|
*/
|
|
466
345
|
onEvent(event, eventClass) {
|
|
467
|
-
let
|
|
468
|
-
let instance =
|
|
469
|
-
this._onEvents[event] =
|
|
346
|
+
let id = eventClass.prototype.id;
|
|
347
|
+
let instance = getEventInstanceById(id);
|
|
348
|
+
this._onEvents[event] = id;
|
|
470
349
|
if (instance) {
|
|
471
350
|
super.on(event, () => {
|
|
472
351
|
instance.fn(event, this);
|
|
@@ -489,7 +368,7 @@ var CanvasText = class extends pixi_js.Text {
|
|
|
489
368
|
function getMemoryText(element) {
|
|
490
369
|
let temp = getMemoryContainer(element);
|
|
491
370
|
return __spreadProps(__spreadValues({}, temp), {
|
|
492
|
-
|
|
371
|
+
pixivnId: element.pixivnId,
|
|
493
372
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
494
373
|
text: element.text,
|
|
495
374
|
resolution: element.resolution,
|
|
@@ -512,13 +391,175 @@ function setMemoryText(element, memory) {
|
|
|
512
391
|
memory.style && (element.style = memory.style);
|
|
513
392
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
514
393
|
for (let event in memory.onEvents) {
|
|
515
|
-
let
|
|
516
|
-
let instance =
|
|
394
|
+
let id = memory.onEvents[event];
|
|
395
|
+
let instance = getEventTypeById(id);
|
|
517
396
|
if (instance) {
|
|
518
397
|
element.onEvent(event, instance);
|
|
519
398
|
}
|
|
520
399
|
}
|
|
521
400
|
}
|
|
401
|
+
|
|
402
|
+
// src/decorators/CanvasElementDecorator.ts
|
|
403
|
+
var registeredCanvasElement = {};
|
|
404
|
+
function canvasElementDecorator(name) {
|
|
405
|
+
return function(target) {
|
|
406
|
+
if (registeredCanvasElement[name]) {
|
|
407
|
+
console.warn(`[Pixi'VN] CanvasElement ${name} already registered`);
|
|
408
|
+
}
|
|
409
|
+
target.prototype.pixivnId = name;
|
|
410
|
+
registeredCanvasElement[name] = target;
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
function getCanvasElementInstanceById(canvasId) {
|
|
414
|
+
try {
|
|
415
|
+
let eventType = registeredCanvasElement[canvasId];
|
|
416
|
+
if (!eventType) {
|
|
417
|
+
if (canvasId === CANVAS_CONTAINER_ID) {
|
|
418
|
+
eventType = CanvasContainer;
|
|
419
|
+
} else if (canvasId === CANVAS_IMAGE_ID) {
|
|
420
|
+
eventType = CanvasImage;
|
|
421
|
+
} else if (canvasId === CANVAS_SPRITE_ID) {
|
|
422
|
+
eventType = CanvasSprite;
|
|
423
|
+
} else if (canvasId === CANVAS_TEXT_ID) {
|
|
424
|
+
eventType = CanvasText;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
if (!eventType) {
|
|
428
|
+
console.error(`[Pixi'VN] CanvasElement ${canvasId} not found`);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
let canvasElement = new eventType();
|
|
432
|
+
return canvasElement;
|
|
433
|
+
} catch (e) {
|
|
434
|
+
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasId}`, e);
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// src/functions/CanvasUtility.ts
|
|
440
|
+
function getTextureMemory(texture) {
|
|
441
|
+
let sourceTexture = texture.source;
|
|
442
|
+
let textureMemory = {
|
|
443
|
+
image: sourceTexture.label
|
|
444
|
+
};
|
|
445
|
+
return textureMemory;
|
|
446
|
+
}
|
|
447
|
+
function exportCanvasElement(element) {
|
|
448
|
+
return element.memory;
|
|
449
|
+
}
|
|
450
|
+
function importCanvasElement(memory) {
|
|
451
|
+
let element = getCanvasElementInstanceById(memory.pixivnId);
|
|
452
|
+
if (element) {
|
|
453
|
+
element.memory = memory;
|
|
454
|
+
} else {
|
|
455
|
+
throw new Error("[Pixi'VN] The element " + memory.pixivnId + " could not be created");
|
|
456
|
+
}
|
|
457
|
+
return element;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// src/classes/canvas/CanvasContainer.ts
|
|
461
|
+
var CANVAS_CONTAINER_ID = "CanvasContainer";
|
|
462
|
+
var CanvasContainer = class extends pixi_js.Container {
|
|
463
|
+
constructor(options) {
|
|
464
|
+
super(options);
|
|
465
|
+
this.pixivnId = CANVAS_CONTAINER_ID;
|
|
466
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_CONTAINER_ID;
|
|
467
|
+
}
|
|
468
|
+
get memory() {
|
|
469
|
+
let memory = getMemoryContainer(this);
|
|
470
|
+
this.children.forEach((child) => {
|
|
471
|
+
memory.elements.push(exportCanvasElement(child));
|
|
472
|
+
});
|
|
473
|
+
return memory;
|
|
474
|
+
}
|
|
475
|
+
set memory(value) {
|
|
476
|
+
setMemoryContainer(this, value);
|
|
477
|
+
value.elements.forEach((child) => {
|
|
478
|
+
this.addChild(importCanvasElement(child));
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
function getMemoryContainer(element) {
|
|
483
|
+
let className = "CanvasContainer";
|
|
484
|
+
if (element.hasOwnProperty("pixivnId")) {
|
|
485
|
+
className = element.pixivnId;
|
|
486
|
+
}
|
|
487
|
+
return {
|
|
488
|
+
pixivnId: className,
|
|
489
|
+
elements: [],
|
|
490
|
+
width: element.width,
|
|
491
|
+
height: element.height,
|
|
492
|
+
isRenderGroup: element.isRenderGroup,
|
|
493
|
+
blendMode: element.blendMode,
|
|
494
|
+
tint: element.tint,
|
|
495
|
+
alpha: element.alpha,
|
|
496
|
+
angle: element.angle,
|
|
497
|
+
renderable: element.renderable,
|
|
498
|
+
rotation: element.rotation,
|
|
499
|
+
scale: { x: element.scale.x, y: element.scale.y },
|
|
500
|
+
pivot: { x: element.pivot.x, y: element.pivot.y },
|
|
501
|
+
position: { x: element.position.x, y: element.position.y },
|
|
502
|
+
skew: { x: element.skew.x, y: element.skew.y },
|
|
503
|
+
visible: element.visible,
|
|
504
|
+
x: element.x,
|
|
505
|
+
y: element.y,
|
|
506
|
+
boundsArea: element.boundsArea,
|
|
507
|
+
cursor: element.cursor,
|
|
508
|
+
eventMode: element.eventMode,
|
|
509
|
+
interactive: element.interactive,
|
|
510
|
+
interactiveChildren: element.interactiveChildren,
|
|
511
|
+
hitArea: element.hitArea
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
function setMemoryContainer(element, memory) {
|
|
515
|
+
memory.width && (element.width = memory.width);
|
|
516
|
+
memory.height && (element.height = memory.height);
|
|
517
|
+
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
518
|
+
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
519
|
+
memory.tint && (element.tint = memory.tint);
|
|
520
|
+
memory.alpha && (element.alpha = memory.alpha);
|
|
521
|
+
memory.angle && (element.angle = memory.angle);
|
|
522
|
+
memory.renderable && (element.renderable = memory.renderable);
|
|
523
|
+
memory.rotation && (element.rotation = memory.rotation);
|
|
524
|
+
if (memory.scale) {
|
|
525
|
+
if (typeof memory.scale === "number") {
|
|
526
|
+
element.scale.set(memory.scale, memory.scale);
|
|
527
|
+
} else {
|
|
528
|
+
element.scale.set(memory.scale.x, memory.scale.y);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (memory.pivot) {
|
|
532
|
+
if (typeof memory.pivot === "number") {
|
|
533
|
+
element.pivot.set(memory.pivot, memory.pivot);
|
|
534
|
+
} else {
|
|
535
|
+
element.pivot.set(memory.pivot.x, memory.pivot.y);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
memory.position && element.position.set(memory.position.x, memory.position.y);
|
|
539
|
+
memory.skew && element.skew.set(memory.skew.x, memory.skew.y);
|
|
540
|
+
memory.visible && (element.visible = memory.visible);
|
|
541
|
+
memory.x && (element.x = memory.x);
|
|
542
|
+
memory.y && (element.y = memory.y);
|
|
543
|
+
memory.boundsArea && (element.boundsArea = memory.boundsArea);
|
|
544
|
+
memory.cursor && (element.cursor = memory.cursor);
|
|
545
|
+
memory.eventMode && (element.eventMode = memory.eventMode);
|
|
546
|
+
memory.interactive && (element.interactive = memory.interactive);
|
|
547
|
+
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
548
|
+
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
// src/decorators/CharacterDecorator.ts
|
|
552
|
+
var registeredCharacters = {};
|
|
553
|
+
function saveCharacter(character) {
|
|
554
|
+
if (Array.isArray(character)) {
|
|
555
|
+
character.forEach((c) => saveCharacter(c));
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
if (registeredCharacters[character.id]) {
|
|
559
|
+
console.info(`[Pixi'VN] Character id ${character.id} already exists, it will be overwritten`);
|
|
560
|
+
}
|
|
561
|
+
registeredCharacters[character.id] = character;
|
|
562
|
+
}
|
|
522
563
|
function getStepSha1(step) {
|
|
523
564
|
let sha1String = sha1__default.default(step.toString().toLocaleLowerCase());
|
|
524
565
|
return sha1String.toString();
|
|
@@ -542,7 +583,7 @@ var Label = class {
|
|
|
542
583
|
this._choiseIndex = choiseIndex;
|
|
543
584
|
}
|
|
544
585
|
/**
|
|
545
|
-
* Get the id of the label
|
|
586
|
+
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
546
587
|
*/
|
|
547
588
|
get id() {
|
|
548
589
|
return this._id;
|
|
@@ -600,47 +641,231 @@ function newCloseLabel(choiseIndex) {
|
|
|
600
641
|
return new Label(CLOSE_LABEL_ID, [], void 0, choiseIndex);
|
|
601
642
|
}
|
|
602
643
|
|
|
644
|
+
// src/types/CloseType.ts
|
|
645
|
+
var Close = "close";
|
|
646
|
+
|
|
603
647
|
// src/functions/DialogueUtility.ts
|
|
604
648
|
function setDialogue(props) {
|
|
605
649
|
let text = "";
|
|
606
|
-
let
|
|
650
|
+
let character = void 0;
|
|
607
651
|
let dialogue;
|
|
608
652
|
if (typeof props === "string") {
|
|
609
653
|
text = props;
|
|
610
|
-
dialogue = new DialogueBaseModel(text,
|
|
654
|
+
dialogue = new DialogueBaseModel(text, character);
|
|
611
655
|
} else if (!(props instanceof DialogueBaseModel)) {
|
|
612
656
|
text = props.text;
|
|
613
657
|
if (props.character) {
|
|
614
658
|
if (typeof props.character === "string") {
|
|
615
|
-
|
|
659
|
+
character = props.character;
|
|
660
|
+
} else {
|
|
661
|
+
character = props.character.id;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
dialogue = new DialogueBaseModel(text, character);
|
|
665
|
+
} else {
|
|
666
|
+
dialogue = props;
|
|
667
|
+
}
|
|
668
|
+
GameStorageManager.setVariable(GameStorageManager.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY, dialogue);
|
|
669
|
+
GameStorageManager.setVariable(GameStorageManager.keysSystem.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY, GameStepManager.lastStepIndex);
|
|
670
|
+
}
|
|
671
|
+
function getDialogue() {
|
|
672
|
+
return GameStorageManager.getVariable(GameStorageManager.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);
|
|
673
|
+
}
|
|
674
|
+
function getChoiceMenuOptions() {
|
|
675
|
+
let d = GameStorageManager.getVariable(GameStorageManager.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY);
|
|
676
|
+
if (d) {
|
|
677
|
+
let options = [];
|
|
678
|
+
d.forEach((option, index) => {
|
|
679
|
+
if (option.type === Close) {
|
|
680
|
+
let itemLabel = newCloseLabel(index);
|
|
681
|
+
options.push({
|
|
682
|
+
text: option.text,
|
|
683
|
+
label: itemLabel,
|
|
684
|
+
type: Close,
|
|
685
|
+
closeCurrentLabel: option.closeCurrentLabel,
|
|
686
|
+
props: {}
|
|
687
|
+
});
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
let label = getLabelById(option.label);
|
|
691
|
+
if (label) {
|
|
692
|
+
let itemLabel = new Label(label.id, label.steps, label.onStepRun, index);
|
|
693
|
+
options.push(__spreadProps(__spreadValues({}, option), {
|
|
694
|
+
label: itemLabel
|
|
695
|
+
}));
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
return options;
|
|
699
|
+
}
|
|
700
|
+
return void 0;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
// src/functions/TickerUtility.ts
|
|
704
|
+
function updateTickerProgression(args, propertyName, progression) {
|
|
705
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === progression.limit) {
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
if (typeof args[propertyName] === "number") {
|
|
709
|
+
if (progression.type === "linear") {
|
|
710
|
+
args[propertyName] = getLinearProgression(args[propertyName], progression);
|
|
711
|
+
} else if (progression.type === "exponential") {
|
|
712
|
+
args[propertyName] = getExponentialProgression(args[propertyName], progression);
|
|
713
|
+
}
|
|
714
|
+
} else if (args[propertyName] !== void 0 && typeof args[propertyName] === "object" && args[propertyName].haveOwnProperty("x") && args[propertyName].haveOwnProperty("y") && typeof args[propertyName].x === "number" && typeof args[propertyName].y === "number") {
|
|
715
|
+
if (progression.type === "linear") {
|
|
716
|
+
args[propertyName].x = getLinearProgression(args[propertyName].x, progression);
|
|
717
|
+
args[propertyName].y = getLinearProgression(args[propertyName].y, progression);
|
|
718
|
+
} else if (progression.type === "exponential") {
|
|
719
|
+
args[propertyName].x = getExponentialProgression(args[propertyName].x, progression);
|
|
720
|
+
args[propertyName].y = getExponentialProgression(args[propertyName].y, progression);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
function getLinearProgression(number, progression) {
|
|
725
|
+
if (progression.limit !== void 0) {
|
|
726
|
+
if (number > progression.limit && progression.amt > 0) {
|
|
727
|
+
return progression.limit;
|
|
728
|
+
} else if (number < progression.limit && progression.amt < 0) {
|
|
729
|
+
return progression.limit;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
return number + progression.amt / 60;
|
|
733
|
+
}
|
|
734
|
+
function getExponentialProgression(number, progression) {
|
|
735
|
+
if (progression.limit !== void 0) {
|
|
736
|
+
if (number > progression.limit && progression.percentage > 0) {
|
|
737
|
+
return progression.limit;
|
|
738
|
+
} else if (number < progression.limit && progression.percentage < 0) {
|
|
739
|
+
return progression.limit;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
return number + number * progression.percentage;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// src/classes/ticker/TickerBase.ts
|
|
746
|
+
var TickerBase = class {
|
|
747
|
+
/**
|
|
748
|
+
* @param args The arguments that you want to pass to the ticker.
|
|
749
|
+
* @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
|
|
750
|
+
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
751
|
+
*/
|
|
752
|
+
constructor(args, duration, priority) {
|
|
753
|
+
/**
|
|
754
|
+
* Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}
|
|
755
|
+
*/
|
|
756
|
+
this.id = "ticker_id_not_set";
|
|
757
|
+
this.args = args;
|
|
758
|
+
this.duration = duration;
|
|
759
|
+
this.priority = priority;
|
|
760
|
+
this.id = this.constructor.prototype.id;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* The method that will be called every frame.
|
|
764
|
+
* This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
|
|
765
|
+
* @param _ticker The ticker that is calling this method
|
|
766
|
+
* @param _args The arguments that you passed when you added the ticker
|
|
767
|
+
* @param _tags The tags of the canvas elements that are connected to this ticker
|
|
768
|
+
* @param _tickerId The id of the ticker. You can use this to get the ticker from the {@link GameWindowManager.currentTickers}
|
|
769
|
+
*/
|
|
770
|
+
fn(_ticker, _args, _tags, _tickerId) {
|
|
771
|
+
throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
// src/classes/ticker/ZoomTicker.ts
|
|
776
|
+
var ZoomTicker = class extends TickerBase {
|
|
777
|
+
fn(ticker, args, tags, tickerId) {
|
|
778
|
+
let xSpeed = 0.1;
|
|
779
|
+
let ySpeed = 0.1;
|
|
780
|
+
if (args.speed) {
|
|
781
|
+
if (typeof args.speed === "number") {
|
|
782
|
+
xSpeed = args.speed;
|
|
783
|
+
ySpeed = args.speed;
|
|
616
784
|
} else {
|
|
617
|
-
|
|
785
|
+
xSpeed = args.speed.x;
|
|
786
|
+
ySpeed = args.speed.y;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
xSpeed /= 60;
|
|
790
|
+
ySpeed /= 60;
|
|
791
|
+
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
792
|
+
if (typeof tagToRemoveAfter2 === "string") {
|
|
793
|
+
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
794
|
+
}
|
|
795
|
+
let type = args.type || "zoom";
|
|
796
|
+
let xLimit = type === "zoom" ? Infinity : 0;
|
|
797
|
+
let yLimit = type === "zoom" ? Infinity : 0;
|
|
798
|
+
if (args.limit) {
|
|
799
|
+
if (typeof args.limit === "number") {
|
|
800
|
+
xLimit = args.limit;
|
|
801
|
+
yLimit = args.limit;
|
|
802
|
+
} else {
|
|
803
|
+
xLimit = args.limit.x;
|
|
804
|
+
yLimit = args.limit.y;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
tags.filter((tag) => {
|
|
808
|
+
var _a;
|
|
809
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
810
|
+
if (args.startOnlyIfHaveTexture) {
|
|
811
|
+
if (element && element instanceof pixi_js.Sprite && ((_a = element.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
812
|
+
return false;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
return true;
|
|
816
|
+
}).forEach((tag) => {
|
|
817
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
818
|
+
if (element && element instanceof pixi_js.Container) {
|
|
819
|
+
if (type === "zoom" && (element.scale.x < xLimit || element.scale.y < yLimit)) {
|
|
820
|
+
element.scale.x += xSpeed * ticker.deltaTime;
|
|
821
|
+
element.scale.y += ySpeed * ticker.deltaTime;
|
|
822
|
+
} else if (type === "unzoom" && (element.scale.x > xLimit || element.scale.y > yLimit)) {
|
|
823
|
+
element.scale.x -= xSpeed * ticker.deltaTime;
|
|
824
|
+
element.scale.y -= ySpeed * ticker.deltaTime;
|
|
825
|
+
}
|
|
826
|
+
if (type === "zoom") {
|
|
827
|
+
if (element.scale.x > xLimit) {
|
|
828
|
+
element.scale.x = xLimit;
|
|
829
|
+
}
|
|
830
|
+
if (element.scale.y > yLimit) {
|
|
831
|
+
element.scale.y = yLimit;
|
|
832
|
+
}
|
|
833
|
+
if (element.scale.x >= xLimit && element.scale.y >= yLimit) {
|
|
834
|
+
element.scale.x = xLimit;
|
|
835
|
+
element.scale.y = yLimit;
|
|
836
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
837
|
+
}
|
|
838
|
+
} else if (type === "unzoom") {
|
|
839
|
+
if (element.scale.x < xLimit) {
|
|
840
|
+
element.scale.x = xLimit;
|
|
841
|
+
}
|
|
842
|
+
if (element.scale.y < yLimit) {
|
|
843
|
+
element.scale.y = yLimit;
|
|
844
|
+
}
|
|
845
|
+
if (element.scale.x <= xLimit && element.scale.y <= yLimit) {
|
|
846
|
+
element.scale.x = xLimit;
|
|
847
|
+
element.scale.y = yLimit;
|
|
848
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
if (xSpeed < 1e-5 && ySpeed < 1e-5 && !(args.speedProgression && args.speedProgression.type == "linear" && args.speedProgression.amt != 0)) {
|
|
852
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
853
|
+
}
|
|
618
854
|
}
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
dialogue = props;
|
|
855
|
+
});
|
|
856
|
+
if (args.speedProgression)
|
|
857
|
+
updateTickerProgression(args, "speed", args.speedProgression);
|
|
623
858
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
859
|
+
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
860
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
ZoomTicker = __decorateClass([
|
|
864
|
+
tickerDecorator()
|
|
865
|
+
], ZoomTicker);
|
|
630
866
|
|
|
631
867
|
// src/constants.ts
|
|
632
868
|
var Repeat = "repeat";
|
|
633
|
-
function Pause(duration) {
|
|
634
|
-
return {
|
|
635
|
-
type: "pause",
|
|
636
|
-
duration
|
|
637
|
-
};
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
// src/functions/ImageUtility.ts
|
|
641
|
-
function removeCanvasElement(tag) {
|
|
642
|
-
GameWindowManager.removeCanvasElement(tag);
|
|
643
|
-
}
|
|
644
869
|
|
|
645
870
|
// src/functions/ExportUtility.ts
|
|
646
871
|
function createExportableElement(element) {
|
|
@@ -779,31 +1004,6 @@ var _GameStorageManager = class _GameStorageManager {
|
|
|
779
1004
|
_GameStorageManager.storage = {};
|
|
780
1005
|
var GameStorageManager = _GameStorageManager;
|
|
781
1006
|
|
|
782
|
-
// src/classes/ticker/TickerBase.ts
|
|
783
|
-
var TickerBase = class {
|
|
784
|
-
/**
|
|
785
|
-
* @param args The arguments that you want to pass to the ticker.
|
|
786
|
-
* @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
|
|
787
|
-
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
788
|
-
*/
|
|
789
|
-
constructor(args, duration, priority) {
|
|
790
|
-
this.args = args;
|
|
791
|
-
this.duration = duration;
|
|
792
|
-
this.priority = priority;
|
|
793
|
-
}
|
|
794
|
-
/**
|
|
795
|
-
* The method that will be called every frame.
|
|
796
|
-
* This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
|
|
797
|
-
* @param _ticker The ticker that is calling this method
|
|
798
|
-
* @param _args The arguments that you passed when you added the ticker
|
|
799
|
-
* @param _tags The tags of the canvas elements that are connected to this ticker
|
|
800
|
-
* @param _tickerId The id of the ticker. You can use this to get the ticker from the {@link GameWindowManager.currentTickers}
|
|
801
|
-
*/
|
|
802
|
-
fn(_ticker, _args, _tags, _tickerId) {
|
|
803
|
-
throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
|
|
804
|
-
}
|
|
805
|
-
};
|
|
806
|
-
|
|
807
1007
|
// src/decorators/TickerDecorator.ts
|
|
808
1008
|
var registeredTickers = {};
|
|
809
1009
|
function tickerDecorator(name) {
|
|
@@ -814,19 +1014,20 @@ function tickerDecorator(name) {
|
|
|
814
1014
|
if (registeredTickers[name]) {
|
|
815
1015
|
console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`);
|
|
816
1016
|
}
|
|
1017
|
+
target.prototype.id = name;
|
|
817
1018
|
registeredTickers[name] = target;
|
|
818
1019
|
};
|
|
819
1020
|
}
|
|
820
|
-
function
|
|
1021
|
+
function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
821
1022
|
try {
|
|
822
|
-
let ticker = registeredTickers[
|
|
1023
|
+
let ticker = registeredTickers[tickerId];
|
|
823
1024
|
if (!ticker) {
|
|
824
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
1025
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
825
1026
|
return;
|
|
826
1027
|
}
|
|
827
1028
|
return new ticker(args, duration, priority);
|
|
828
1029
|
} catch (e) {
|
|
829
|
-
console.error(`[Pixi'VN] Error while getting Ticker ${
|
|
1030
|
+
console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e);
|
|
830
1031
|
return;
|
|
831
1032
|
}
|
|
832
1033
|
}
|
|
@@ -898,7 +1099,7 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
898
1099
|
height
|
|
899
1100
|
}, options)).then(() => {
|
|
900
1101
|
_GameWindowManager._isInitialized = true;
|
|
901
|
-
this.
|
|
1102
|
+
this.addCanvasIntoHTMLElement(element);
|
|
902
1103
|
window.addEventListener("resize", _GameWindowManager.resize);
|
|
903
1104
|
_GameWindowManager.resize();
|
|
904
1105
|
asciiArtLog();
|
|
@@ -909,7 +1110,7 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
909
1110
|
* Add the canvas into a html element.
|
|
910
1111
|
* @param element it is the html element where I will put the canvas. Example: document.body
|
|
911
1112
|
*/
|
|
912
|
-
static
|
|
1113
|
+
static addCanvasIntoHTMLElement(element) {
|
|
913
1114
|
if (_GameWindowManager.isInitialized) {
|
|
914
1115
|
element.appendChild(_GameWindowManager.app.canvas);
|
|
915
1116
|
} else {
|
|
@@ -1155,18 +1356,18 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1155
1356
|
* ```
|
|
1156
1357
|
*/
|
|
1157
1358
|
static addTicker(canvasElementTag, ticker) {
|
|
1158
|
-
let
|
|
1359
|
+
let tickerId = ticker.id;
|
|
1159
1360
|
if (typeof canvasElementTag === "string") {
|
|
1160
1361
|
canvasElementTag = [canvasElementTag];
|
|
1161
1362
|
}
|
|
1162
|
-
if (!
|
|
1163
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
1363
|
+
if (!geTickerInstanceById(tickerId, ticker.args, ticker.duration, ticker.priority)) {
|
|
1364
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
1164
1365
|
return;
|
|
1165
1366
|
}
|
|
1166
1367
|
let tickerHistory = {
|
|
1167
1368
|
fn: () => {
|
|
1168
1369
|
},
|
|
1169
|
-
|
|
1370
|
+
id: tickerId,
|
|
1170
1371
|
args: createExportableElement(ticker.args),
|
|
1171
1372
|
canvasElementTags: canvasElementTag,
|
|
1172
1373
|
priority: ticker.priority,
|
|
@@ -1182,11 +1383,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1182
1383
|
_GameWindowManager.removeTicker(id);
|
|
1183
1384
|
}
|
|
1184
1385
|
}, ticker.duration * 1e3);
|
|
1185
|
-
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag,
|
|
1386
|
+
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag, tickerId, timeout.toString(), true);
|
|
1186
1387
|
}
|
|
1187
1388
|
}
|
|
1188
1389
|
static pushTicker(id, tickerData, ticker) {
|
|
1189
|
-
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags,
|
|
1390
|
+
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags, ticker);
|
|
1190
1391
|
_GameWindowManager._currentTickers[id] = tickerData;
|
|
1191
1392
|
tickerData.fn = (t) => {
|
|
1192
1393
|
let data = _GameWindowManager._currentTickers[id];
|
|
@@ -1227,9 +1428,9 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1227
1428
|
if (step.hasOwnProperty("type") && step.type === "pause") {
|
|
1228
1429
|
return step;
|
|
1229
1430
|
}
|
|
1230
|
-
let
|
|
1431
|
+
let tickerId = step.id;
|
|
1231
1432
|
return {
|
|
1232
|
-
ticker:
|
|
1433
|
+
ticker: tickerId,
|
|
1233
1434
|
args: createExportableElement(step.args),
|
|
1234
1435
|
duration: step.duration
|
|
1235
1436
|
};
|
|
@@ -1267,16 +1468,16 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1267
1468
|
_GameWindowManager.addTickerTimeoutInfo(tag, "steps", timeout.toString(), false);
|
|
1268
1469
|
return;
|
|
1269
1470
|
}
|
|
1270
|
-
let ticker =
|
|
1471
|
+
let ticker = geTickerInstanceById(step.ticker, step.args, step.duration, step.priority);
|
|
1271
1472
|
if (!ticker) {
|
|
1272
1473
|
console.error(`[Pixi'VN] Ticker ${step.ticker} not found`);
|
|
1273
1474
|
return;
|
|
1274
1475
|
}
|
|
1275
|
-
let tickerName = ticker.
|
|
1476
|
+
let tickerName = ticker.id;
|
|
1276
1477
|
let tickerHistory = {
|
|
1277
1478
|
fn: () => {
|
|
1278
1479
|
},
|
|
1279
|
-
|
|
1480
|
+
id: tickerName,
|
|
1280
1481
|
args: createExportableElement(ticker.args),
|
|
1281
1482
|
canvasElementTags: [tag],
|
|
1282
1483
|
priority: ticker.priority,
|
|
@@ -1333,26 +1534,26 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1333
1534
|
* ```
|
|
1334
1535
|
*/
|
|
1335
1536
|
static removeAssociationBetweenTickerCanvasElement(tags, ticker) {
|
|
1336
|
-
let
|
|
1537
|
+
let tickerId;
|
|
1337
1538
|
if (typeof ticker === "string") {
|
|
1338
|
-
|
|
1539
|
+
tickerId = ticker;
|
|
1339
1540
|
} else if (ticker instanceof TickerBase) {
|
|
1340
|
-
|
|
1541
|
+
tickerId = ticker.id;
|
|
1341
1542
|
} else {
|
|
1342
|
-
|
|
1543
|
+
tickerId = ticker.prototype.id;
|
|
1343
1544
|
}
|
|
1344
1545
|
if (typeof tags === "string") {
|
|
1345
1546
|
tags = [tags];
|
|
1346
1547
|
}
|
|
1347
1548
|
for (let id in _GameWindowManager._currentTickers) {
|
|
1348
1549
|
let ticker2 = _GameWindowManager._currentTickers[id];
|
|
1349
|
-
if (ticker2.
|
|
1550
|
+
if (ticker2.id === tickerId) {
|
|
1350
1551
|
_GameWindowManager._currentTickers[id].canvasElementTags = ticker2.canvasElementTags.filter((e) => !tags.includes(e));
|
|
1351
1552
|
}
|
|
1352
1553
|
}
|
|
1353
1554
|
for (let timeout in _GameWindowManager._currentTickersTimeouts) {
|
|
1354
1555
|
let TickerTimeout = _GameWindowManager._currentTickersTimeouts[timeout];
|
|
1355
|
-
if (TickerTimeout.ticker ===
|
|
1556
|
+
if (TickerTimeout.ticker === tickerId && TickerTimeout.canBeDeletedBeforeEnd) {
|
|
1356
1557
|
_GameWindowManager._currentTickersTimeouts[timeout].tags = TickerTimeout.tags.filter((t) => !tags.includes(t));
|
|
1357
1558
|
}
|
|
1358
1559
|
}
|
|
@@ -1538,11 +1739,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1538
1739
|
for (let id in currentTickers) {
|
|
1539
1740
|
let t = currentTickers[id];
|
|
1540
1741
|
let tags = t.canvasElementTags;
|
|
1541
|
-
let ticker =
|
|
1742
|
+
let ticker = geTickerInstanceById(t.id, t.args, t.duration, t.priority);
|
|
1542
1743
|
if (ticker) {
|
|
1543
1744
|
_GameWindowManager.addTicker(tags, ticker);
|
|
1544
1745
|
} else {
|
|
1545
|
-
console.error(`[Pixi'VN] Ticker ${t.
|
|
1746
|
+
console.error(`[Pixi'VN] Ticker ${t.id} not found`);
|
|
1546
1747
|
}
|
|
1547
1748
|
}
|
|
1548
1749
|
}
|
|
@@ -1743,6 +1944,13 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1743
1944
|
_GameStepManager._openedLabels = _GameStepManager.originalStepData.openedLabels;
|
|
1744
1945
|
}
|
|
1745
1946
|
/* Run Methods */
|
|
1947
|
+
static get canGoNext() {
|
|
1948
|
+
let options = getChoiceMenuOptions();
|
|
1949
|
+
if (options && options.length > 0) {
|
|
1950
|
+
return false;
|
|
1951
|
+
}
|
|
1952
|
+
return true;
|
|
1953
|
+
}
|
|
1746
1954
|
/**
|
|
1747
1955
|
* Execute the next step and add it to the history.
|
|
1748
1956
|
* @param props The props to pass to the step.
|
|
@@ -1752,7 +1960,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1752
1960
|
* ```typescript
|
|
1753
1961
|
* function nextOnClick() {
|
|
1754
1962
|
* setLoading(true)
|
|
1755
|
-
* GameStepManager.
|
|
1963
|
+
* GameStepManager.goNext(yourParams)
|
|
1756
1964
|
* .then((result) => {
|
|
1757
1965
|
* setUpdate((p) => p + 1)
|
|
1758
1966
|
* setLoading(false)
|
|
@@ -1767,8 +1975,12 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1767
1975
|
* }
|
|
1768
1976
|
* ```
|
|
1769
1977
|
*/
|
|
1770
|
-
static
|
|
1978
|
+
static goNext(props, choiseMade) {
|
|
1771
1979
|
return __async(this, null, function* () {
|
|
1980
|
+
if (!_GameStepManager.canGoNext) {
|
|
1981
|
+
console.warn("[Pixi'VN] The player must make a choice");
|
|
1982
|
+
return;
|
|
1983
|
+
}
|
|
1772
1984
|
_GameStepManager.increaseCurrentStepIndex();
|
|
1773
1985
|
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
1774
1986
|
});
|
|
@@ -1799,7 +2011,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1799
2011
|
return result;
|
|
1800
2012
|
} else if (_GameStepManager.openedLabels.length > 1) {
|
|
1801
2013
|
_GameStepManager.closeCurrentLabel();
|
|
1802
|
-
return yield _GameStepManager.
|
|
2014
|
+
return yield _GameStepManager.goNext(props, choiseMade);
|
|
1803
2015
|
} else {
|
|
1804
2016
|
_GameStepManager.restorLastLabelList();
|
|
1805
2017
|
console.error("[Pixi'VN] The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/labels.html#how-manage-the-end-of-the-game");
|
|
@@ -1947,7 +2159,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1947
2159
|
if (choice.closeCurrentLabel) {
|
|
1948
2160
|
_GameStepManager.closeCurrentLabel();
|
|
1949
2161
|
}
|
|
1950
|
-
return _GameStepManager.
|
|
2162
|
+
return _GameStepManager.goNext(props, choiseMade);
|
|
1951
2163
|
});
|
|
1952
2164
|
}
|
|
1953
2165
|
/* After Update Methods */
|
|
@@ -2142,6 +2354,120 @@ _GameStepManager._openedLabels = [];
|
|
|
2142
2354
|
_GameStepManager._originalStepData = void 0;
|
|
2143
2355
|
var GameStepManager = _GameStepManager;
|
|
2144
2356
|
|
|
2357
|
+
// src/classes/StoredClassModel.ts
|
|
2358
|
+
var StoredClassModel = class {
|
|
2359
|
+
/**
|
|
2360
|
+
* @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.
|
|
2361
|
+
* @param id The id of instance of the class. This id must be unique for the category.
|
|
2362
|
+
*/
|
|
2363
|
+
constructor(categoryId, id) {
|
|
2364
|
+
this.categoryId = categoryId;
|
|
2365
|
+
this._id = id;
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* Is id of the stored class. is unique for this class.
|
|
2369
|
+
*/
|
|
2370
|
+
get id() {
|
|
2371
|
+
return this._id;
|
|
2372
|
+
}
|
|
2373
|
+
/**
|
|
2374
|
+
* Update a property in the storage.
|
|
2375
|
+
* @param propertyName The name of the property to set.
|
|
2376
|
+
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
2377
|
+
*/
|
|
2378
|
+
setStorageProperty(propertyName, value) {
|
|
2379
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
2380
|
+
if (!storage) {
|
|
2381
|
+
storage = {};
|
|
2382
|
+
}
|
|
2383
|
+
if (!storage.hasOwnProperty(this.id)) {
|
|
2384
|
+
storage[this.id] = {};
|
|
2385
|
+
}
|
|
2386
|
+
if (value === void 0 || value === null) {
|
|
2387
|
+
if (storage[this.id].hasOwnProperty(propertyName)) {
|
|
2388
|
+
delete storage[this.id][propertyName];
|
|
2389
|
+
}
|
|
2390
|
+
} else {
|
|
2391
|
+
storage[this.id] = __spreadProps(__spreadValues({}, storage[this.id]), { [propertyName]: value });
|
|
2392
|
+
}
|
|
2393
|
+
if (Object.keys(storage[this.id]).length === 0) {
|
|
2394
|
+
delete storage[this.id];
|
|
2395
|
+
}
|
|
2396
|
+
GameStorageManager.setVariable(this.categoryId, storage);
|
|
2397
|
+
}
|
|
2398
|
+
/**
|
|
2399
|
+
* Get a property from the storage.
|
|
2400
|
+
* @param propertyName The name of the property to get.
|
|
2401
|
+
* @returns The value of the property. If the property is not found, returns undefined.
|
|
2402
|
+
*/
|
|
2403
|
+
getStorageProperty(propertyName) {
|
|
2404
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
2405
|
+
if (storage && storage.hasOwnProperty(this.id) && storage[this.id].hasOwnProperty(propertyName)) {
|
|
2406
|
+
return storage[this.id][propertyName];
|
|
2407
|
+
}
|
|
2408
|
+
return void 0;
|
|
2409
|
+
}
|
|
2410
|
+
};
|
|
2411
|
+
|
|
2412
|
+
// src/classes/CharacterBaseModel.ts
|
|
2413
|
+
var CharacterBaseModel2 = class extends StoredClassModel {
|
|
2414
|
+
/**
|
|
2415
|
+
* @param id The id of the character.
|
|
2416
|
+
* @param props The properties of the character.
|
|
2417
|
+
*/
|
|
2418
|
+
constructor(id, props) {
|
|
2419
|
+
super(GameStorageManager.keysSystem.CHARACTER_CATEGORY_KEY, id);
|
|
2420
|
+
this.defaultName = "";
|
|
2421
|
+
this.defaultName = props.name;
|
|
2422
|
+
this.defaultSurname = props.surname;
|
|
2423
|
+
this.defaultAge = props.age;
|
|
2424
|
+
this._icon = props.icon;
|
|
2425
|
+
this._color = props.color;
|
|
2426
|
+
}
|
|
2427
|
+
/***
|
|
2428
|
+
* The name of the character.
|
|
2429
|
+
* If you set undefined, it will return the default name.
|
|
2430
|
+
*/
|
|
2431
|
+
get name() {
|
|
2432
|
+
return this.getStorageProperty("name") || this.defaultName;
|
|
2433
|
+
}
|
|
2434
|
+
set name(value) {
|
|
2435
|
+
this.setStorageProperty("name", value);
|
|
2436
|
+
}
|
|
2437
|
+
/**
|
|
2438
|
+
* The surname of the character.
|
|
2439
|
+
* If you set undefined, it will return the default surname.
|
|
2440
|
+
*/
|
|
2441
|
+
get surname() {
|
|
2442
|
+
return this.getStorageProperty("surname") || this.defaultSurname;
|
|
2443
|
+
}
|
|
2444
|
+
set surname(value) {
|
|
2445
|
+
this.setStorageProperty("surname", value);
|
|
2446
|
+
}
|
|
2447
|
+
/**
|
|
2448
|
+
* The age of the character.
|
|
2449
|
+
* If you set undefined, it will return the default age.
|
|
2450
|
+
*/
|
|
2451
|
+
get age() {
|
|
2452
|
+
return this.getStorageProperty("age") || this.defaultAge;
|
|
2453
|
+
}
|
|
2454
|
+
set age(value) {
|
|
2455
|
+
this.setStorageProperty("age", value);
|
|
2456
|
+
}
|
|
2457
|
+
/**
|
|
2458
|
+
* The icon of the character.
|
|
2459
|
+
*/
|
|
2460
|
+
get icon() {
|
|
2461
|
+
return this._icon;
|
|
2462
|
+
}
|
|
2463
|
+
/**
|
|
2464
|
+
* The color of the character.
|
|
2465
|
+
*/
|
|
2466
|
+
get color() {
|
|
2467
|
+
return this._color;
|
|
2468
|
+
}
|
|
2469
|
+
};
|
|
2470
|
+
|
|
2145
2471
|
// src/classes/DialogueBaseModel.ts
|
|
2146
2472
|
var DialogueBaseModel = class {
|
|
2147
2473
|
/**
|
|
@@ -2161,15 +2487,15 @@ var DialogueBaseModel = class {
|
|
|
2161
2487
|
if (typeof text === "string") {
|
|
2162
2488
|
this.text = text;
|
|
2163
2489
|
if (typeof character === "string") {
|
|
2164
|
-
this.
|
|
2490
|
+
this.character = character;
|
|
2165
2491
|
} else {
|
|
2166
|
-
this.
|
|
2492
|
+
this.character = character == null ? void 0 : character.id;
|
|
2167
2493
|
}
|
|
2168
2494
|
this.oltherParams = oltherParams;
|
|
2169
2495
|
} else {
|
|
2170
2496
|
this.text = text.text;
|
|
2171
|
-
if (text.
|
|
2172
|
-
this.
|
|
2497
|
+
if (text.character) {
|
|
2498
|
+
this.character = text.character;
|
|
2173
2499
|
}
|
|
2174
2500
|
this.oltherParams = text.oltherParams || {};
|
|
2175
2501
|
}
|
|
@@ -2182,7 +2508,7 @@ var DialogueBaseModel = class {
|
|
|
2182
2508
|
export() {
|
|
2183
2509
|
return {
|
|
2184
2510
|
text: this.text,
|
|
2185
|
-
|
|
2511
|
+
character: this.character,
|
|
2186
2512
|
oltherParams: this.oltherParams
|
|
2187
2513
|
};
|
|
2188
2514
|
}
|
|
@@ -2255,50 +2581,6 @@ var FadeAlphaTicker = class extends TickerBase {
|
|
|
2255
2581
|
FadeAlphaTicker = __decorateClass([
|
|
2256
2582
|
tickerDecorator()
|
|
2257
2583
|
], FadeAlphaTicker);
|
|
2258
|
-
|
|
2259
|
-
// src/functions/TickerUtility.ts
|
|
2260
|
-
function updateTickerProgression(args, propertyName, progression) {
|
|
2261
|
-
if (args[propertyName] === void 0 || !progression || args[propertyName] === progression.limit) {
|
|
2262
|
-
return;
|
|
2263
|
-
}
|
|
2264
|
-
if (typeof args[propertyName] === "number") {
|
|
2265
|
-
if (progression.type === "linear") {
|
|
2266
|
-
args[propertyName] = getLinearProgression(args[propertyName], progression);
|
|
2267
|
-
} else if (progression.type === "exponential") {
|
|
2268
|
-
args[propertyName] = getExponentialProgression(args[propertyName], progression);
|
|
2269
|
-
}
|
|
2270
|
-
} else if (args[propertyName] !== void 0 && typeof args[propertyName] === "object" && args[propertyName].haveOwnProperty("x") && args[propertyName].haveOwnProperty("y") && typeof args[propertyName].x === "number" && typeof args[propertyName].y === "number") {
|
|
2271
|
-
if (progression.type === "linear") {
|
|
2272
|
-
args[propertyName].x = getLinearProgression(args[propertyName].x, progression);
|
|
2273
|
-
args[propertyName].y = getLinearProgression(args[propertyName].y, progression);
|
|
2274
|
-
} else if (progression.type === "exponential") {
|
|
2275
|
-
args[propertyName].x = getExponentialProgression(args[propertyName].x, progression);
|
|
2276
|
-
args[propertyName].y = getExponentialProgression(args[propertyName].y, progression);
|
|
2277
|
-
}
|
|
2278
|
-
}
|
|
2279
|
-
}
|
|
2280
|
-
function getLinearProgression(number, progression) {
|
|
2281
|
-
if (progression.limit !== void 0) {
|
|
2282
|
-
if (number > progression.limit && progression.amt > 0) {
|
|
2283
|
-
return progression.limit;
|
|
2284
|
-
} else if (number < progression.limit && progression.amt < 0) {
|
|
2285
|
-
return progression.limit;
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
return number + progression.amt / 60;
|
|
2289
|
-
}
|
|
2290
|
-
function getExponentialProgression(number, progression) {
|
|
2291
|
-
if (progression.limit !== void 0) {
|
|
2292
|
-
if (number > progression.limit && progression.percentage > 0) {
|
|
2293
|
-
return progression.limit;
|
|
2294
|
-
} else if (number < progression.limit && progression.percentage < 0) {
|
|
2295
|
-
return progression.limit;
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
return number + number * progression.percentage;
|
|
2299
|
-
}
|
|
2300
|
-
|
|
2301
|
-
// src/classes/ticker/MoveTicker.ts
|
|
2302
2584
|
var MoveTicker = class extends TickerBase {
|
|
2303
2585
|
fn(ticker, args, tags, tickerId) {
|
|
2304
2586
|
let xSpeed = 1;
|
|
@@ -2395,211 +2677,113 @@ var RotateTicker = class extends TickerBase {
|
|
|
2395
2677
|
RotateTicker = __decorateClass([
|
|
2396
2678
|
tickerDecorator()
|
|
2397
2679
|
], RotateTicker);
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
if (element.scale.y < yLimit) {
|
|
2465
|
-
element.scale.y = yLimit;
|
|
2466
|
-
}
|
|
2467
|
-
if (element.scale.x <= xLimit && element.scale.y <= yLimit) {
|
|
2468
|
-
element.scale.x = xLimit;
|
|
2469
|
-
element.scale.y = yLimit;
|
|
2470
|
-
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
2471
|
-
}
|
|
2680
|
+
|
|
2681
|
+
// src/labels/TestConstant.ts
|
|
2682
|
+
var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
|
|
2683
|
+
name: "Juliette",
|
|
2684
|
+
age: 25,
|
|
2685
|
+
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media&token=5856ae7b-d99e-4563-86ec-cbc48cc9c6b4",
|
|
2686
|
+
color: "#ac0086"
|
|
2687
|
+
});
|
|
2688
|
+
saveCharacter(juliette);
|
|
2689
|
+
var eggHeadImage = "https://pixijs.com/assets/eggHead.png";
|
|
2690
|
+
var eggHeadName = `<span style="color:purple">Egg Head</span>`;
|
|
2691
|
+
|
|
2692
|
+
// src/labels/CustomTickerCanvasElementTestLabel.ts
|
|
2693
|
+
var AlienTintingTest = class extends CanvasSprite {
|
|
2694
|
+
constructor() {
|
|
2695
|
+
super(...arguments);
|
|
2696
|
+
this.direction = 0;
|
|
2697
|
+
this.turningSpeed = 0;
|
|
2698
|
+
this.speed = 0;
|
|
2699
|
+
}
|
|
2700
|
+
get memory() {
|
|
2701
|
+
return __spreadProps(__spreadValues({}, super.memory), {
|
|
2702
|
+
direction: this.direction,
|
|
2703
|
+
turningSpeed: this.turningSpeed,
|
|
2704
|
+
speed: this.speed
|
|
2705
|
+
});
|
|
2706
|
+
}
|
|
2707
|
+
set memory(memory) {
|
|
2708
|
+
super.memory = memory;
|
|
2709
|
+
this.direction = memory.direction;
|
|
2710
|
+
this.turningSpeed = memory.turningSpeed;
|
|
2711
|
+
this.speed = memory.speed;
|
|
2712
|
+
}
|
|
2713
|
+
static from(source, skipCache) {
|
|
2714
|
+
let sprite = pixi_js.Sprite.from(source, skipCache);
|
|
2715
|
+
let mySprite = new AlienTintingTest();
|
|
2716
|
+
mySprite.texture = sprite.texture;
|
|
2717
|
+
return mySprite;
|
|
2718
|
+
}
|
|
2719
|
+
};
|
|
2720
|
+
AlienTintingTest = __decorateClass([
|
|
2721
|
+
canvasElementDecorator("___pixi_vn_custom_canvas_element___")
|
|
2722
|
+
], AlienTintingTest);
|
|
2723
|
+
exports.TintingTestTicker = class TintingTestTicker extends TickerBase {
|
|
2724
|
+
constructor() {
|
|
2725
|
+
super({});
|
|
2726
|
+
}
|
|
2727
|
+
fn(_t, _args, tags) {
|
|
2728
|
+
tags.forEach((tag) => {
|
|
2729
|
+
const dudeBoundsPadding = 100;
|
|
2730
|
+
const dudeBounds = new pixi_js.Rectangle(
|
|
2731
|
+
-dudeBoundsPadding,
|
|
2732
|
+
-dudeBoundsPadding,
|
|
2733
|
+
GameWindowManager.screen.width + dudeBoundsPadding * 2,
|
|
2734
|
+
GameWindowManager.screen.height + dudeBoundsPadding * 2
|
|
2735
|
+
);
|
|
2736
|
+
let dude = GameWindowManager.getCanvasElement(tag);
|
|
2737
|
+
if (dude && dude instanceof AlienTintingTest) {
|
|
2738
|
+
dude.direction += dude.turningSpeed * 0.01;
|
|
2739
|
+
dude.x += Math.sin(dude.direction) * dude.speed;
|
|
2740
|
+
dude.y += Math.cos(dude.direction) * dude.speed;
|
|
2741
|
+
dude.rotation = -dude.direction - Math.PI / 2;
|
|
2742
|
+
if (dude.x < dudeBounds.x) {
|
|
2743
|
+
dude.x += dudeBounds.width;
|
|
2744
|
+
} else if (dude.x > dudeBounds.x + dudeBounds.width) {
|
|
2745
|
+
dude.x -= dudeBounds.width;
|
|
2472
2746
|
}
|
|
2473
|
-
if (
|
|
2474
|
-
|
|
2747
|
+
if (dude.y < dudeBounds.y) {
|
|
2748
|
+
dude.y += dudeBounds.height;
|
|
2749
|
+
} else if (dude.y > dudeBounds.y + dudeBounds.height) {
|
|
2750
|
+
dude.y -= dudeBounds.height;
|
|
2475
2751
|
}
|
|
2476
2752
|
}
|
|
2477
2753
|
});
|
|
2478
|
-
if (args.speedProgression)
|
|
2479
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
2480
2754
|
}
|
|
2481
2755
|
};
|
|
2482
|
-
|
|
2483
|
-
tickerDecorator()
|
|
2484
|
-
],
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
var alien2Tag = "alien2";
|
|
2489
|
-
var alien3Tag = "alien3";
|
|
2490
|
-
var alien4Tag = "alien4";
|
|
2491
|
-
var tickerTestLabel = newLabel(
|
|
2492
|
-
"TickerTestLabel",
|
|
2756
|
+
exports.TintingTestTicker = __decorateClass([
|
|
2757
|
+
tickerDecorator("___pixi_vn_custom_ticker___")
|
|
2758
|
+
], exports.TintingTestTicker);
|
|
2759
|
+
var CUSTOM_TICKER_CANVAS_ELEMENT_TEST_LABEL = "___pixi_vn_custom_ticker_canvas_element_test___";
|
|
2760
|
+
var customTickerCanvasElementTestLabel = newLabel(
|
|
2761
|
+
CUSTOM_TICKER_CANVAS_ELEMENT_TEST_LABEL,
|
|
2493
2762
|
[
|
|
2494
2763
|
() => __async(void 0, null, function* () {
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
setDialogue(`I have added a image with a tag ${alien2Tag} and I connected a RotateTicker with a speed of ${my_speed} to it.`);
|
|
2515
|
-
}),
|
|
2516
|
-
() => setDialogue(`Since ${alien1Tag} and ${alien2Tag} they have the same ticker with the same speed, only one RotateTicker will be performed`),
|
|
2517
|
-
() => {
|
|
2518
|
-
GameWindowManager.addTicker(alien1Tag, new RotateTicker({ speed: 0.2 }));
|
|
2519
|
-
setDialogue(`I have changed the speed of the RotateTicker connected to ${alien1Tag} to 0.2`);
|
|
2520
|
-
},
|
|
2521
|
-
() => setDialogue(`Since ${alien1Tag} have a different speed, it will perform a different RotateTicker`),
|
|
2522
|
-
() => {
|
|
2523
|
-
removeCanvasElement(alien1Tag);
|
|
2524
|
-
setDialogue(`I have remove the image with the tag ${alien1Tag}`);
|
|
2525
|
-
},
|
|
2526
|
-
() => setDialogue(`Since ${alien1Tag} is removed, the RotateTicker connected to it will not be performed`),
|
|
2527
|
-
() => {
|
|
2528
|
-
GameWindowManager.removeAssociationBetweenTickerCanvasElement(alien2Tag, RotateTicker);
|
|
2529
|
-
setDialogue(`I have removed the RotateTicker connected to ${alien2Tag}`);
|
|
2530
|
-
},
|
|
2531
|
-
() => __async(void 0, null, function* () {
|
|
2532
|
-
removeCanvasElement(alien2Tag);
|
|
2533
|
-
let duration = 7e3;
|
|
2534
|
-
const texture = yield pixi_js.Assets.load("https://pixijs.com/assets/eggHead.png");
|
|
2535
|
-
const alien = CanvasSprite.from(texture);
|
|
2536
|
-
alien.anchor.set(0.5);
|
|
2537
|
-
GameWindowManager.addCanvasElement(alien3Tag, alien);
|
|
2538
|
-
alien.x = 500;
|
|
2539
|
-
alien.y = 100;
|
|
2540
|
-
GameWindowManager.addTicker(alien3Tag, new RotateTicker({ speed: 0.1 }, duration));
|
|
2541
|
-
setDialogue(`I have added a image with a tag ${alien3Tag} and I connected a RotateTicker with a speed of 0.1 and a duration of ${duration} to it. After ${duration}ms, the RotateTicker will be removed.`);
|
|
2542
|
-
}),
|
|
2543
|
-
() => __async(void 0, null, function* () {
|
|
2544
|
-
let my_speed = 0.1;
|
|
2545
|
-
let my_speed2 = 0.3;
|
|
2546
|
-
const texture = yield pixi_js.Assets.load("https://pixijs.com/assets/eggHead.png");
|
|
2547
|
-
const alien = CanvasSprite.from(texture);
|
|
2548
|
-
alien.anchor.set(0.5);
|
|
2549
|
-
GameWindowManager.addCanvasElement(alien1Tag, alien);
|
|
2550
|
-
alien.x = 100;
|
|
2551
|
-
alien.y = 100;
|
|
2552
|
-
GameWindowManager.addTickersSteps(alien1Tag, [
|
|
2553
|
-
new RotateTicker({ speed: my_speed }, 1e3),
|
|
2554
|
-
new RotateTicker({ speed: my_speed2 }, 1e3)
|
|
2555
|
-
]);
|
|
2556
|
-
setDialogue(`I have added a image with a tag ${alien1Tag} and I connected a RotateTicker with a speed of ${my_speed} and a duration of 1000ms and then I connected a RotateTicker with a speed of ${my_speed2} and a duration of 1000ms to it.`);
|
|
2557
|
-
}),
|
|
2558
|
-
() => __async(void 0, null, function* () {
|
|
2559
|
-
const texture = yield pixi_js.Assets.load("https://pixijs.com/assets/eggHead.png");
|
|
2560
|
-
const alien = CanvasSprite.from(texture);
|
|
2561
|
-
alien.anchor.set(0.5);
|
|
2562
|
-
GameWindowManager.addCanvasElement(alien2Tag, alien);
|
|
2563
|
-
alien.x = 300;
|
|
2564
|
-
alien.y = 100;
|
|
2565
|
-
GameWindowManager.addTickersSteps(alien2Tag, [
|
|
2566
|
-
new RotateTicker({ speed: 0.1, clockwise: true }, 2e3),
|
|
2567
|
-
Pause(500),
|
|
2568
|
-
new RotateTicker({ speed: 0.2, clockwise: false }, 2e3),
|
|
2569
|
-
Repeat
|
|
2570
|
-
]);
|
|
2571
|
-
setDialogue(`I have added a image with a tag ${alien2Tag} and I connected a RotateTicker with a speed of 0.1 and a duration of 2000ms and then I connected a RotateTicker with a speed of 0.2 and a duration of 2000ms to it. After 500ms, the RotateTicker will be repeated.`);
|
|
2572
|
-
}),
|
|
2573
|
-
() => __async(void 0, null, function* () {
|
|
2574
|
-
const texture = yield pixi_js.Assets.load("https://pixijs.com/assets/eggHead.png");
|
|
2575
|
-
const alien = CanvasSprite.from(texture);
|
|
2576
|
-
alien.anchor.set(0.5);
|
|
2577
|
-
GameWindowManager.addCanvasElement(alien4Tag, alien);
|
|
2578
|
-
alien.x = 700;
|
|
2579
|
-
alien.y = 100;
|
|
2580
|
-
let speed = 0;
|
|
2581
|
-
let speedLimit = 0.5;
|
|
2582
|
-
let amt = 1e-3;
|
|
2583
|
-
GameWindowManager.addTicker(alien4Tag, new RotateTicker({ speed, speedProgression: { type: "linear", amt, limit: speedLimit } }));
|
|
2584
|
-
GameWindowManager.addTickersSteps(
|
|
2585
|
-
alien2Tag,
|
|
2586
|
-
[
|
|
2587
|
-
new FadeAlphaTicker({
|
|
2588
|
-
duration: 1,
|
|
2589
|
-
type: "hide"
|
|
2590
|
-
}, 3e3),
|
|
2591
|
-
new FadeAlphaTicker({
|
|
2592
|
-
duration: 1,
|
|
2593
|
-
type: "show"
|
|
2594
|
-
}, 3e3),
|
|
2595
|
-
Repeat
|
|
2596
|
-
]
|
|
2597
|
-
);
|
|
2598
|
-
setDialogue(`I have added a image with a tag ${alien4Tag} and I connected a RotateTicker with a speed of ${speed} and a linear speed progression of ${amt} and a limit of ${speedLimit} to it.`);
|
|
2764
|
+
const totalDudes = 100;
|
|
2765
|
+
for (let i = 0; i < totalDudes; i++) {
|
|
2766
|
+
const texture = yield pixi_js.Assets.load(eggHeadImage);
|
|
2767
|
+
const dude = AlienTintingTest.from(texture);
|
|
2768
|
+
dude.anchor.set(0.5);
|
|
2769
|
+
dude.scale.set(0.8 + Math.random() * 0.3);
|
|
2770
|
+
dude.x = Math.random() * GameWindowManager.screen.width;
|
|
2771
|
+
dude.y = Math.random() * GameWindowManager.screen.height;
|
|
2772
|
+
dude.tint = Math.random() * 16777215;
|
|
2773
|
+
dude.direction = Math.random() * Math.PI * 2;
|
|
2774
|
+
dude.turningSpeed = Math.random() - 0.8;
|
|
2775
|
+
dude.speed = 2 + Math.random() * 2;
|
|
2776
|
+
GameWindowManager.addCanvasElement("alien" + i, dude);
|
|
2777
|
+
GameWindowManager.addTicker("alien" + i, new exports.TintingTestTicker());
|
|
2778
|
+
}
|
|
2779
|
+
setDialogue({
|
|
2780
|
+
character: juliette,
|
|
2781
|
+
text: `This is a test of custom ticker and canvas element. In this test, we have created ${totalDudes} ${eggHeadName} with random tint, scale, position, direction, turning speed, and speed. With the custom ticker, we are moving the custom canvas element in a random direction. (This example is from the official [PixiJS website](https://pixijs.com/8.x/examples/events/interactivity).)`
|
|
2782
|
+
});
|
|
2599
2783
|
})
|
|
2600
2784
|
]
|
|
2601
2785
|
);
|
|
2602
2786
|
|
|
2603
|
-
exports.
|
|
2604
|
-
//# sourceMappingURL=
|
|
2605
|
-
//# sourceMappingURL=
|
|
2787
|
+
exports.customTickerCanvasElementTestLabel = customTickerCanvasElementTestLabel;
|
|
2788
|
+
//# sourceMappingURL=CustomTickerCanvasElementTestLabel.js.map
|
|
2789
|
+
//# sourceMappingURL=CustomTickerCanvasElementTestLabel.js.map
|