@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Sprite, Container,
|
|
1
|
+
import { Rectangle, Sprite, Container, Application, Assets, Texture, Text } from 'pixi.js';
|
|
2
2
|
import { diff } from 'deep-diff';
|
|
3
3
|
import sha1 from 'crypto-js/sha1';
|
|
4
4
|
|
|
@@ -50,138 +50,6 @@ var __async = (__this, __arguments, generator) => {
|
|
|
50
50
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
// src/decorators/CanvasElementDecorator.ts
|
|
55
|
-
var registeredCanvasElement = {};
|
|
56
|
-
function getCanvasElementInstanceByClassName(canvasName) {
|
|
57
|
-
try {
|
|
58
|
-
let eventType = registeredCanvasElement[canvasName];
|
|
59
|
-
if (!eventType) {
|
|
60
|
-
if (canvasName === "CanvasContainer") {
|
|
61
|
-
eventType = CanvasContainer;
|
|
62
|
-
} else if (canvasName === "CanvasImage") {
|
|
63
|
-
eventType = CanvasImage;
|
|
64
|
-
} else if (canvasName === "CanvasSprite") {
|
|
65
|
-
eventType = CanvasSprite;
|
|
66
|
-
} else if (canvasName === "CanvasText") {
|
|
67
|
-
eventType = CanvasText;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (!eventType) {
|
|
71
|
-
console.error(`[Pixi'VN] CanvasElement ${canvasName} not found`);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
let canvasElement = new eventType();
|
|
75
|
-
return canvasElement;
|
|
76
|
-
} catch (e) {
|
|
77
|
-
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasName}`, e);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// src/functions/CanvasUtility.ts
|
|
83
|
-
function getTextureMemory(texture) {
|
|
84
|
-
let sourceTexture = texture.source;
|
|
85
|
-
let textureMemory = {
|
|
86
|
-
image: sourceTexture.label
|
|
87
|
-
};
|
|
88
|
-
return textureMemory;
|
|
89
|
-
}
|
|
90
|
-
function exportCanvasElement(element) {
|
|
91
|
-
return element.memory;
|
|
92
|
-
}
|
|
93
|
-
function importCanvasElement(memory) {
|
|
94
|
-
let element = getCanvasElementInstanceByClassName(memory.className);
|
|
95
|
-
if (element) {
|
|
96
|
-
element.memory = memory;
|
|
97
|
-
} else {
|
|
98
|
-
throw new Error("[Pixi'VN] The element " + memory.className + " could not be created");
|
|
99
|
-
}
|
|
100
|
-
return element;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// src/classes/canvas/CanvasContainer.ts
|
|
104
|
-
var CanvasContainer = class extends Container {
|
|
105
|
-
get memory() {
|
|
106
|
-
let memory = getMemoryContainer(this);
|
|
107
|
-
this.children.forEach((child) => {
|
|
108
|
-
memory.elements.push(exportCanvasElement(child));
|
|
109
|
-
});
|
|
110
|
-
return memory;
|
|
111
|
-
}
|
|
112
|
-
set memory(value) {
|
|
113
|
-
setMemoryContainer(this, value);
|
|
114
|
-
value.elements.forEach((child) => {
|
|
115
|
-
this.addChild(importCanvasElement(child));
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
function getMemoryContainer(element) {
|
|
120
|
-
return {
|
|
121
|
-
className: "CanvasContainer",
|
|
122
|
-
elements: [],
|
|
123
|
-
width: element.width,
|
|
124
|
-
height: element.height,
|
|
125
|
-
isRenderGroup: element.isRenderGroup,
|
|
126
|
-
blendMode: element.blendMode,
|
|
127
|
-
tint: element.tint,
|
|
128
|
-
alpha: element.alpha,
|
|
129
|
-
angle: element.angle,
|
|
130
|
-
renderable: element.renderable,
|
|
131
|
-
rotation: element.rotation,
|
|
132
|
-
scale: { x: element.scale.x, y: element.scale.y },
|
|
133
|
-
pivot: { x: element.pivot.x, y: element.pivot.y },
|
|
134
|
-
position: { x: element.position.x, y: element.position.y },
|
|
135
|
-
skew: { x: element.skew.x, y: element.skew.y },
|
|
136
|
-
visible: element.visible,
|
|
137
|
-
culled: element.culled,
|
|
138
|
-
x: element.x,
|
|
139
|
-
y: element.y,
|
|
140
|
-
boundsArea: element.boundsArea,
|
|
141
|
-
cursor: element.cursor,
|
|
142
|
-
eventMode: element.eventMode,
|
|
143
|
-
interactive: element.interactive,
|
|
144
|
-
interactiveChildren: element.interactiveChildren,
|
|
145
|
-
hitArea: element.hitArea
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function setMemoryContainer(element, memory) {
|
|
149
|
-
memory.width && (element.width = memory.width);
|
|
150
|
-
memory.height && (element.height = memory.height);
|
|
151
|
-
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
152
|
-
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
153
|
-
memory.tint && (element.tint = memory.tint);
|
|
154
|
-
memory.alpha && (element.alpha = memory.alpha);
|
|
155
|
-
memory.angle && (element.angle = memory.angle);
|
|
156
|
-
memory.renderable && (element.renderable = memory.renderable);
|
|
157
|
-
memory.rotation && (element.rotation = memory.rotation);
|
|
158
|
-
if (memory.scale) {
|
|
159
|
-
if (typeof memory.scale === "number") {
|
|
160
|
-
element.scale.set(memory.scale, memory.scale);
|
|
161
|
-
} else {
|
|
162
|
-
element.scale.set(memory.scale.x, memory.scale.y);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
if (memory.pivot) {
|
|
166
|
-
if (typeof memory.pivot === "number") {
|
|
167
|
-
element.pivot.set(memory.pivot, memory.pivot);
|
|
168
|
-
} else {
|
|
169
|
-
element.pivot.set(memory.pivot.x, memory.pivot.y);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
memory.position && element.position.set(memory.position.x, memory.position.y);
|
|
173
|
-
memory.skew && element.skew.set(memory.skew.x, memory.skew.y);
|
|
174
|
-
memory.visible && (element.visible = memory.visible);
|
|
175
|
-
memory.culled && (element.culled = memory.culled);
|
|
176
|
-
memory.x && (element.x = memory.x);
|
|
177
|
-
memory.y && (element.y = memory.y);
|
|
178
|
-
memory.boundsArea && (element.boundsArea = memory.boundsArea);
|
|
179
|
-
memory.cursor && (element.cursor = memory.cursor);
|
|
180
|
-
memory.eventMode && (element.eventMode = memory.eventMode);
|
|
181
|
-
memory.interactive && (element.interactive = memory.interactive);
|
|
182
|
-
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
183
|
-
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
184
|
-
}
|
|
185
53
|
function getTexture(imageUrl) {
|
|
186
54
|
return __async(this, null, function* () {
|
|
187
55
|
if (Assets.cache.has(imageUrl)) {
|
|
@@ -203,17 +71,19 @@ function getTexture(imageUrl) {
|
|
|
203
71
|
});
|
|
204
72
|
});
|
|
205
73
|
}
|
|
206
|
-
function
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
console.warn("[Pixi'VN] CanvasText.style.fill is a FillGradient or FillPattern, this is not supported yet.", fill);
|
|
210
|
-
fill = "#00FF00";
|
|
74
|
+
function getFillGradientFillPattern(prop, propName) {
|
|
75
|
+
if (!(prop instanceof Object)) {
|
|
76
|
+
return prop;
|
|
211
77
|
}
|
|
78
|
+
console.warn(`[Pixi'VN] CanvasText.style.${propName} is a FillGradient or FillPattern, this is not supported yet.`, prop);
|
|
79
|
+
return void 0;
|
|
80
|
+
}
|
|
81
|
+
function getTextStyle(style) {
|
|
212
82
|
return {
|
|
213
83
|
align: style.align,
|
|
214
84
|
breakWords: style.breakWords,
|
|
215
85
|
dropShadow: style.dropShadow,
|
|
216
|
-
fill,
|
|
86
|
+
fill: getFillGradientFillPattern(style.stroke, "fill"),
|
|
217
87
|
fontFamily: style.fontFamily,
|
|
218
88
|
fontSize: style.fontSize,
|
|
219
89
|
fontStyle: style.fontStyle,
|
|
@@ -223,7 +93,7 @@ function getTextStyle(style) {
|
|
|
223
93
|
letterSpacing: style.letterSpacing,
|
|
224
94
|
lineHeight: style.lineHeight,
|
|
225
95
|
padding: style.padding,
|
|
226
|
-
stroke: style.stroke,
|
|
96
|
+
stroke: getFillGradientFillPattern(style.stroke, "stroke"),
|
|
227
97
|
textBaseline: style.textBaseline,
|
|
228
98
|
trim: style.trim,
|
|
229
99
|
whiteSpace: style.whiteSpace,
|
|
@@ -234,40 +104,43 @@ function getTextStyle(style) {
|
|
|
234
104
|
|
|
235
105
|
// src/decorators/EventDecorator.ts
|
|
236
106
|
var registeredEvents = {};
|
|
237
|
-
function
|
|
107
|
+
function getEventTypeById(eventId) {
|
|
238
108
|
try {
|
|
239
|
-
let eventType = registeredEvents[
|
|
109
|
+
let eventType = registeredEvents[eventId];
|
|
240
110
|
if (!eventType) {
|
|
241
|
-
console.error(`[Pixi'VN] Event ${
|
|
111
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
242
112
|
return;
|
|
243
113
|
}
|
|
244
114
|
new eventType();
|
|
245
115
|
return eventType;
|
|
246
116
|
} catch (e) {
|
|
247
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
117
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
248
118
|
return;
|
|
249
119
|
}
|
|
250
120
|
}
|
|
251
|
-
function
|
|
121
|
+
function getEventInstanceById(eventId) {
|
|
252
122
|
try {
|
|
253
|
-
let eventType = registeredEvents[
|
|
123
|
+
let eventType = registeredEvents[eventId];
|
|
254
124
|
if (!eventType) {
|
|
255
|
-
console.error(`[Pixi'VN] Event ${
|
|
125
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
256
126
|
return;
|
|
257
127
|
}
|
|
258
128
|
let event = new eventType();
|
|
259
129
|
return event;
|
|
260
130
|
} catch (e) {
|
|
261
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
131
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
262
132
|
return;
|
|
263
133
|
}
|
|
264
134
|
}
|
|
265
135
|
|
|
266
136
|
// src/classes/canvas/CanvasSprite.ts
|
|
137
|
+
var CANVAS_SPRITE_ID = "CanvasSprite";
|
|
267
138
|
var CanvasSprite = class _CanvasSprite extends Sprite {
|
|
268
|
-
constructor() {
|
|
269
|
-
super(
|
|
139
|
+
constructor(options) {
|
|
140
|
+
super(options);
|
|
141
|
+
this.pixivnId = CANVAS_SPRITE_ID;
|
|
270
142
|
this._onEvents = {};
|
|
143
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_SPRITE_ID;
|
|
271
144
|
}
|
|
272
145
|
get memory() {
|
|
273
146
|
return getMemorySprite(this);
|
|
@@ -308,9 +181,9 @@ var CanvasSprite = class _CanvasSprite extends Sprite {
|
|
|
308
181
|
* ```
|
|
309
182
|
*/
|
|
310
183
|
onEvent(event, eventClass) {
|
|
311
|
-
let
|
|
312
|
-
let instance =
|
|
313
|
-
this._onEvents[event] =
|
|
184
|
+
let id = eventClass.prototype.id;
|
|
185
|
+
let instance = getEventInstanceById(id);
|
|
186
|
+
this._onEvents[event] = id;
|
|
314
187
|
if (instance) {
|
|
315
188
|
super.on(event, () => {
|
|
316
189
|
instance.fn(event, this);
|
|
@@ -339,7 +212,7 @@ var CanvasSprite = class _CanvasSprite extends Sprite {
|
|
|
339
212
|
function getMemorySprite(element) {
|
|
340
213
|
let temp = getMemoryContainer(element);
|
|
341
214
|
return __spreadProps(__spreadValues({}, temp), {
|
|
342
|
-
|
|
215
|
+
pixivnId: element.pixivnId,
|
|
343
216
|
textureImage: getTextureMemory(element.texture),
|
|
344
217
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
345
218
|
roundPixels: element.roundPixels,
|
|
@@ -362,8 +235,8 @@ function setMemorySprite(element, memory) {
|
|
|
362
235
|
}
|
|
363
236
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
364
237
|
for (let event in memory.onEvents) {
|
|
365
|
-
let
|
|
366
|
-
let instance =
|
|
238
|
+
let id = memory.onEvents[event];
|
|
239
|
+
let instance = getEventTypeById(id);
|
|
367
240
|
if (instance) {
|
|
368
241
|
element.onEvent(event, instance);
|
|
369
242
|
}
|
|
@@ -371,9 +244,11 @@ function setMemorySprite(element, memory) {
|
|
|
371
244
|
}
|
|
372
245
|
|
|
373
246
|
// src/classes/canvas/CanvasImage.ts
|
|
247
|
+
var CANVAS_IMAGE_ID = "CanvasImage";
|
|
374
248
|
var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
375
249
|
constructor(options, imageLink) {
|
|
376
250
|
super(options);
|
|
251
|
+
this.pixivnId = CANVAS_IMAGE_ID;
|
|
377
252
|
this.imageLink = "";
|
|
378
253
|
if (imageLink) {
|
|
379
254
|
this.imageLink = imageLink;
|
|
@@ -381,12 +256,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
381
256
|
}
|
|
382
257
|
get memory() {
|
|
383
258
|
return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
|
|
384
|
-
|
|
385
|
-
|
|
259
|
+
pixivnId: this.pixivnId,
|
|
260
|
+
imageLink: this.imageLink
|
|
386
261
|
});
|
|
387
262
|
}
|
|
388
263
|
set memory(memory) {
|
|
389
264
|
setMemorySprite(this, memory);
|
|
265
|
+
this.imageLink = memory.imageLink;
|
|
390
266
|
}
|
|
391
267
|
static from(source, skipCache) {
|
|
392
268
|
let sprite = Sprite.from(source, skipCache);
|
|
@@ -414,10 +290,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
414
290
|
});
|
|
415
291
|
}
|
|
416
292
|
};
|
|
293
|
+
var CANVAS_TEXT_ID = "CanvasText";
|
|
417
294
|
var CanvasText = class extends Text {
|
|
418
|
-
constructor() {
|
|
419
|
-
super(
|
|
295
|
+
constructor(options) {
|
|
296
|
+
super(options);
|
|
297
|
+
this.pixivnId = CANVAS_TEXT_ID;
|
|
420
298
|
this._onEvents = {};
|
|
299
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_TEXT_ID;
|
|
421
300
|
}
|
|
422
301
|
get memory() {
|
|
423
302
|
return getMemoryText(this);
|
|
@@ -458,9 +337,9 @@ var CanvasText = class extends Text {
|
|
|
458
337
|
* ```
|
|
459
338
|
*/
|
|
460
339
|
onEvent(event, eventClass) {
|
|
461
|
-
let
|
|
462
|
-
let instance =
|
|
463
|
-
this._onEvents[event] =
|
|
340
|
+
let id = eventClass.prototype.id;
|
|
341
|
+
let instance = getEventInstanceById(id);
|
|
342
|
+
this._onEvents[event] = id;
|
|
464
343
|
if (instance) {
|
|
465
344
|
super.on(event, () => {
|
|
466
345
|
instance.fn(event, this);
|
|
@@ -483,7 +362,7 @@ var CanvasText = class extends Text {
|
|
|
483
362
|
function getMemoryText(element) {
|
|
484
363
|
let temp = getMemoryContainer(element);
|
|
485
364
|
return __spreadProps(__spreadValues({}, temp), {
|
|
486
|
-
|
|
365
|
+
pixivnId: element.pixivnId,
|
|
487
366
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
488
367
|
text: element.text,
|
|
489
368
|
resolution: element.resolution,
|
|
@@ -506,13 +385,175 @@ function setMemoryText(element, memory) {
|
|
|
506
385
|
memory.style && (element.style = memory.style);
|
|
507
386
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
508
387
|
for (let event in memory.onEvents) {
|
|
509
|
-
let
|
|
510
|
-
let instance =
|
|
388
|
+
let id = memory.onEvents[event];
|
|
389
|
+
let instance = getEventTypeById(id);
|
|
511
390
|
if (instance) {
|
|
512
391
|
element.onEvent(event, instance);
|
|
513
392
|
}
|
|
514
393
|
}
|
|
515
394
|
}
|
|
395
|
+
|
|
396
|
+
// src/decorators/CanvasElementDecorator.ts
|
|
397
|
+
var registeredCanvasElement = {};
|
|
398
|
+
function canvasElementDecorator(name) {
|
|
399
|
+
return function(target) {
|
|
400
|
+
if (registeredCanvasElement[name]) {
|
|
401
|
+
console.warn(`[Pixi'VN] CanvasElement ${name} already registered`);
|
|
402
|
+
}
|
|
403
|
+
target.prototype.pixivnId = name;
|
|
404
|
+
registeredCanvasElement[name] = target;
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function getCanvasElementInstanceById(canvasId) {
|
|
408
|
+
try {
|
|
409
|
+
let eventType = registeredCanvasElement[canvasId];
|
|
410
|
+
if (!eventType) {
|
|
411
|
+
if (canvasId === CANVAS_CONTAINER_ID) {
|
|
412
|
+
eventType = CanvasContainer;
|
|
413
|
+
} else if (canvasId === CANVAS_IMAGE_ID) {
|
|
414
|
+
eventType = CanvasImage;
|
|
415
|
+
} else if (canvasId === CANVAS_SPRITE_ID) {
|
|
416
|
+
eventType = CanvasSprite;
|
|
417
|
+
} else if (canvasId === CANVAS_TEXT_ID) {
|
|
418
|
+
eventType = CanvasText;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if (!eventType) {
|
|
422
|
+
console.error(`[Pixi'VN] CanvasElement ${canvasId} not found`);
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
let canvasElement = new eventType();
|
|
426
|
+
return canvasElement;
|
|
427
|
+
} catch (e) {
|
|
428
|
+
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasId}`, e);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// src/functions/CanvasUtility.ts
|
|
434
|
+
function getTextureMemory(texture) {
|
|
435
|
+
let sourceTexture = texture.source;
|
|
436
|
+
let textureMemory = {
|
|
437
|
+
image: sourceTexture.label
|
|
438
|
+
};
|
|
439
|
+
return textureMemory;
|
|
440
|
+
}
|
|
441
|
+
function exportCanvasElement(element) {
|
|
442
|
+
return element.memory;
|
|
443
|
+
}
|
|
444
|
+
function importCanvasElement(memory) {
|
|
445
|
+
let element = getCanvasElementInstanceById(memory.pixivnId);
|
|
446
|
+
if (element) {
|
|
447
|
+
element.memory = memory;
|
|
448
|
+
} else {
|
|
449
|
+
throw new Error("[Pixi'VN] The element " + memory.pixivnId + " could not be created");
|
|
450
|
+
}
|
|
451
|
+
return element;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// src/classes/canvas/CanvasContainer.ts
|
|
455
|
+
var CANVAS_CONTAINER_ID = "CanvasContainer";
|
|
456
|
+
var CanvasContainer = class extends Container {
|
|
457
|
+
constructor(options) {
|
|
458
|
+
super(options);
|
|
459
|
+
this.pixivnId = CANVAS_CONTAINER_ID;
|
|
460
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_CONTAINER_ID;
|
|
461
|
+
}
|
|
462
|
+
get memory() {
|
|
463
|
+
let memory = getMemoryContainer(this);
|
|
464
|
+
this.children.forEach((child) => {
|
|
465
|
+
memory.elements.push(exportCanvasElement(child));
|
|
466
|
+
});
|
|
467
|
+
return memory;
|
|
468
|
+
}
|
|
469
|
+
set memory(value) {
|
|
470
|
+
setMemoryContainer(this, value);
|
|
471
|
+
value.elements.forEach((child) => {
|
|
472
|
+
this.addChild(importCanvasElement(child));
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
function getMemoryContainer(element) {
|
|
477
|
+
let className = "CanvasContainer";
|
|
478
|
+
if (element.hasOwnProperty("pixivnId")) {
|
|
479
|
+
className = element.pixivnId;
|
|
480
|
+
}
|
|
481
|
+
return {
|
|
482
|
+
pixivnId: className,
|
|
483
|
+
elements: [],
|
|
484
|
+
width: element.width,
|
|
485
|
+
height: element.height,
|
|
486
|
+
isRenderGroup: element.isRenderGroup,
|
|
487
|
+
blendMode: element.blendMode,
|
|
488
|
+
tint: element.tint,
|
|
489
|
+
alpha: element.alpha,
|
|
490
|
+
angle: element.angle,
|
|
491
|
+
renderable: element.renderable,
|
|
492
|
+
rotation: element.rotation,
|
|
493
|
+
scale: { x: element.scale.x, y: element.scale.y },
|
|
494
|
+
pivot: { x: element.pivot.x, y: element.pivot.y },
|
|
495
|
+
position: { x: element.position.x, y: element.position.y },
|
|
496
|
+
skew: { x: element.skew.x, y: element.skew.y },
|
|
497
|
+
visible: element.visible,
|
|
498
|
+
x: element.x,
|
|
499
|
+
y: element.y,
|
|
500
|
+
boundsArea: element.boundsArea,
|
|
501
|
+
cursor: element.cursor,
|
|
502
|
+
eventMode: element.eventMode,
|
|
503
|
+
interactive: element.interactive,
|
|
504
|
+
interactiveChildren: element.interactiveChildren,
|
|
505
|
+
hitArea: element.hitArea
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
function setMemoryContainer(element, memory) {
|
|
509
|
+
memory.width && (element.width = memory.width);
|
|
510
|
+
memory.height && (element.height = memory.height);
|
|
511
|
+
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
512
|
+
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
513
|
+
memory.tint && (element.tint = memory.tint);
|
|
514
|
+
memory.alpha && (element.alpha = memory.alpha);
|
|
515
|
+
memory.angle && (element.angle = memory.angle);
|
|
516
|
+
memory.renderable && (element.renderable = memory.renderable);
|
|
517
|
+
memory.rotation && (element.rotation = memory.rotation);
|
|
518
|
+
if (memory.scale) {
|
|
519
|
+
if (typeof memory.scale === "number") {
|
|
520
|
+
element.scale.set(memory.scale, memory.scale);
|
|
521
|
+
} else {
|
|
522
|
+
element.scale.set(memory.scale.x, memory.scale.y);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (memory.pivot) {
|
|
526
|
+
if (typeof memory.pivot === "number") {
|
|
527
|
+
element.pivot.set(memory.pivot, memory.pivot);
|
|
528
|
+
} else {
|
|
529
|
+
element.pivot.set(memory.pivot.x, memory.pivot.y);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
memory.position && element.position.set(memory.position.x, memory.position.y);
|
|
533
|
+
memory.skew && element.skew.set(memory.skew.x, memory.skew.y);
|
|
534
|
+
memory.visible && (element.visible = memory.visible);
|
|
535
|
+
memory.x && (element.x = memory.x);
|
|
536
|
+
memory.y && (element.y = memory.y);
|
|
537
|
+
memory.boundsArea && (element.boundsArea = memory.boundsArea);
|
|
538
|
+
memory.cursor && (element.cursor = memory.cursor);
|
|
539
|
+
memory.eventMode && (element.eventMode = memory.eventMode);
|
|
540
|
+
memory.interactive && (element.interactive = memory.interactive);
|
|
541
|
+
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
542
|
+
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// src/decorators/CharacterDecorator.ts
|
|
546
|
+
var registeredCharacters = {};
|
|
547
|
+
function saveCharacter(character) {
|
|
548
|
+
if (Array.isArray(character)) {
|
|
549
|
+
character.forEach((c) => saveCharacter(c));
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
if (registeredCharacters[character.id]) {
|
|
553
|
+
console.info(`[Pixi'VN] Character id ${character.id} already exists, it will be overwritten`);
|
|
554
|
+
}
|
|
555
|
+
registeredCharacters[character.id] = character;
|
|
556
|
+
}
|
|
516
557
|
function getStepSha1(step) {
|
|
517
558
|
let sha1String = sha1(step.toString().toLocaleLowerCase());
|
|
518
559
|
return sha1String.toString();
|
|
@@ -536,7 +577,7 @@ var Label = class {
|
|
|
536
577
|
this._choiseIndex = choiseIndex;
|
|
537
578
|
}
|
|
538
579
|
/**
|
|
539
|
-
* Get the id of the label
|
|
580
|
+
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
540
581
|
*/
|
|
541
582
|
get id() {
|
|
542
583
|
return this._id;
|
|
@@ -594,47 +635,231 @@ function newCloseLabel(choiseIndex) {
|
|
|
594
635
|
return new Label(CLOSE_LABEL_ID, [], void 0, choiseIndex);
|
|
595
636
|
}
|
|
596
637
|
|
|
638
|
+
// src/types/CloseType.ts
|
|
639
|
+
var Close = "close";
|
|
640
|
+
|
|
597
641
|
// src/functions/DialogueUtility.ts
|
|
598
642
|
function setDialogue(props) {
|
|
599
643
|
let text = "";
|
|
600
|
-
let
|
|
644
|
+
let character = void 0;
|
|
601
645
|
let dialogue;
|
|
602
646
|
if (typeof props === "string") {
|
|
603
647
|
text = props;
|
|
604
|
-
dialogue = new DialogueBaseModel(text,
|
|
648
|
+
dialogue = new DialogueBaseModel(text, character);
|
|
605
649
|
} else if (!(props instanceof DialogueBaseModel)) {
|
|
606
650
|
text = props.text;
|
|
607
651
|
if (props.character) {
|
|
608
652
|
if (typeof props.character === "string") {
|
|
609
|
-
|
|
653
|
+
character = props.character;
|
|
654
|
+
} else {
|
|
655
|
+
character = props.character.id;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
dialogue = new DialogueBaseModel(text, character);
|
|
659
|
+
} else {
|
|
660
|
+
dialogue = props;
|
|
661
|
+
}
|
|
662
|
+
GameStorageManager.setVariable(GameStorageManager.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY, dialogue);
|
|
663
|
+
GameStorageManager.setVariable(GameStorageManager.keysSystem.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY, GameStepManager.lastStepIndex);
|
|
664
|
+
}
|
|
665
|
+
function getDialogue() {
|
|
666
|
+
return GameStorageManager.getVariable(GameStorageManager.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);
|
|
667
|
+
}
|
|
668
|
+
function getChoiceMenuOptions() {
|
|
669
|
+
let d = GameStorageManager.getVariable(GameStorageManager.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY);
|
|
670
|
+
if (d) {
|
|
671
|
+
let options = [];
|
|
672
|
+
d.forEach((option, index) => {
|
|
673
|
+
if (option.type === Close) {
|
|
674
|
+
let itemLabel = newCloseLabel(index);
|
|
675
|
+
options.push({
|
|
676
|
+
text: option.text,
|
|
677
|
+
label: itemLabel,
|
|
678
|
+
type: Close,
|
|
679
|
+
closeCurrentLabel: option.closeCurrentLabel,
|
|
680
|
+
props: {}
|
|
681
|
+
});
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
let label = getLabelById(option.label);
|
|
685
|
+
if (label) {
|
|
686
|
+
let itemLabel = new Label(label.id, label.steps, label.onStepRun, index);
|
|
687
|
+
options.push(__spreadProps(__spreadValues({}, option), {
|
|
688
|
+
label: itemLabel
|
|
689
|
+
}));
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
return options;
|
|
693
|
+
}
|
|
694
|
+
return void 0;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// src/functions/TickerUtility.ts
|
|
698
|
+
function updateTickerProgression(args, propertyName, progression) {
|
|
699
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === progression.limit) {
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
if (typeof args[propertyName] === "number") {
|
|
703
|
+
if (progression.type === "linear") {
|
|
704
|
+
args[propertyName] = getLinearProgression(args[propertyName], progression);
|
|
705
|
+
} else if (progression.type === "exponential") {
|
|
706
|
+
args[propertyName] = getExponentialProgression(args[propertyName], progression);
|
|
707
|
+
}
|
|
708
|
+
} 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") {
|
|
709
|
+
if (progression.type === "linear") {
|
|
710
|
+
args[propertyName].x = getLinearProgression(args[propertyName].x, progression);
|
|
711
|
+
args[propertyName].y = getLinearProgression(args[propertyName].y, progression);
|
|
712
|
+
} else if (progression.type === "exponential") {
|
|
713
|
+
args[propertyName].x = getExponentialProgression(args[propertyName].x, progression);
|
|
714
|
+
args[propertyName].y = getExponentialProgression(args[propertyName].y, progression);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
function getLinearProgression(number, progression) {
|
|
719
|
+
if (progression.limit !== void 0) {
|
|
720
|
+
if (number > progression.limit && progression.amt > 0) {
|
|
721
|
+
return progression.limit;
|
|
722
|
+
} else if (number < progression.limit && progression.amt < 0) {
|
|
723
|
+
return progression.limit;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
return number + progression.amt / 60;
|
|
727
|
+
}
|
|
728
|
+
function getExponentialProgression(number, progression) {
|
|
729
|
+
if (progression.limit !== void 0) {
|
|
730
|
+
if (number > progression.limit && progression.percentage > 0) {
|
|
731
|
+
return progression.limit;
|
|
732
|
+
} else if (number < progression.limit && progression.percentage < 0) {
|
|
733
|
+
return progression.limit;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return number + number * progression.percentage;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// src/classes/ticker/TickerBase.ts
|
|
740
|
+
var TickerBase = class {
|
|
741
|
+
/**
|
|
742
|
+
* @param args The arguments that you want to pass to the ticker.
|
|
743
|
+
* @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
|
|
744
|
+
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
745
|
+
*/
|
|
746
|
+
constructor(args, duration, priority) {
|
|
747
|
+
/**
|
|
748
|
+
* Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}
|
|
749
|
+
*/
|
|
750
|
+
this.id = "ticker_id_not_set";
|
|
751
|
+
this.args = args;
|
|
752
|
+
this.duration = duration;
|
|
753
|
+
this.priority = priority;
|
|
754
|
+
this.id = this.constructor.prototype.id;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* The method that will be called every frame.
|
|
758
|
+
* This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
|
|
759
|
+
* @param _ticker The ticker that is calling this method
|
|
760
|
+
* @param _args The arguments that you passed when you added the ticker
|
|
761
|
+
* @param _tags The tags of the canvas elements that are connected to this ticker
|
|
762
|
+
* @param _tickerId The id of the ticker. You can use this to get the ticker from the {@link GameWindowManager.currentTickers}
|
|
763
|
+
*/
|
|
764
|
+
fn(_ticker, _args, _tags, _tickerId) {
|
|
765
|
+
throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
|
|
766
|
+
}
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
// src/classes/ticker/ZoomTicker.ts
|
|
770
|
+
var ZoomTicker = class extends TickerBase {
|
|
771
|
+
fn(ticker, args, tags, tickerId) {
|
|
772
|
+
let xSpeed = 0.1;
|
|
773
|
+
let ySpeed = 0.1;
|
|
774
|
+
if (args.speed) {
|
|
775
|
+
if (typeof args.speed === "number") {
|
|
776
|
+
xSpeed = args.speed;
|
|
777
|
+
ySpeed = args.speed;
|
|
610
778
|
} else {
|
|
611
|
-
|
|
779
|
+
xSpeed = args.speed.x;
|
|
780
|
+
ySpeed = args.speed.y;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
xSpeed /= 60;
|
|
784
|
+
ySpeed /= 60;
|
|
785
|
+
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
786
|
+
if (typeof tagToRemoveAfter2 === "string") {
|
|
787
|
+
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
788
|
+
}
|
|
789
|
+
let type = args.type || "zoom";
|
|
790
|
+
let xLimit = type === "zoom" ? Infinity : 0;
|
|
791
|
+
let yLimit = type === "zoom" ? Infinity : 0;
|
|
792
|
+
if (args.limit) {
|
|
793
|
+
if (typeof args.limit === "number") {
|
|
794
|
+
xLimit = args.limit;
|
|
795
|
+
yLimit = args.limit;
|
|
796
|
+
} else {
|
|
797
|
+
xLimit = args.limit.x;
|
|
798
|
+
yLimit = args.limit.y;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
tags.filter((tag) => {
|
|
802
|
+
var _a;
|
|
803
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
804
|
+
if (args.startOnlyIfHaveTexture) {
|
|
805
|
+
if (element && element instanceof Sprite && ((_a = element.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
806
|
+
return false;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
return true;
|
|
810
|
+
}).forEach((tag) => {
|
|
811
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
812
|
+
if (element && element instanceof Container) {
|
|
813
|
+
if (type === "zoom" && (element.scale.x < xLimit || element.scale.y < yLimit)) {
|
|
814
|
+
element.scale.x += xSpeed * ticker.deltaTime;
|
|
815
|
+
element.scale.y += ySpeed * ticker.deltaTime;
|
|
816
|
+
} else if (type === "unzoom" && (element.scale.x > xLimit || element.scale.y > yLimit)) {
|
|
817
|
+
element.scale.x -= xSpeed * ticker.deltaTime;
|
|
818
|
+
element.scale.y -= ySpeed * ticker.deltaTime;
|
|
819
|
+
}
|
|
820
|
+
if (type === "zoom") {
|
|
821
|
+
if (element.scale.x > xLimit) {
|
|
822
|
+
element.scale.x = xLimit;
|
|
823
|
+
}
|
|
824
|
+
if (element.scale.y > yLimit) {
|
|
825
|
+
element.scale.y = yLimit;
|
|
826
|
+
}
|
|
827
|
+
if (element.scale.x >= xLimit && element.scale.y >= yLimit) {
|
|
828
|
+
element.scale.x = xLimit;
|
|
829
|
+
element.scale.y = yLimit;
|
|
830
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
831
|
+
}
|
|
832
|
+
} else if (type === "unzoom") {
|
|
833
|
+
if (element.scale.x < xLimit) {
|
|
834
|
+
element.scale.x = xLimit;
|
|
835
|
+
}
|
|
836
|
+
if (element.scale.y < yLimit) {
|
|
837
|
+
element.scale.y = yLimit;
|
|
838
|
+
}
|
|
839
|
+
if (element.scale.x <= xLimit && element.scale.y <= yLimit) {
|
|
840
|
+
element.scale.x = xLimit;
|
|
841
|
+
element.scale.y = yLimit;
|
|
842
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
if (xSpeed < 1e-5 && ySpeed < 1e-5 && !(args.speedProgression && args.speedProgression.type == "linear" && args.speedProgression.amt != 0)) {
|
|
846
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
847
|
+
}
|
|
612
848
|
}
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
dialogue = props;
|
|
849
|
+
});
|
|
850
|
+
if (args.speedProgression)
|
|
851
|
+
updateTickerProgression(args, "speed", args.speedProgression);
|
|
617
852
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
853
|
+
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
854
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
ZoomTicker = __decorateClass([
|
|
858
|
+
tickerDecorator()
|
|
859
|
+
], ZoomTicker);
|
|
624
860
|
|
|
625
861
|
// src/constants.ts
|
|
626
862
|
var Repeat = "repeat";
|
|
627
|
-
function Pause(duration) {
|
|
628
|
-
return {
|
|
629
|
-
type: "pause",
|
|
630
|
-
duration
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
// src/functions/ImageUtility.ts
|
|
635
|
-
function removeCanvasElement(tag) {
|
|
636
|
-
GameWindowManager.removeCanvasElement(tag);
|
|
637
|
-
}
|
|
638
863
|
|
|
639
864
|
// src/functions/ExportUtility.ts
|
|
640
865
|
function createExportableElement(element) {
|
|
@@ -773,31 +998,6 @@ var _GameStorageManager = class _GameStorageManager {
|
|
|
773
998
|
_GameStorageManager.storage = {};
|
|
774
999
|
var GameStorageManager = _GameStorageManager;
|
|
775
1000
|
|
|
776
|
-
// src/classes/ticker/TickerBase.ts
|
|
777
|
-
var TickerBase = class {
|
|
778
|
-
/**
|
|
779
|
-
* @param args The arguments that you want to pass to the ticker.
|
|
780
|
-
* @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
|
|
781
|
-
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
782
|
-
*/
|
|
783
|
-
constructor(args, duration, priority) {
|
|
784
|
-
this.args = args;
|
|
785
|
-
this.duration = duration;
|
|
786
|
-
this.priority = priority;
|
|
787
|
-
}
|
|
788
|
-
/**
|
|
789
|
-
* The method that will be called every frame.
|
|
790
|
-
* This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
|
|
791
|
-
* @param _ticker The ticker that is calling this method
|
|
792
|
-
* @param _args The arguments that you passed when you added the ticker
|
|
793
|
-
* @param _tags The tags of the canvas elements that are connected to this ticker
|
|
794
|
-
* @param _tickerId The id of the ticker. You can use this to get the ticker from the {@link GameWindowManager.currentTickers}
|
|
795
|
-
*/
|
|
796
|
-
fn(_ticker, _args, _tags, _tickerId) {
|
|
797
|
-
throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
|
|
798
|
-
}
|
|
799
|
-
};
|
|
800
|
-
|
|
801
1001
|
// src/decorators/TickerDecorator.ts
|
|
802
1002
|
var registeredTickers = {};
|
|
803
1003
|
function tickerDecorator(name) {
|
|
@@ -808,19 +1008,20 @@ function tickerDecorator(name) {
|
|
|
808
1008
|
if (registeredTickers[name]) {
|
|
809
1009
|
console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`);
|
|
810
1010
|
}
|
|
1011
|
+
target.prototype.id = name;
|
|
811
1012
|
registeredTickers[name] = target;
|
|
812
1013
|
};
|
|
813
1014
|
}
|
|
814
|
-
function
|
|
1015
|
+
function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
815
1016
|
try {
|
|
816
|
-
let ticker = registeredTickers[
|
|
1017
|
+
let ticker = registeredTickers[tickerId];
|
|
817
1018
|
if (!ticker) {
|
|
818
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
1019
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
819
1020
|
return;
|
|
820
1021
|
}
|
|
821
1022
|
return new ticker(args, duration, priority);
|
|
822
1023
|
} catch (e) {
|
|
823
|
-
console.error(`[Pixi'VN] Error while getting Ticker ${
|
|
1024
|
+
console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e);
|
|
824
1025
|
return;
|
|
825
1026
|
}
|
|
826
1027
|
}
|
|
@@ -892,7 +1093,7 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
892
1093
|
height
|
|
893
1094
|
}, options)).then(() => {
|
|
894
1095
|
_GameWindowManager._isInitialized = true;
|
|
895
|
-
this.
|
|
1096
|
+
this.addCanvasIntoHTMLElement(element);
|
|
896
1097
|
window.addEventListener("resize", _GameWindowManager.resize);
|
|
897
1098
|
_GameWindowManager.resize();
|
|
898
1099
|
asciiArtLog();
|
|
@@ -903,7 +1104,7 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
903
1104
|
* Add the canvas into a html element.
|
|
904
1105
|
* @param element it is the html element where I will put the canvas. Example: document.body
|
|
905
1106
|
*/
|
|
906
|
-
static
|
|
1107
|
+
static addCanvasIntoHTMLElement(element) {
|
|
907
1108
|
if (_GameWindowManager.isInitialized) {
|
|
908
1109
|
element.appendChild(_GameWindowManager.app.canvas);
|
|
909
1110
|
} else {
|
|
@@ -1149,18 +1350,18 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1149
1350
|
* ```
|
|
1150
1351
|
*/
|
|
1151
1352
|
static addTicker(canvasElementTag, ticker) {
|
|
1152
|
-
let
|
|
1353
|
+
let tickerId = ticker.id;
|
|
1153
1354
|
if (typeof canvasElementTag === "string") {
|
|
1154
1355
|
canvasElementTag = [canvasElementTag];
|
|
1155
1356
|
}
|
|
1156
|
-
if (!
|
|
1157
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
1357
|
+
if (!geTickerInstanceById(tickerId, ticker.args, ticker.duration, ticker.priority)) {
|
|
1358
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
1158
1359
|
return;
|
|
1159
1360
|
}
|
|
1160
1361
|
let tickerHistory = {
|
|
1161
1362
|
fn: () => {
|
|
1162
1363
|
},
|
|
1163
|
-
|
|
1364
|
+
id: tickerId,
|
|
1164
1365
|
args: createExportableElement(ticker.args),
|
|
1165
1366
|
canvasElementTags: canvasElementTag,
|
|
1166
1367
|
priority: ticker.priority,
|
|
@@ -1176,11 +1377,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1176
1377
|
_GameWindowManager.removeTicker(id);
|
|
1177
1378
|
}
|
|
1178
1379
|
}, ticker.duration * 1e3);
|
|
1179
|
-
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag,
|
|
1380
|
+
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag, tickerId, timeout.toString(), true);
|
|
1180
1381
|
}
|
|
1181
1382
|
}
|
|
1182
1383
|
static pushTicker(id, tickerData, ticker) {
|
|
1183
|
-
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags,
|
|
1384
|
+
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags, ticker);
|
|
1184
1385
|
_GameWindowManager._currentTickers[id] = tickerData;
|
|
1185
1386
|
tickerData.fn = (t) => {
|
|
1186
1387
|
let data = _GameWindowManager._currentTickers[id];
|
|
@@ -1221,9 +1422,9 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1221
1422
|
if (step.hasOwnProperty("type") && step.type === "pause") {
|
|
1222
1423
|
return step;
|
|
1223
1424
|
}
|
|
1224
|
-
let
|
|
1425
|
+
let tickerId = step.id;
|
|
1225
1426
|
return {
|
|
1226
|
-
ticker:
|
|
1427
|
+
ticker: tickerId,
|
|
1227
1428
|
args: createExportableElement(step.args),
|
|
1228
1429
|
duration: step.duration
|
|
1229
1430
|
};
|
|
@@ -1261,16 +1462,16 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1261
1462
|
_GameWindowManager.addTickerTimeoutInfo(tag, "steps", timeout.toString(), false);
|
|
1262
1463
|
return;
|
|
1263
1464
|
}
|
|
1264
|
-
let ticker =
|
|
1465
|
+
let ticker = geTickerInstanceById(step.ticker, step.args, step.duration, step.priority);
|
|
1265
1466
|
if (!ticker) {
|
|
1266
1467
|
console.error(`[Pixi'VN] Ticker ${step.ticker} not found`);
|
|
1267
1468
|
return;
|
|
1268
1469
|
}
|
|
1269
|
-
let tickerName = ticker.
|
|
1470
|
+
let tickerName = ticker.id;
|
|
1270
1471
|
let tickerHistory = {
|
|
1271
1472
|
fn: () => {
|
|
1272
1473
|
},
|
|
1273
|
-
|
|
1474
|
+
id: tickerName,
|
|
1274
1475
|
args: createExportableElement(ticker.args),
|
|
1275
1476
|
canvasElementTags: [tag],
|
|
1276
1477
|
priority: ticker.priority,
|
|
@@ -1327,26 +1528,26 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1327
1528
|
* ```
|
|
1328
1529
|
*/
|
|
1329
1530
|
static removeAssociationBetweenTickerCanvasElement(tags, ticker) {
|
|
1330
|
-
let
|
|
1531
|
+
let tickerId;
|
|
1331
1532
|
if (typeof ticker === "string") {
|
|
1332
|
-
|
|
1533
|
+
tickerId = ticker;
|
|
1333
1534
|
} else if (ticker instanceof TickerBase) {
|
|
1334
|
-
|
|
1535
|
+
tickerId = ticker.id;
|
|
1335
1536
|
} else {
|
|
1336
|
-
|
|
1537
|
+
tickerId = ticker.prototype.id;
|
|
1337
1538
|
}
|
|
1338
1539
|
if (typeof tags === "string") {
|
|
1339
1540
|
tags = [tags];
|
|
1340
1541
|
}
|
|
1341
1542
|
for (let id in _GameWindowManager._currentTickers) {
|
|
1342
1543
|
let ticker2 = _GameWindowManager._currentTickers[id];
|
|
1343
|
-
if (ticker2.
|
|
1544
|
+
if (ticker2.id === tickerId) {
|
|
1344
1545
|
_GameWindowManager._currentTickers[id].canvasElementTags = ticker2.canvasElementTags.filter((e) => !tags.includes(e));
|
|
1345
1546
|
}
|
|
1346
1547
|
}
|
|
1347
1548
|
for (let timeout in _GameWindowManager._currentTickersTimeouts) {
|
|
1348
1549
|
let TickerTimeout = _GameWindowManager._currentTickersTimeouts[timeout];
|
|
1349
|
-
if (TickerTimeout.ticker ===
|
|
1550
|
+
if (TickerTimeout.ticker === tickerId && TickerTimeout.canBeDeletedBeforeEnd) {
|
|
1350
1551
|
_GameWindowManager._currentTickersTimeouts[timeout].tags = TickerTimeout.tags.filter((t) => !tags.includes(t));
|
|
1351
1552
|
}
|
|
1352
1553
|
}
|
|
@@ -1532,11 +1733,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1532
1733
|
for (let id in currentTickers) {
|
|
1533
1734
|
let t = currentTickers[id];
|
|
1534
1735
|
let tags = t.canvasElementTags;
|
|
1535
|
-
let ticker =
|
|
1736
|
+
let ticker = geTickerInstanceById(t.id, t.args, t.duration, t.priority);
|
|
1536
1737
|
if (ticker) {
|
|
1537
1738
|
_GameWindowManager.addTicker(tags, ticker);
|
|
1538
1739
|
} else {
|
|
1539
|
-
console.error(`[Pixi'VN] Ticker ${t.
|
|
1740
|
+
console.error(`[Pixi'VN] Ticker ${t.id} not found`);
|
|
1540
1741
|
}
|
|
1541
1742
|
}
|
|
1542
1743
|
}
|
|
@@ -1737,6 +1938,13 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1737
1938
|
_GameStepManager._openedLabels = _GameStepManager.originalStepData.openedLabels;
|
|
1738
1939
|
}
|
|
1739
1940
|
/* Run Methods */
|
|
1941
|
+
static get canGoNext() {
|
|
1942
|
+
let options = getChoiceMenuOptions();
|
|
1943
|
+
if (options && options.length > 0) {
|
|
1944
|
+
return false;
|
|
1945
|
+
}
|
|
1946
|
+
return true;
|
|
1947
|
+
}
|
|
1740
1948
|
/**
|
|
1741
1949
|
* Execute the next step and add it to the history.
|
|
1742
1950
|
* @param props The props to pass to the step.
|
|
@@ -1746,7 +1954,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1746
1954
|
* ```typescript
|
|
1747
1955
|
* function nextOnClick() {
|
|
1748
1956
|
* setLoading(true)
|
|
1749
|
-
* GameStepManager.
|
|
1957
|
+
* GameStepManager.goNext(yourParams)
|
|
1750
1958
|
* .then((result) => {
|
|
1751
1959
|
* setUpdate((p) => p + 1)
|
|
1752
1960
|
* setLoading(false)
|
|
@@ -1761,8 +1969,12 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1761
1969
|
* }
|
|
1762
1970
|
* ```
|
|
1763
1971
|
*/
|
|
1764
|
-
static
|
|
1972
|
+
static goNext(props, choiseMade) {
|
|
1765
1973
|
return __async(this, null, function* () {
|
|
1974
|
+
if (!_GameStepManager.canGoNext) {
|
|
1975
|
+
console.warn("[Pixi'VN] The player must make a choice");
|
|
1976
|
+
return;
|
|
1977
|
+
}
|
|
1766
1978
|
_GameStepManager.increaseCurrentStepIndex();
|
|
1767
1979
|
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
1768
1980
|
});
|
|
@@ -1793,7 +2005,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1793
2005
|
return result;
|
|
1794
2006
|
} else if (_GameStepManager.openedLabels.length > 1) {
|
|
1795
2007
|
_GameStepManager.closeCurrentLabel();
|
|
1796
|
-
return yield _GameStepManager.
|
|
2008
|
+
return yield _GameStepManager.goNext(props, choiseMade);
|
|
1797
2009
|
} else {
|
|
1798
2010
|
_GameStepManager.restorLastLabelList();
|
|
1799
2011
|
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");
|
|
@@ -1941,7 +2153,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1941
2153
|
if (choice.closeCurrentLabel) {
|
|
1942
2154
|
_GameStepManager.closeCurrentLabel();
|
|
1943
2155
|
}
|
|
1944
|
-
return _GameStepManager.
|
|
2156
|
+
return _GameStepManager.goNext(props, choiseMade);
|
|
1945
2157
|
});
|
|
1946
2158
|
}
|
|
1947
2159
|
/* After Update Methods */
|
|
@@ -2136,6 +2348,120 @@ _GameStepManager._openedLabels = [];
|
|
|
2136
2348
|
_GameStepManager._originalStepData = void 0;
|
|
2137
2349
|
var GameStepManager = _GameStepManager;
|
|
2138
2350
|
|
|
2351
|
+
// src/classes/StoredClassModel.ts
|
|
2352
|
+
var StoredClassModel = class {
|
|
2353
|
+
/**
|
|
2354
|
+
* @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.
|
|
2355
|
+
* @param id The id of instance of the class. This id must be unique for the category.
|
|
2356
|
+
*/
|
|
2357
|
+
constructor(categoryId, id) {
|
|
2358
|
+
this.categoryId = categoryId;
|
|
2359
|
+
this._id = id;
|
|
2360
|
+
}
|
|
2361
|
+
/**
|
|
2362
|
+
* Is id of the stored class. is unique for this class.
|
|
2363
|
+
*/
|
|
2364
|
+
get id() {
|
|
2365
|
+
return this._id;
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* Update a property in the storage.
|
|
2369
|
+
* @param propertyName The name of the property to set.
|
|
2370
|
+
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
2371
|
+
*/
|
|
2372
|
+
setStorageProperty(propertyName, value) {
|
|
2373
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
2374
|
+
if (!storage) {
|
|
2375
|
+
storage = {};
|
|
2376
|
+
}
|
|
2377
|
+
if (!storage.hasOwnProperty(this.id)) {
|
|
2378
|
+
storage[this.id] = {};
|
|
2379
|
+
}
|
|
2380
|
+
if (value === void 0 || value === null) {
|
|
2381
|
+
if (storage[this.id].hasOwnProperty(propertyName)) {
|
|
2382
|
+
delete storage[this.id][propertyName];
|
|
2383
|
+
}
|
|
2384
|
+
} else {
|
|
2385
|
+
storage[this.id] = __spreadProps(__spreadValues({}, storage[this.id]), { [propertyName]: value });
|
|
2386
|
+
}
|
|
2387
|
+
if (Object.keys(storage[this.id]).length === 0) {
|
|
2388
|
+
delete storage[this.id];
|
|
2389
|
+
}
|
|
2390
|
+
GameStorageManager.setVariable(this.categoryId, storage);
|
|
2391
|
+
}
|
|
2392
|
+
/**
|
|
2393
|
+
* Get a property from the storage.
|
|
2394
|
+
* @param propertyName The name of the property to get.
|
|
2395
|
+
* @returns The value of the property. If the property is not found, returns undefined.
|
|
2396
|
+
*/
|
|
2397
|
+
getStorageProperty(propertyName) {
|
|
2398
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
2399
|
+
if (storage && storage.hasOwnProperty(this.id) && storage[this.id].hasOwnProperty(propertyName)) {
|
|
2400
|
+
return storage[this.id][propertyName];
|
|
2401
|
+
}
|
|
2402
|
+
return void 0;
|
|
2403
|
+
}
|
|
2404
|
+
};
|
|
2405
|
+
|
|
2406
|
+
// src/classes/CharacterBaseModel.ts
|
|
2407
|
+
var CharacterBaseModel2 = class extends StoredClassModel {
|
|
2408
|
+
/**
|
|
2409
|
+
* @param id The id of the character.
|
|
2410
|
+
* @param props The properties of the character.
|
|
2411
|
+
*/
|
|
2412
|
+
constructor(id, props) {
|
|
2413
|
+
super(GameStorageManager.keysSystem.CHARACTER_CATEGORY_KEY, id);
|
|
2414
|
+
this.defaultName = "";
|
|
2415
|
+
this.defaultName = props.name;
|
|
2416
|
+
this.defaultSurname = props.surname;
|
|
2417
|
+
this.defaultAge = props.age;
|
|
2418
|
+
this._icon = props.icon;
|
|
2419
|
+
this._color = props.color;
|
|
2420
|
+
}
|
|
2421
|
+
/***
|
|
2422
|
+
* The name of the character.
|
|
2423
|
+
* If you set undefined, it will return the default name.
|
|
2424
|
+
*/
|
|
2425
|
+
get name() {
|
|
2426
|
+
return this.getStorageProperty("name") || this.defaultName;
|
|
2427
|
+
}
|
|
2428
|
+
set name(value) {
|
|
2429
|
+
this.setStorageProperty("name", value);
|
|
2430
|
+
}
|
|
2431
|
+
/**
|
|
2432
|
+
* The surname of the character.
|
|
2433
|
+
* If you set undefined, it will return the default surname.
|
|
2434
|
+
*/
|
|
2435
|
+
get surname() {
|
|
2436
|
+
return this.getStorageProperty("surname") || this.defaultSurname;
|
|
2437
|
+
}
|
|
2438
|
+
set surname(value) {
|
|
2439
|
+
this.setStorageProperty("surname", value);
|
|
2440
|
+
}
|
|
2441
|
+
/**
|
|
2442
|
+
* The age of the character.
|
|
2443
|
+
* If you set undefined, it will return the default age.
|
|
2444
|
+
*/
|
|
2445
|
+
get age() {
|
|
2446
|
+
return this.getStorageProperty("age") || this.defaultAge;
|
|
2447
|
+
}
|
|
2448
|
+
set age(value) {
|
|
2449
|
+
this.setStorageProperty("age", value);
|
|
2450
|
+
}
|
|
2451
|
+
/**
|
|
2452
|
+
* The icon of the character.
|
|
2453
|
+
*/
|
|
2454
|
+
get icon() {
|
|
2455
|
+
return this._icon;
|
|
2456
|
+
}
|
|
2457
|
+
/**
|
|
2458
|
+
* The color of the character.
|
|
2459
|
+
*/
|
|
2460
|
+
get color() {
|
|
2461
|
+
return this._color;
|
|
2462
|
+
}
|
|
2463
|
+
};
|
|
2464
|
+
|
|
2139
2465
|
// src/classes/DialogueBaseModel.ts
|
|
2140
2466
|
var DialogueBaseModel = class {
|
|
2141
2467
|
/**
|
|
@@ -2155,15 +2481,15 @@ var DialogueBaseModel = class {
|
|
|
2155
2481
|
if (typeof text === "string") {
|
|
2156
2482
|
this.text = text;
|
|
2157
2483
|
if (typeof character === "string") {
|
|
2158
|
-
this.
|
|
2484
|
+
this.character = character;
|
|
2159
2485
|
} else {
|
|
2160
|
-
this.
|
|
2486
|
+
this.character = character == null ? void 0 : character.id;
|
|
2161
2487
|
}
|
|
2162
2488
|
this.oltherParams = oltherParams;
|
|
2163
2489
|
} else {
|
|
2164
2490
|
this.text = text.text;
|
|
2165
|
-
if (text.
|
|
2166
|
-
this.
|
|
2491
|
+
if (text.character) {
|
|
2492
|
+
this.character = text.character;
|
|
2167
2493
|
}
|
|
2168
2494
|
this.oltherParams = text.oltherParams || {};
|
|
2169
2495
|
}
|
|
@@ -2176,7 +2502,7 @@ var DialogueBaseModel = class {
|
|
|
2176
2502
|
export() {
|
|
2177
2503
|
return {
|
|
2178
2504
|
text: this.text,
|
|
2179
|
-
|
|
2505
|
+
character: this.character,
|
|
2180
2506
|
oltherParams: this.oltherParams
|
|
2181
2507
|
};
|
|
2182
2508
|
}
|
|
@@ -2249,50 +2575,6 @@ var FadeAlphaTicker = class extends TickerBase {
|
|
|
2249
2575
|
FadeAlphaTicker = __decorateClass([
|
|
2250
2576
|
tickerDecorator()
|
|
2251
2577
|
], FadeAlphaTicker);
|
|
2252
|
-
|
|
2253
|
-
// src/functions/TickerUtility.ts
|
|
2254
|
-
function updateTickerProgression(args, propertyName, progression) {
|
|
2255
|
-
if (args[propertyName] === void 0 || !progression || args[propertyName] === progression.limit) {
|
|
2256
|
-
return;
|
|
2257
|
-
}
|
|
2258
|
-
if (typeof args[propertyName] === "number") {
|
|
2259
|
-
if (progression.type === "linear") {
|
|
2260
|
-
args[propertyName] = getLinearProgression(args[propertyName], progression);
|
|
2261
|
-
} else if (progression.type === "exponential") {
|
|
2262
|
-
args[propertyName] = getExponentialProgression(args[propertyName], progression);
|
|
2263
|
-
}
|
|
2264
|
-
} 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") {
|
|
2265
|
-
if (progression.type === "linear") {
|
|
2266
|
-
args[propertyName].x = getLinearProgression(args[propertyName].x, progression);
|
|
2267
|
-
args[propertyName].y = getLinearProgression(args[propertyName].y, progression);
|
|
2268
|
-
} else if (progression.type === "exponential") {
|
|
2269
|
-
args[propertyName].x = getExponentialProgression(args[propertyName].x, progression);
|
|
2270
|
-
args[propertyName].y = getExponentialProgression(args[propertyName].y, progression);
|
|
2271
|
-
}
|
|
2272
|
-
}
|
|
2273
|
-
}
|
|
2274
|
-
function getLinearProgression(number, progression) {
|
|
2275
|
-
if (progression.limit !== void 0) {
|
|
2276
|
-
if (number > progression.limit && progression.amt > 0) {
|
|
2277
|
-
return progression.limit;
|
|
2278
|
-
} else if (number < progression.limit && progression.amt < 0) {
|
|
2279
|
-
return progression.limit;
|
|
2280
|
-
}
|
|
2281
|
-
}
|
|
2282
|
-
return number + progression.amt / 60;
|
|
2283
|
-
}
|
|
2284
|
-
function getExponentialProgression(number, progression) {
|
|
2285
|
-
if (progression.limit !== void 0) {
|
|
2286
|
-
if (number > progression.limit && progression.percentage > 0) {
|
|
2287
|
-
return progression.limit;
|
|
2288
|
-
} else if (number < progression.limit && progression.percentage < 0) {
|
|
2289
|
-
return progression.limit;
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
|
-
return number + number * progression.percentage;
|
|
2293
|
-
}
|
|
2294
|
-
|
|
2295
|
-
// src/classes/ticker/MoveTicker.ts
|
|
2296
2578
|
var MoveTicker = class extends TickerBase {
|
|
2297
2579
|
fn(ticker, args, tags, tickerId) {
|
|
2298
2580
|
let xSpeed = 1;
|
|
@@ -2389,211 +2671,113 @@ var RotateTicker = class extends TickerBase {
|
|
|
2389
2671
|
RotateTicker = __decorateClass([
|
|
2390
2672
|
tickerDecorator()
|
|
2391
2673
|
], RotateTicker);
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
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
|
-
if (element.scale.y < yLimit) {
|
|
2459
|
-
element.scale.y = yLimit;
|
|
2460
|
-
}
|
|
2461
|
-
if (element.scale.x <= xLimit && element.scale.y <= yLimit) {
|
|
2462
|
-
element.scale.x = xLimit;
|
|
2463
|
-
element.scale.y = yLimit;
|
|
2464
|
-
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
2465
|
-
}
|
|
2674
|
+
|
|
2675
|
+
// src/labels/TestConstant.ts
|
|
2676
|
+
var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
|
|
2677
|
+
name: "Juliette",
|
|
2678
|
+
age: 25,
|
|
2679
|
+
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",
|
|
2680
|
+
color: "#ac0086"
|
|
2681
|
+
});
|
|
2682
|
+
saveCharacter(juliette);
|
|
2683
|
+
var eggHeadImage = "https://pixijs.com/assets/eggHead.png";
|
|
2684
|
+
var eggHeadName = `<span style="color:purple">Egg Head</span>`;
|
|
2685
|
+
|
|
2686
|
+
// src/labels/CustomTickerCanvasElementTestLabel.ts
|
|
2687
|
+
var AlienTintingTest = class extends CanvasSprite {
|
|
2688
|
+
constructor() {
|
|
2689
|
+
super(...arguments);
|
|
2690
|
+
this.direction = 0;
|
|
2691
|
+
this.turningSpeed = 0;
|
|
2692
|
+
this.speed = 0;
|
|
2693
|
+
}
|
|
2694
|
+
get memory() {
|
|
2695
|
+
return __spreadProps(__spreadValues({}, super.memory), {
|
|
2696
|
+
direction: this.direction,
|
|
2697
|
+
turningSpeed: this.turningSpeed,
|
|
2698
|
+
speed: this.speed
|
|
2699
|
+
});
|
|
2700
|
+
}
|
|
2701
|
+
set memory(memory) {
|
|
2702
|
+
super.memory = memory;
|
|
2703
|
+
this.direction = memory.direction;
|
|
2704
|
+
this.turningSpeed = memory.turningSpeed;
|
|
2705
|
+
this.speed = memory.speed;
|
|
2706
|
+
}
|
|
2707
|
+
static from(source, skipCache) {
|
|
2708
|
+
let sprite = Sprite.from(source, skipCache);
|
|
2709
|
+
let mySprite = new AlienTintingTest();
|
|
2710
|
+
mySprite.texture = sprite.texture;
|
|
2711
|
+
return mySprite;
|
|
2712
|
+
}
|
|
2713
|
+
};
|
|
2714
|
+
AlienTintingTest = __decorateClass([
|
|
2715
|
+
canvasElementDecorator("___pixi_vn_custom_canvas_element___")
|
|
2716
|
+
], AlienTintingTest);
|
|
2717
|
+
var TintingTestTicker = class extends TickerBase {
|
|
2718
|
+
constructor() {
|
|
2719
|
+
super({});
|
|
2720
|
+
}
|
|
2721
|
+
fn(_t, _args, tags) {
|
|
2722
|
+
tags.forEach((tag) => {
|
|
2723
|
+
const dudeBoundsPadding = 100;
|
|
2724
|
+
const dudeBounds = new Rectangle(
|
|
2725
|
+
-dudeBoundsPadding,
|
|
2726
|
+
-dudeBoundsPadding,
|
|
2727
|
+
GameWindowManager.screen.width + dudeBoundsPadding * 2,
|
|
2728
|
+
GameWindowManager.screen.height + dudeBoundsPadding * 2
|
|
2729
|
+
);
|
|
2730
|
+
let dude = GameWindowManager.getCanvasElement(tag);
|
|
2731
|
+
if (dude && dude instanceof AlienTintingTest) {
|
|
2732
|
+
dude.direction += dude.turningSpeed * 0.01;
|
|
2733
|
+
dude.x += Math.sin(dude.direction) * dude.speed;
|
|
2734
|
+
dude.y += Math.cos(dude.direction) * dude.speed;
|
|
2735
|
+
dude.rotation = -dude.direction - Math.PI / 2;
|
|
2736
|
+
if (dude.x < dudeBounds.x) {
|
|
2737
|
+
dude.x += dudeBounds.width;
|
|
2738
|
+
} else if (dude.x > dudeBounds.x + dudeBounds.width) {
|
|
2739
|
+
dude.x -= dudeBounds.width;
|
|
2466
2740
|
}
|
|
2467
|
-
if (
|
|
2468
|
-
|
|
2741
|
+
if (dude.y < dudeBounds.y) {
|
|
2742
|
+
dude.y += dudeBounds.height;
|
|
2743
|
+
} else if (dude.y > dudeBounds.y + dudeBounds.height) {
|
|
2744
|
+
dude.y -= dudeBounds.height;
|
|
2469
2745
|
}
|
|
2470
2746
|
}
|
|
2471
2747
|
});
|
|
2472
|
-
if (args.speedProgression)
|
|
2473
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
2474
2748
|
}
|
|
2475
2749
|
};
|
|
2476
|
-
|
|
2477
|
-
tickerDecorator()
|
|
2478
|
-
],
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
var alien2Tag = "alien2";
|
|
2483
|
-
var alien3Tag = "alien3";
|
|
2484
|
-
var alien4Tag = "alien4";
|
|
2485
|
-
var tickerTestLabel = newLabel(
|
|
2486
|
-
"TickerTestLabel",
|
|
2750
|
+
TintingTestTicker = __decorateClass([
|
|
2751
|
+
tickerDecorator("___pixi_vn_custom_ticker___")
|
|
2752
|
+
], TintingTestTicker);
|
|
2753
|
+
var CUSTOM_TICKER_CANVAS_ELEMENT_TEST_LABEL = "___pixi_vn_custom_ticker_canvas_element_test___";
|
|
2754
|
+
var customTickerCanvasElementTestLabel = newLabel(
|
|
2755
|
+
CUSTOM_TICKER_CANVAS_ELEMENT_TEST_LABEL,
|
|
2487
2756
|
[
|
|
2488
2757
|
() => __async(void 0, null, function* () {
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
setDialogue(`I have added a image with a tag ${alien2Tag} and I connected a RotateTicker with a speed of ${my_speed} to it.`);
|
|
2509
|
-
}),
|
|
2510
|
-
() => setDialogue(`Since ${alien1Tag} and ${alien2Tag} they have the same ticker with the same speed, only one RotateTicker will be performed`),
|
|
2511
|
-
() => {
|
|
2512
|
-
GameWindowManager.addTicker(alien1Tag, new RotateTicker({ speed: 0.2 }));
|
|
2513
|
-
setDialogue(`I have changed the speed of the RotateTicker connected to ${alien1Tag} to 0.2`);
|
|
2514
|
-
},
|
|
2515
|
-
() => setDialogue(`Since ${alien1Tag} have a different speed, it will perform a different RotateTicker`),
|
|
2516
|
-
() => {
|
|
2517
|
-
removeCanvasElement(alien1Tag);
|
|
2518
|
-
setDialogue(`I have remove the image with the tag ${alien1Tag}`);
|
|
2519
|
-
},
|
|
2520
|
-
() => setDialogue(`Since ${alien1Tag} is removed, the RotateTicker connected to it will not be performed`),
|
|
2521
|
-
() => {
|
|
2522
|
-
GameWindowManager.removeAssociationBetweenTickerCanvasElement(alien2Tag, RotateTicker);
|
|
2523
|
-
setDialogue(`I have removed the RotateTicker connected to ${alien2Tag}`);
|
|
2524
|
-
},
|
|
2525
|
-
() => __async(void 0, null, function* () {
|
|
2526
|
-
removeCanvasElement(alien2Tag);
|
|
2527
|
-
let duration = 7e3;
|
|
2528
|
-
const texture = yield Assets.load("https://pixijs.com/assets/eggHead.png");
|
|
2529
|
-
const alien = CanvasSprite.from(texture);
|
|
2530
|
-
alien.anchor.set(0.5);
|
|
2531
|
-
GameWindowManager.addCanvasElement(alien3Tag, alien);
|
|
2532
|
-
alien.x = 500;
|
|
2533
|
-
alien.y = 100;
|
|
2534
|
-
GameWindowManager.addTicker(alien3Tag, new RotateTicker({ speed: 0.1 }, duration));
|
|
2535
|
-
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.`);
|
|
2536
|
-
}),
|
|
2537
|
-
() => __async(void 0, null, function* () {
|
|
2538
|
-
let my_speed = 0.1;
|
|
2539
|
-
let my_speed2 = 0.3;
|
|
2540
|
-
const texture = yield Assets.load("https://pixijs.com/assets/eggHead.png");
|
|
2541
|
-
const alien = CanvasSprite.from(texture);
|
|
2542
|
-
alien.anchor.set(0.5);
|
|
2543
|
-
GameWindowManager.addCanvasElement(alien1Tag, alien);
|
|
2544
|
-
alien.x = 100;
|
|
2545
|
-
alien.y = 100;
|
|
2546
|
-
GameWindowManager.addTickersSteps(alien1Tag, [
|
|
2547
|
-
new RotateTicker({ speed: my_speed }, 1e3),
|
|
2548
|
-
new RotateTicker({ speed: my_speed2 }, 1e3)
|
|
2549
|
-
]);
|
|
2550
|
-
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.`);
|
|
2551
|
-
}),
|
|
2552
|
-
() => __async(void 0, null, function* () {
|
|
2553
|
-
const texture = yield Assets.load("https://pixijs.com/assets/eggHead.png");
|
|
2554
|
-
const alien = CanvasSprite.from(texture);
|
|
2555
|
-
alien.anchor.set(0.5);
|
|
2556
|
-
GameWindowManager.addCanvasElement(alien2Tag, alien);
|
|
2557
|
-
alien.x = 300;
|
|
2558
|
-
alien.y = 100;
|
|
2559
|
-
GameWindowManager.addTickersSteps(alien2Tag, [
|
|
2560
|
-
new RotateTicker({ speed: 0.1, clockwise: true }, 2e3),
|
|
2561
|
-
Pause(500),
|
|
2562
|
-
new RotateTicker({ speed: 0.2, clockwise: false }, 2e3),
|
|
2563
|
-
Repeat
|
|
2564
|
-
]);
|
|
2565
|
-
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.`);
|
|
2566
|
-
}),
|
|
2567
|
-
() => __async(void 0, null, function* () {
|
|
2568
|
-
const texture = yield Assets.load("https://pixijs.com/assets/eggHead.png");
|
|
2569
|
-
const alien = CanvasSprite.from(texture);
|
|
2570
|
-
alien.anchor.set(0.5);
|
|
2571
|
-
GameWindowManager.addCanvasElement(alien4Tag, alien);
|
|
2572
|
-
alien.x = 700;
|
|
2573
|
-
alien.y = 100;
|
|
2574
|
-
let speed = 0;
|
|
2575
|
-
let speedLimit = 0.5;
|
|
2576
|
-
let amt = 1e-3;
|
|
2577
|
-
GameWindowManager.addTicker(alien4Tag, new RotateTicker({ speed, speedProgression: { type: "linear", amt, limit: speedLimit } }));
|
|
2578
|
-
GameWindowManager.addTickersSteps(
|
|
2579
|
-
alien2Tag,
|
|
2580
|
-
[
|
|
2581
|
-
new FadeAlphaTicker({
|
|
2582
|
-
duration: 1,
|
|
2583
|
-
type: "hide"
|
|
2584
|
-
}, 3e3),
|
|
2585
|
-
new FadeAlphaTicker({
|
|
2586
|
-
duration: 1,
|
|
2587
|
-
type: "show"
|
|
2588
|
-
}, 3e3),
|
|
2589
|
-
Repeat
|
|
2590
|
-
]
|
|
2591
|
-
);
|
|
2592
|
-
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.`);
|
|
2758
|
+
const totalDudes = 100;
|
|
2759
|
+
for (let i = 0; i < totalDudes; i++) {
|
|
2760
|
+
const texture = yield Assets.load(eggHeadImage);
|
|
2761
|
+
const dude = AlienTintingTest.from(texture);
|
|
2762
|
+
dude.anchor.set(0.5);
|
|
2763
|
+
dude.scale.set(0.8 + Math.random() * 0.3);
|
|
2764
|
+
dude.x = Math.random() * GameWindowManager.screen.width;
|
|
2765
|
+
dude.y = Math.random() * GameWindowManager.screen.height;
|
|
2766
|
+
dude.tint = Math.random() * 16777215;
|
|
2767
|
+
dude.direction = Math.random() * Math.PI * 2;
|
|
2768
|
+
dude.turningSpeed = Math.random() - 0.8;
|
|
2769
|
+
dude.speed = 2 + Math.random() * 2;
|
|
2770
|
+
GameWindowManager.addCanvasElement("alien" + i, dude);
|
|
2771
|
+
GameWindowManager.addTicker("alien" + i, new TintingTestTicker());
|
|
2772
|
+
}
|
|
2773
|
+
setDialogue({
|
|
2774
|
+
character: juliette,
|
|
2775
|
+
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).)`
|
|
2776
|
+
});
|
|
2593
2777
|
})
|
|
2594
2778
|
]
|
|
2595
2779
|
);
|
|
2596
2780
|
|
|
2597
|
-
export {
|
|
2598
|
-
//# sourceMappingURL=
|
|
2599
|
-
//# sourceMappingURL=
|
|
2781
|
+
export { TintingTestTicker, customTickerCanvasElementTestLabel };
|
|
2782
|
+
//# sourceMappingURL=CustomTickerCanvasElementTestLabel.mjs.map
|
|
2783
|
+
//# sourceMappingURL=CustomTickerCanvasElementTestLabel.mjs.map
|