@drincs/pixi-vn 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TickerBase-RQDWNI4K.d.ts → TickerBase-3rLpDpmb.d.ts} +27 -13
- package/dist/{TickerBase-B5CQCJs8.d.mts → TickerBase-DKYzbzro.d.mts} +27 -13
- package/dist/classes/CanvasEvent.d.mts +7 -1
- package/dist/classes/CanvasEvent.d.ts +7 -1
- package/dist/classes/CanvasEvent.js +7 -0
- package/dist/classes/CanvasEvent.js.map +1 -1
- package/dist/classes/CanvasEvent.mjs +7 -0
- package/dist/classes/CanvasEvent.mjs.map +1 -1
- package/dist/classes/CharacterBaseModel.d.mts +2 -26
- package/dist/classes/CharacterBaseModel.d.ts +2 -26
- package/dist/classes/CharacterBaseModel.js +544 -241
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +540 -241
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +27 -17
- package/dist/classes/ChoiceMenuOption.d.ts +27 -17
- package/dist/classes/ChoiceMenuOption.js +548 -243
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +544 -243
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.d.mts +1 -1
- package/dist/classes/CloseLabel.d.ts +1 -1
- package/dist/classes/CloseLabel.js +1 -1
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +1 -1
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/DialogueBaseModel.d.mts +3 -2
- package/dist/classes/DialogueBaseModel.d.ts +3 -2
- package/dist/classes/DialogueBaseModel.js +5 -5
- package/dist/classes/DialogueBaseModel.js.map +1 -1
- package/dist/classes/DialogueBaseModel.mjs +5 -5
- package/dist/classes/DialogueBaseModel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +1 -1
- package/dist/classes/Label.d.ts +1 -1
- package/dist/classes/Label.js +1 -1
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +1 -1
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/StoredClassModel.d.mts +2 -2
- package/dist/classes/StoredClassModel.d.ts +2 -2
- package/dist/classes/StoredClassModel.js +544 -241
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs +540 -241
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/canvas/CanvasBase.d.mts +5 -1
- package/dist/classes/canvas/CanvasBase.d.ts +5 -1
- package/dist/classes/canvas/CanvasBase.js +7 -0
- package/dist/classes/canvas/CanvasBase.js.map +1 -1
- package/dist/classes/canvas/CanvasBase.mjs +7 -0
- package/dist/classes/canvas/CanvasBase.mjs.map +1 -1
- package/dist/classes/canvas/CanvasContainer.d.mts +4 -1
- package/dist/classes/canvas/CanvasContainer.d.ts +4 -1
- package/dist/classes/canvas/CanvasContainer.js +57 -37
- package/dist/classes/canvas/CanvasContainer.js.map +1 -1
- package/dist/classes/canvas/CanvasContainer.mjs +57 -38
- package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
- package/dist/classes/canvas/CanvasImage.d.mts +4 -2
- package/dist/classes/canvas/CanvasImage.d.ts +4 -2
- package/dist/classes/canvas/CanvasImage.js +33 -20
- package/dist/classes/canvas/CanvasImage.js.map +1 -1
- package/dist/classes/canvas/CanvasImage.mjs +30 -20
- package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
- package/dist/classes/canvas/CanvasSprite.d.mts +6 -3
- package/dist/classes/canvas/CanvasSprite.d.ts +6 -3
- package/dist/classes/canvas/CanvasSprite.js +25 -17
- package/dist/classes/canvas/CanvasSprite.js.map +1 -1
- package/dist/classes/canvas/CanvasSprite.mjs +25 -18
- package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
- package/dist/classes/canvas/CanvasText.d.mts +6 -3
- package/dist/classes/canvas/CanvasText.d.ts +6 -3
- package/dist/classes/canvas/CanvasText.js +25 -17
- package/dist/classes/canvas/CanvasText.js.map +1 -1
- package/dist/classes/canvas/CanvasText.mjs +25 -18
- package/dist/classes/canvas/CanvasText.mjs.map +1 -1
- package/dist/classes/canvas/index.js +184 -158
- package/dist/classes/canvas/index.js.map +1 -1
- package/dist/classes/canvas/index.mjs +184 -158
- package/dist/classes/canvas/index.mjs.map +1 -1
- package/dist/classes/index.d.mts +6 -4
- package/dist/classes/index.d.ts +6 -4
- package/dist/classes/index.js +560 -248
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +556 -248
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.d.mts +27 -0
- package/dist/classes/ticker/FadeAlphaTicker.d.ts +27 -0
- package/dist/classes/ticker/{TickerFadeAlpha.js → FadeAlphaTicker.js} +549 -248
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -0
- package/dist/classes/ticker/{TickerRotate.mjs → FadeAlphaTicker.mjs} +571 -274
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -0
- package/dist/classes/ticker/MoveTicker.d.mts +25 -0
- package/dist/classes/ticker/MoveTicker.d.ts +25 -0
- package/dist/classes/ticker/{TickerMove.js → MoveTicker.js} +544 -241
- package/dist/classes/ticker/MoveTicker.js.map +1 -0
- package/dist/classes/ticker/{TickerFadeAlpha.mjs → MoveTicker.mjs} +568 -269
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -0
- package/dist/classes/ticker/RotateTicker.d.mts +27 -0
- package/dist/classes/ticker/RotateTicker.d.ts +27 -0
- package/dist/classes/ticker/{TickerRotate.js → RotateTicker.js} +544 -241
- package/dist/classes/ticker/RotateTicker.js.map +1 -0
- package/dist/classes/ticker/{TickerMove.mjs → RotateTicker.mjs} +558 -259
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -0
- package/dist/classes/ticker/TickerBase.d.mts +2 -1
- package/dist/classes/ticker/TickerBase.d.ts +2 -1
- package/dist/classes/ticker/TickerBase.js +12 -6
- package/dist/classes/ticker/TickerBase.js.map +1 -1
- package/dist/classes/ticker/TickerBase.mjs +12 -6
- package/dist/classes/ticker/TickerBase.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.d.mts +31 -0
- package/dist/classes/ticker/ZoomTicker.d.ts +31 -0
- package/dist/classes/ticker/ZoomTicker.js +1647 -0
- package/dist/classes/ticker/ZoomTicker.js.map +1 -0
- package/dist/classes/ticker/ZoomTicker.mjs +1639 -0
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -0
- package/dist/classes/ticker/index.d.mts +11 -8
- package/dist/classes/ticker/index.d.ts +11 -8
- package/dist/classes/ticker/index.js +567 -266
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs +564 -267
- package/dist/classes/ticker/index.mjs.map +1 -1
- package/dist/constants.d.mts +12 -2
- package/dist/constants.d.ts +12 -2
- package/dist/constants.js +10 -1
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +9 -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 +63 -43
- package/dist/decorators/CanvasElementDecorator.js.map +1 -1
- package/dist/decorators/CanvasElementDecorator.mjs +62 -42
- package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
- package/dist/decorators/CharacterDecorator.d.mts +1 -0
- package/dist/decorators/CharacterDecorator.d.ts +1 -0
- 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.d.mts +4 -3
- package/dist/decorators/LabelDecorator.d.ts +4 -3
- package/dist/decorators/LabelDecorator.js +546 -243
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +542 -243
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/TickerDecorator.d.mts +9 -6
- package/dist/decorators/TickerDecorator.d.ts +9 -6
- 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 +4 -3
- package/dist/decorators/index.d.ts +4 -3
- package/dist/decorators/index.js +550 -245
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +546 -245
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/CanvasUtility.js +56 -37
- package/dist/functions/CanvasUtility.js.map +1 -1
- package/dist/functions/CanvasUtility.mjs +56 -37
- package/dist/functions/CanvasUtility.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +7 -5
- package/dist/functions/DialogueUtility.d.ts +7 -5
- package/dist/functions/DialogueUtility.js +729 -397
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +729 -397
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js +544 -241
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs +540 -241
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js +544 -241
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs +540 -241
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.d.mts +81 -8
- package/dist/functions/ImageUtility.d.ts +81 -8
- package/dist/functions/ImageUtility.js +911 -387
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs +899 -387
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/SavesUtility.d.mts +9 -5
- package/dist/functions/SavesUtility.d.ts +9 -5
- package/dist/functions/SavesUtility.js +611 -252
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +611 -252
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/TickerUtility.d.mts +1 -1
- package/dist/functions/TickerUtility.d.ts +1 -1
- package/dist/functions/TickerUtility.js +32 -18
- package/dist/functions/TickerUtility.js.map +1 -1
- package/dist/functions/TickerUtility.mjs +32 -18
- package/dist/functions/TickerUtility.mjs.map +1 -1
- package/dist/functions/index.d.mts +18 -8
- package/dist/functions/index.d.ts +18 -8
- package/dist/functions/index.js +832 -279
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +825 -280
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +25 -16
- package/dist/index.d.ts +25 -16
- package/dist/index.js +1547 -290
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1538 -290
- package/dist/index.mjs.map +1 -1
- package/dist/interface/CharacterBaseModelProps.d.mts +27 -0
- package/dist/interface/CharacterBaseModelProps.d.ts +27 -0
- package/dist/interface/CharacterBaseModelProps.js +4 -0
- package/dist/interface/CharacterBaseModelProps.mjs +3 -0
- package/dist/interface/DialogueHistory.d.mts +3 -7
- package/dist/interface/DialogueHistory.d.ts +3 -7
- package/dist/interface/IHistoryStep.d.mts +12 -8
- package/dist/interface/IHistoryStep.d.ts +12 -8
- package/dist/interface/ISaveData.d.mts +8 -4
- package/dist/interface/ISaveData.d.ts +8 -4
- package/dist/interface/ITicker.d.mts +2 -1
- package/dist/interface/ITicker.d.ts +2 -1
- package/dist/interface/ITickersSteps.d.mts +14 -5
- package/dist/interface/ITickersSteps.d.ts +14 -5
- package/dist/interface/TickerHistory.d.mts +29 -0
- package/dist/interface/TickerHistory.d.ts +29 -0
- package/dist/{types/ticker/TickerMoveProps.js → interface/TickerHistory.js} +1 -1
- package/dist/interface/TickerHistory.mjs +3 -0
- package/dist/interface/TickerProgrationType.d.mts +13 -1
- package/dist/interface/TickerProgrationType.d.ts +13 -1
- package/dist/interface/TickerTimeoutHistory.d.mts +7 -0
- package/dist/interface/TickerTimeoutHistory.d.ts +7 -0
- package/dist/interface/TickerTimeoutHistory.js +4 -0
- package/dist/interface/TickerTimeoutHistory.mjs +3 -0
- package/dist/interface/canvas/ICanvasBaseMemory.d.mts +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.d.ts +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.d.mts +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.d.ts +1 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.d.mts +0 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.d.ts +0 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.d.mts +0 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.d.ts +0 -1
- package/dist/interface/export/ExportedCanvas.d.mts +11 -3
- package/dist/interface/export/ExportedCanvas.d.ts +11 -3
- package/dist/interface/export/ExportedStep.d.mts +7 -3
- package/dist/interface/export/ExportedStep.d.ts +7 -3
- package/dist/interface/export/index.d.mts +8 -4
- package/dist/interface/export/index.d.ts +8 -4
- package/dist/interface/index.d.mts +14 -11
- package/dist/interface/index.d.ts +14 -11
- package/dist/labels/BaseCanvasElementTestLabel.d.mts +9 -0
- package/dist/labels/BaseCanvasElementTestLabel.d.ts +9 -0
- package/dist/labels/BaseCanvasElementTestLabel.js +1888 -0
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -0
- package/dist/labels/BaseCanvasElementTestLabel.mjs +1882 -0
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -0
- package/dist/labels/CanvasEventsTestLabel.d.mts +27 -0
- package/dist/labels/CanvasEventsTestLabel.d.ts +27 -0
- package/dist/labels/CanvasEventsTestLabel.js +2822 -0
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -0
- package/dist/labels/CanvasEventsTestLabel.mjs +2816 -0
- package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -0
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.mts +20 -0
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.ts +20 -0
- package/dist/labels/CustomTickerCanvasElementTestLabel.js +2792 -0
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -0
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +2786 -0
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -0
- package/dist/labels/ImagesAnimationsTestLabel.d.mts +9 -0
- package/dist/labels/ImagesAnimationsTestLabel.d.ts +9 -0
- package/dist/labels/ImagesAnimationsTestLabel.js +3378 -0
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -0
- package/dist/labels/ImagesAnimationsTestLabel.mjs +3372 -0
- package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -0
- package/dist/labels/MarkdownTest.d.mts +9 -0
- package/dist/labels/MarkdownTest.d.ts +9 -0
- package/dist/labels/MarkdownTest.js +2756 -0
- package/dist/labels/MarkdownTest.js.map +1 -0
- package/dist/labels/MarkdownTest.mjs +2750 -0
- package/dist/labels/MarkdownTest.mjs.map +1 -0
- package/dist/labels/StartLabel.d.mts +10 -0
- package/dist/labels/StartLabel.d.ts +10 -0
- package/dist/labels/StartLabel.js +3736 -0
- package/dist/labels/StartLabel.js.map +1 -0
- package/dist/labels/StartLabel.mjs +3729 -0
- package/dist/labels/StartLabel.mjs.map +1 -0
- package/dist/labels/TestConstant.d.mts +17 -0
- package/dist/labels/TestConstant.d.ts +17 -0
- package/dist/labels/TestConstant.js +1872 -0
- package/dist/labels/TestConstant.js.map +1 -0
- package/dist/labels/TestConstant.mjs +1856 -0
- package/dist/labels/TestConstant.mjs.map +1 -0
- package/dist/labels/TickerTestLabel.d.mts +9 -0
- package/dist/labels/TickerTestLabel.d.ts +9 -0
- package/dist/labels/TickerTestLabel.js +2675 -0
- package/dist/labels/TickerTestLabel.js.map +1 -0
- package/dist/labels/TickerTestLabel.mjs +2669 -0
- package/dist/labels/TickerTestLabel.mjs.map +1 -0
- package/dist/labels/index.d.mts +10 -0
- package/dist/labels/index.d.ts +10 -0
- package/dist/labels/index.js +3736 -0
- package/dist/labels/index.js.map +1 -0
- package/dist/labels/index.mjs +3729 -0
- package/dist/labels/index.mjs.map +1 -0
- package/dist/managers/StepManager.d.mts +21 -15
- package/dist/managers/StepManager.d.ts +21 -15
- package/dist/managers/StepManager.js +610 -251
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +610 -251
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/WindowManager.d.mts +38 -24
- package/dist/managers/WindowManager.d.ts +38 -24
- package/dist/managers/WindowManager.js +356 -170
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs +352 -170
- package/dist/managers/WindowManager.mjs.map +1 -1
- package/dist/managers/index.d.mts +15 -14
- package/dist/managers/index.d.ts +15 -14
- package/dist/managers/index.js +612 -251
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +612 -251
- package/dist/managers/index.mjs.map +1 -1
- package/dist/types/CanvasEventNamesType.d.mts +1 -1
- package/dist/types/CanvasEventNamesType.d.ts +1 -1
- package/dist/types/ChoiceMenuOptionsType.d.mts +2 -2
- package/dist/types/ChoiceMenuOptionsType.d.ts +2 -2
- package/dist/types/HistoryChoiceMenuOption.d.mts +22 -0
- package/dist/types/HistoryChoiceMenuOption.d.ts +22 -0
- package/dist/types/HistoryChoiceMenuOption.js +4 -0
- package/dist/types/HistoryChoiceMenuOption.mjs +3 -0
- package/dist/types/PauseType.d.mts +8 -4
- package/dist/types/PauseType.d.ts +8 -4
- package/dist/types/PauseType.js +0 -11
- package/dist/types/PauseType.js.map +1 -1
- package/dist/types/PauseType.mjs +0 -9
- package/dist/types/PauseType.mjs.map +1 -1
- package/dist/types/RepeatType.d.mts +1 -2
- package/dist/types/RepeatType.d.ts +1 -2
- package/dist/types/RepeatType.js +0 -4
- package/dist/types/RepeatType.js.map +1 -1
- package/dist/types/RepeatType.mjs +0 -3
- package/dist/types/RepeatType.mjs.map +1 -1
- package/dist/types/index.d.mts +5 -4
- package/dist/types/index.d.ts +5 -4
- package/dist/types/index.js +0 -15
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +1 -13
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/ticker/{TickerFadeAlphaProps.d.mts → FadeAlphaTickerProps.d.mts} +9 -5
- package/dist/types/ticker/{TickerFadeAlphaProps.d.ts → FadeAlphaTickerProps.d.ts} +9 -5
- package/dist/types/ticker/FadeAlphaTickerProps.js +4 -0
- package/dist/types/ticker/FadeAlphaTickerProps.js.map +1 -0
- package/dist/types/ticker/FadeAlphaTickerProps.mjs +3 -0
- package/dist/types/ticker/FadeAlphaTickerProps.mjs.map +1 -0
- package/dist/types/ticker/{TickerMoveProps.d.mts → MoveTickerProps.d.mts} +14 -5
- package/dist/types/ticker/{TickerMoveProps.d.ts → MoveTickerProps.d.ts} +14 -5
- package/dist/types/ticker/{TickerRotateProps.js → MoveTickerProps.js} +1 -1
- package/dist/types/ticker/MoveTickerProps.js.map +1 -0
- package/dist/types/ticker/MoveTickerProps.mjs +3 -0
- package/dist/types/ticker/MoveTickerProps.mjs.map +1 -0
- package/dist/types/ticker/{TickerRotateProps.d.mts → RotateTickerProps.d.mts} +10 -4
- package/dist/types/ticker/{TickerRotateProps.d.ts → RotateTickerProps.d.ts} +10 -4
- package/dist/types/ticker/RotateTickerProps.js +4 -0
- package/dist/types/ticker/RotateTickerProps.js.map +1 -0
- package/dist/types/ticker/RotateTickerProps.mjs +3 -0
- package/dist/types/ticker/RotateTickerProps.mjs.map +1 -0
- package/dist/types/ticker/TagToRemoveAfterType.d.mts +4 -0
- package/dist/types/ticker/TagToRemoveAfterType.d.ts +4 -0
- package/dist/types/ticker/TagToRemoveAfterType.js +8 -0
- package/dist/types/ticker/TagToRemoveAfterType.js.map +1 -0
- package/dist/types/ticker/TagToRemoveAfterType.mjs +6 -0
- package/dist/types/ticker/TagToRemoveAfterType.mjs.map +1 -0
- package/dist/types/ticker/ZoomTickerProps.d.mts +45 -0
- package/dist/types/ticker/ZoomTickerProps.d.ts +45 -0
- package/dist/types/ticker/ZoomTickerProps.js +4 -0
- package/dist/types/ticker/ZoomTickerProps.js.map +1 -0
- package/dist/types/ticker/ZoomTickerProps.mjs +3 -0
- package/dist/types/ticker/ZoomTickerProps.mjs.map +1 -0
- package/dist/types/ticker/index.d.mts +4 -2
- package/dist/types/ticker/index.d.ts +4 -2
- package/package.json +7 -7
- package/dist/classes/ticker/TickerFadeAlpha.d.mts +0 -31
- package/dist/classes/ticker/TickerFadeAlpha.d.ts +0 -31
- package/dist/classes/ticker/TickerFadeAlpha.js.map +0 -1
- package/dist/classes/ticker/TickerFadeAlpha.mjs.map +0 -1
- package/dist/classes/ticker/TickerMove.d.mts +0 -29
- package/dist/classes/ticker/TickerMove.d.ts +0 -29
- package/dist/classes/ticker/TickerMove.js.map +0 -1
- package/dist/classes/ticker/TickerMove.mjs.map +0 -1
- package/dist/classes/ticker/TickerRotate.d.mts +0 -30
- package/dist/classes/ticker/TickerRotate.d.ts +0 -30
- package/dist/classes/ticker/TickerRotate.js.map +0 -1
- package/dist/classes/ticker/TickerRotate.mjs.map +0 -1
- package/dist/functions/ErrorUtility.d.mts +0 -24
- package/dist/functions/ErrorUtility.d.ts +0 -24
- package/dist/functions/ErrorUtility.js +0 -261
- package/dist/functions/ErrorUtility.js.map +0 -1
- package/dist/functions/ErrorUtility.mjs +0 -258
- package/dist/functions/ErrorUtility.mjs.map +0 -1
- package/dist/interface/IClassWithArgsHistory.d.mts +0 -25
- package/dist/interface/IClassWithArgsHistory.d.ts +0 -25
- package/dist/interface/IClassWithArgsHistory.js +0 -4
- package/dist/interface/IClassWithArgsHistory.mjs +0 -3
- package/dist/types/ticker/TickerFadeAlphaProps.js +0 -4
- package/dist/types/ticker/TickerFadeAlphaProps.mjs +0 -3
- package/dist/types/ticker/TickerMoveProps.mjs +0 -3
- package/dist/types/ticker/TickerRotateProps.mjs +0 -3
- /package/dist/interface/{IClassWithArgsHistory.js.map → CharacterBaseModelProps.js.map} +0 -0
- /package/dist/interface/{IClassWithArgsHistory.mjs.map → CharacterBaseModelProps.mjs.map} +0 -0
- /package/dist/{types/ticker/TickerFadeAlphaProps.js.map → interface/TickerHistory.js.map} +0 -0
- /package/dist/{types/ticker/TickerFadeAlphaProps.mjs.map → interface/TickerHistory.mjs.map} +0 -0
- /package/dist/{types/ticker/TickerMoveProps.js.map → interface/TickerTimeoutHistory.js.map} +0 -0
- /package/dist/{types/ticker/TickerMoveProps.mjs.map → interface/TickerTimeoutHistory.mjs.map} +0 -0
- /package/dist/types/{ticker/TickerRotateProps.js.map → HistoryChoiceMenuOption.js.map} +0 -0
- /package/dist/types/{ticker/TickerRotateProps.mjs.map → HistoryChoiceMenuOption.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Container, Sprite, Text, Assets, Texture, Application } from 'pixi.js';
|
|
1
|
+
import { Container, Sprite, Text, Assets, Texture, Application, Rectangle } from 'pixi.js';
|
|
2
2
|
export { Assets } from 'pixi.js';
|
|
3
3
|
import { diff } from 'deep-diff';
|
|
4
4
|
import sha1 from 'crypto-js/sha1';
|
|
@@ -28,8 +28,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
28
28
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
29
29
|
if (decorator = decorators[i])
|
|
30
30
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
31
|
-
if (kind && result)
|
|
32
|
-
__defProp(target, key, result);
|
|
31
|
+
if (kind && result) __defProp(target, key, result);
|
|
33
32
|
return result;
|
|
34
33
|
};
|
|
35
34
|
var __async = (__this, __arguments, generator) => {
|
|
@@ -55,6 +54,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
55
54
|
|
|
56
55
|
// src/classes/CanvasEvent.ts
|
|
57
56
|
var CanvasEvent = class {
|
|
57
|
+
constructor() {
|
|
58
|
+
/**
|
|
59
|
+
* Get the id of the event. This variable is used in the system to get the event by id, {@link getEventInstanceById}
|
|
60
|
+
*/
|
|
61
|
+
this.id = "event_id_not_set";
|
|
62
|
+
this.id = this.constructor.prototype.id;
|
|
63
|
+
}
|
|
58
64
|
fn(_event, _element) {
|
|
59
65
|
throw new Error("[Pixi'VN] The method CanvasEvent.fn() must be overridden");
|
|
60
66
|
}
|
|
@@ -82,7 +88,7 @@ var Label = class {
|
|
|
82
88
|
this._choiseIndex = choiseIndex;
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
85
|
-
* Get the id of the label
|
|
91
|
+
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
86
92
|
*/
|
|
87
93
|
get id() {
|
|
88
94
|
return this._id;
|
|
@@ -144,7 +150,7 @@ function newCloseLabel(choiseIndex) {
|
|
|
144
150
|
var registeredLabels = {};
|
|
145
151
|
function newLabel(id, steps, onStepRun) {
|
|
146
152
|
if (registeredLabels[id]) {
|
|
147
|
-
console.
|
|
153
|
+
console.info(`[Pixi'VN] Label ${id} already exists, it will be overwritten`);
|
|
148
154
|
}
|
|
149
155
|
let label = new Label(id, steps, onStepRun);
|
|
150
156
|
registeredLabels[id] = label;
|
|
@@ -159,6 +165,13 @@ function getLabelById(id) {
|
|
|
159
165
|
return label;
|
|
160
166
|
}
|
|
161
167
|
var CanvasBase = class extends Container {
|
|
168
|
+
constructor() {
|
|
169
|
+
super(...arguments);
|
|
170
|
+
/**
|
|
171
|
+
* Get the id of the canvas element. This variable is used in the system to get the canvas element by id, {@link getCanvasElementInstanceById}
|
|
172
|
+
*/
|
|
173
|
+
this.pixivnId = "canvas_element_id_not_set";
|
|
174
|
+
}
|
|
162
175
|
/**
|
|
163
176
|
* This method return the memory of the canvas element.
|
|
164
177
|
*/
|
|
@@ -185,17 +198,23 @@ function exportCanvasElement(element) {
|
|
|
185
198
|
return element.memory;
|
|
186
199
|
}
|
|
187
200
|
function importCanvasElement(memory) {
|
|
188
|
-
let element =
|
|
201
|
+
let element = getCanvasElementInstanceById(memory.pixivnId);
|
|
189
202
|
if (element) {
|
|
190
203
|
element.memory = memory;
|
|
191
204
|
} else {
|
|
192
|
-
throw new Error("[Pixi'VN] The element " + memory.
|
|
205
|
+
throw new Error("[Pixi'VN] The element " + memory.pixivnId + " could not be created");
|
|
193
206
|
}
|
|
194
207
|
return element;
|
|
195
208
|
}
|
|
196
209
|
|
|
197
210
|
// src/classes/canvas/CanvasContainer.ts
|
|
211
|
+
var CANVAS_CONTAINER_ID = "CanvasContainer";
|
|
198
212
|
var CanvasContainer = class extends Container {
|
|
213
|
+
constructor(options) {
|
|
214
|
+
super(options);
|
|
215
|
+
this.pixivnId = CANVAS_CONTAINER_ID;
|
|
216
|
+
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
217
|
+
}
|
|
199
218
|
get memory() {
|
|
200
219
|
let memory = getMemoryContainer(this);
|
|
201
220
|
this.children.forEach((child) => {
|
|
@@ -211,8 +230,12 @@ var CanvasContainer = class extends Container {
|
|
|
211
230
|
}
|
|
212
231
|
};
|
|
213
232
|
function getMemoryContainer(element) {
|
|
233
|
+
let className = "CanvasContainer";
|
|
234
|
+
if (element.hasOwnProperty("pixivnId")) {
|
|
235
|
+
className = element.pixivnId;
|
|
236
|
+
}
|
|
214
237
|
return {
|
|
215
|
-
|
|
238
|
+
pixivnId: className,
|
|
216
239
|
elements: [],
|
|
217
240
|
width: element.width,
|
|
218
241
|
height: element.height,
|
|
@@ -334,45 +357,49 @@ function eventDecorator(name) {
|
|
|
334
357
|
name = target.name;
|
|
335
358
|
}
|
|
336
359
|
if (registeredEvents[name]) {
|
|
337
|
-
console.
|
|
360
|
+
console.info(`[Pixi'VN] Event ${name} already exists, it will be overwritten`);
|
|
338
361
|
}
|
|
362
|
+
target.prototype.id = name;
|
|
339
363
|
registeredEvents[name] = target;
|
|
340
364
|
};
|
|
341
365
|
}
|
|
342
|
-
function
|
|
366
|
+
function getEventTypeById(eventId) {
|
|
343
367
|
try {
|
|
344
|
-
let eventType = registeredEvents[
|
|
368
|
+
let eventType = registeredEvents[eventId];
|
|
345
369
|
if (!eventType) {
|
|
346
|
-
console.error(`[Pixi'VN] Event ${
|
|
370
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
347
371
|
return;
|
|
348
372
|
}
|
|
349
373
|
new eventType();
|
|
350
374
|
return eventType;
|
|
351
375
|
} catch (e) {
|
|
352
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
376
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
353
377
|
return;
|
|
354
378
|
}
|
|
355
379
|
}
|
|
356
|
-
function
|
|
380
|
+
function getEventInstanceById(eventId) {
|
|
357
381
|
try {
|
|
358
|
-
let eventType = registeredEvents[
|
|
382
|
+
let eventType = registeredEvents[eventId];
|
|
359
383
|
if (!eventType) {
|
|
360
|
-
console.error(`[Pixi'VN] Event ${
|
|
384
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
361
385
|
return;
|
|
362
386
|
}
|
|
363
387
|
let event = new eventType();
|
|
364
388
|
return event;
|
|
365
389
|
} catch (e) {
|
|
366
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
390
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
367
391
|
return;
|
|
368
392
|
}
|
|
369
393
|
}
|
|
370
394
|
|
|
371
395
|
// src/classes/canvas/CanvasSprite.ts
|
|
396
|
+
var CANVAS_SPRITE_ID = "CanvasSprite";
|
|
372
397
|
var CanvasSprite = class _CanvasSprite extends Sprite {
|
|
373
|
-
constructor() {
|
|
374
|
-
super(
|
|
398
|
+
constructor(options) {
|
|
399
|
+
super(options);
|
|
400
|
+
this.pixivnId = CANVAS_SPRITE_ID;
|
|
375
401
|
this._onEvents = {};
|
|
402
|
+
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
376
403
|
}
|
|
377
404
|
get memory() {
|
|
378
405
|
return getMemorySprite(this);
|
|
@@ -413,9 +440,9 @@ var CanvasSprite = class _CanvasSprite extends Sprite {
|
|
|
413
440
|
* ```
|
|
414
441
|
*/
|
|
415
442
|
onEvent(event, eventClass) {
|
|
416
|
-
let
|
|
417
|
-
let instance =
|
|
418
|
-
this._onEvents[event] =
|
|
443
|
+
let id = eventClass.prototype.id;
|
|
444
|
+
let instance = getEventInstanceById(id);
|
|
445
|
+
this._onEvents[event] = id;
|
|
419
446
|
if (instance) {
|
|
420
447
|
super.on(event, () => {
|
|
421
448
|
instance.fn(event, this);
|
|
@@ -444,7 +471,7 @@ var CanvasSprite = class _CanvasSprite extends Sprite {
|
|
|
444
471
|
function getMemorySprite(element) {
|
|
445
472
|
let temp = getMemoryContainer(element);
|
|
446
473
|
return __spreadProps(__spreadValues({}, temp), {
|
|
447
|
-
|
|
474
|
+
pixivnId: element.pixivnId,
|
|
448
475
|
textureImage: getTextureMemory(element.texture),
|
|
449
476
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
450
477
|
roundPixels: element.roundPixels,
|
|
@@ -467,8 +494,8 @@ function setMemorySprite(element, memory) {
|
|
|
467
494
|
}
|
|
468
495
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
469
496
|
for (let event in memory.onEvents) {
|
|
470
|
-
let
|
|
471
|
-
let instance =
|
|
497
|
+
let id = memory.onEvents[event];
|
|
498
|
+
let instance = getEventTypeById(id);
|
|
472
499
|
if (instance) {
|
|
473
500
|
element.onEvent(event, instance);
|
|
474
501
|
}
|
|
@@ -476,9 +503,11 @@ function setMemorySprite(element, memory) {
|
|
|
476
503
|
}
|
|
477
504
|
|
|
478
505
|
// src/classes/canvas/CanvasImage.ts
|
|
506
|
+
var CANVAS_IMAGE_ID = "CanvasImage";
|
|
479
507
|
var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
480
508
|
constructor(options, imageLink) {
|
|
481
509
|
super(options);
|
|
510
|
+
this.pixivnId = CANVAS_IMAGE_ID;
|
|
482
511
|
this.imageLink = "";
|
|
483
512
|
if (imageLink) {
|
|
484
513
|
this.imageLink = imageLink;
|
|
@@ -486,12 +515,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
486
515
|
}
|
|
487
516
|
get memory() {
|
|
488
517
|
return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
|
|
489
|
-
|
|
490
|
-
|
|
518
|
+
pixivnId: this.pixivnId,
|
|
519
|
+
imageLink: this.imageLink
|
|
491
520
|
});
|
|
492
521
|
}
|
|
493
522
|
set memory(memory) {
|
|
494
523
|
setMemorySprite(this, memory);
|
|
524
|
+
this.imageLink = memory.imageLink;
|
|
495
525
|
}
|
|
496
526
|
static from(source, skipCache) {
|
|
497
527
|
let sprite = Sprite.from(source, skipCache);
|
|
@@ -519,10 +549,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
519
549
|
});
|
|
520
550
|
}
|
|
521
551
|
};
|
|
552
|
+
var CANVAS_TEXT_ID = "CanvasText";
|
|
522
553
|
var CanvasText = class extends Text {
|
|
523
|
-
constructor() {
|
|
524
|
-
super(
|
|
554
|
+
constructor(options) {
|
|
555
|
+
super(options);
|
|
556
|
+
this.pixivnId = CANVAS_TEXT_ID;
|
|
525
557
|
this._onEvents = {};
|
|
558
|
+
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
526
559
|
}
|
|
527
560
|
get memory() {
|
|
528
561
|
return getMemoryText(this);
|
|
@@ -563,9 +596,9 @@ var CanvasText = class extends Text {
|
|
|
563
596
|
* ```
|
|
564
597
|
*/
|
|
565
598
|
onEvent(event, eventClass) {
|
|
566
|
-
let
|
|
567
|
-
let instance =
|
|
568
|
-
this._onEvents[event] =
|
|
599
|
+
let id = eventClass.prototype.id;
|
|
600
|
+
let instance = getEventInstanceById(id);
|
|
601
|
+
this._onEvents[event] = id;
|
|
569
602
|
if (instance) {
|
|
570
603
|
super.on(event, () => {
|
|
571
604
|
instance.fn(event, this);
|
|
@@ -588,7 +621,7 @@ var CanvasText = class extends Text {
|
|
|
588
621
|
function getMemoryText(element) {
|
|
589
622
|
let temp = getMemoryContainer(element);
|
|
590
623
|
return __spreadProps(__spreadValues({}, temp), {
|
|
591
|
-
|
|
624
|
+
pixivnId: element.pixivnId,
|
|
592
625
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
593
626
|
text: element.text,
|
|
594
627
|
resolution: element.resolution,
|
|
@@ -611,8 +644,8 @@ function setMemoryText(element, memory) {
|
|
|
611
644
|
memory.style && (element.style = memory.style);
|
|
612
645
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
613
646
|
for (let event in memory.onEvents) {
|
|
614
|
-
let
|
|
615
|
-
let instance =
|
|
647
|
+
let id = memory.onEvents[event];
|
|
648
|
+
let instance = getEventTypeById(id);
|
|
616
649
|
if (instance) {
|
|
617
650
|
element.onEvent(event, instance);
|
|
618
651
|
}
|
|
@@ -629,31 +662,32 @@ function canvasElementDecorator(name) {
|
|
|
629
662
|
if (registeredCanvasElement[name]) {
|
|
630
663
|
console.warn(`[Pixi'VN] CanvasElement ${name} already registered`);
|
|
631
664
|
}
|
|
665
|
+
target.prototype.pixivnId = name;
|
|
632
666
|
registeredCanvasElement[name] = target;
|
|
633
667
|
};
|
|
634
668
|
}
|
|
635
|
-
function
|
|
669
|
+
function getCanvasElementInstanceById(canvasId) {
|
|
636
670
|
try {
|
|
637
|
-
let eventType = registeredCanvasElement[
|
|
671
|
+
let eventType = registeredCanvasElement[canvasId];
|
|
638
672
|
if (!eventType) {
|
|
639
|
-
if (
|
|
673
|
+
if (canvasId === CANVAS_CONTAINER_ID) {
|
|
640
674
|
eventType = CanvasContainer;
|
|
641
|
-
} else if (
|
|
675
|
+
} else if (canvasId === CANVAS_IMAGE_ID) {
|
|
642
676
|
eventType = CanvasImage;
|
|
643
|
-
} else if (
|
|
677
|
+
} else if (canvasId === CANVAS_SPRITE_ID) {
|
|
644
678
|
eventType = CanvasSprite;
|
|
645
|
-
} else if (
|
|
679
|
+
} else if (canvasId === CANVAS_TEXT_ID) {
|
|
646
680
|
eventType = CanvasText;
|
|
647
681
|
}
|
|
648
682
|
}
|
|
649
683
|
if (!eventType) {
|
|
650
|
-
console.error(`[Pixi'VN] CanvasElement ${
|
|
684
|
+
console.error(`[Pixi'VN] CanvasElement ${canvasId} not found`);
|
|
651
685
|
return;
|
|
652
686
|
}
|
|
653
687
|
let canvasElement = new eventType();
|
|
654
688
|
return canvasElement;
|
|
655
689
|
} catch (e) {
|
|
656
|
-
console.error(`[Pixi'VN] Error while getting CanvasElement ${
|
|
690
|
+
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasId}`, e);
|
|
657
691
|
return;
|
|
658
692
|
}
|
|
659
693
|
}
|
|
@@ -666,7 +700,7 @@ function saveCharacter(character) {
|
|
|
666
700
|
return;
|
|
667
701
|
}
|
|
668
702
|
if (registeredCharacters[character.id]) {
|
|
669
|
-
console.
|
|
703
|
+
console.info(`[Pixi'VN] Character id ${character.id} already exists, it will be overwritten`);
|
|
670
704
|
}
|
|
671
705
|
registeredCharacters[character.id] = character;
|
|
672
706
|
}
|
|
@@ -695,21 +729,22 @@ function tickerDecorator(name) {
|
|
|
695
729
|
name = target.name;
|
|
696
730
|
}
|
|
697
731
|
if (registeredTickers[name]) {
|
|
698
|
-
console.
|
|
732
|
+
console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`);
|
|
699
733
|
}
|
|
734
|
+
target.prototype.id = name;
|
|
700
735
|
registeredTickers[name] = target;
|
|
701
736
|
};
|
|
702
737
|
}
|
|
703
|
-
function
|
|
738
|
+
function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
704
739
|
try {
|
|
705
|
-
let ticker = registeredTickers[
|
|
740
|
+
let ticker = registeredTickers[tickerId];
|
|
706
741
|
if (!ticker) {
|
|
707
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
742
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
708
743
|
return;
|
|
709
744
|
}
|
|
710
745
|
return new ticker(args, duration, priority);
|
|
711
746
|
} catch (e) {
|
|
712
|
-
console.error(`[Pixi'VN] Error while getting Ticker ${
|
|
747
|
+
console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e);
|
|
713
748
|
return;
|
|
714
749
|
}
|
|
715
750
|
}
|
|
@@ -717,18 +752,6 @@ function geTickerInstanceByClassName(tickerName, args, duration, priority) {
|
|
|
717
752
|
// src/types/CloseType.ts
|
|
718
753
|
var Close = "close";
|
|
719
754
|
|
|
720
|
-
// src/types/PauseType.ts
|
|
721
|
-
var PauseValueType = "pause";
|
|
722
|
-
function Pause(duration) {
|
|
723
|
-
return {
|
|
724
|
-
type: PauseValueType,
|
|
725
|
-
duration
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
// src/types/RepeatType.ts
|
|
730
|
-
var Repeat = "repeat";
|
|
731
|
-
|
|
732
755
|
// src/classes/ChoiceMenuOption.ts
|
|
733
756
|
var ChoiceMenuOption = class {
|
|
734
757
|
/**
|
|
@@ -761,8 +784,9 @@ var ChoiceMenuOption = class {
|
|
|
761
784
|
var ChoiceMenuOptionClose = class {
|
|
762
785
|
/**
|
|
763
786
|
* @param text Text to be displayed in the menu
|
|
787
|
+
* @param closeCurrentLabel If true, the current label will be closed. @default false
|
|
764
788
|
*/
|
|
765
|
-
constructor(text) {
|
|
789
|
+
constructor(text, closeCurrentLabel = false) {
|
|
766
790
|
/**
|
|
767
791
|
* Label to be opened when the option is selected
|
|
768
792
|
*/
|
|
@@ -776,27 +800,28 @@ var ChoiceMenuOptionClose = class {
|
|
|
776
800
|
*/
|
|
777
801
|
this.props = {};
|
|
778
802
|
this.text = text;
|
|
803
|
+
this.closeCurrentLabel = closeCurrentLabel;
|
|
779
804
|
}
|
|
780
805
|
};
|
|
781
806
|
|
|
782
807
|
// src/functions/DialogueUtility.ts
|
|
783
808
|
function setDialogue(props) {
|
|
784
809
|
let text = "";
|
|
785
|
-
let
|
|
810
|
+
let character = void 0;
|
|
786
811
|
let dialogue;
|
|
787
812
|
if (typeof props === "string") {
|
|
788
813
|
text = props;
|
|
789
|
-
dialogue = new DialogueBaseModel(text,
|
|
814
|
+
dialogue = new DialogueBaseModel(text, character);
|
|
790
815
|
} else if (!(props instanceof DialogueBaseModel)) {
|
|
791
816
|
text = props.text;
|
|
792
817
|
if (props.character) {
|
|
793
818
|
if (typeof props.character === "string") {
|
|
794
|
-
|
|
819
|
+
character = props.character;
|
|
795
820
|
} else {
|
|
796
|
-
|
|
821
|
+
character = props.character.id;
|
|
797
822
|
}
|
|
798
823
|
}
|
|
799
|
-
dialogue = new DialogueBaseModel(text,
|
|
824
|
+
dialogue = new DialogueBaseModel(text, character);
|
|
800
825
|
} else {
|
|
801
826
|
dialogue = props;
|
|
802
827
|
}
|
|
@@ -814,7 +839,8 @@ function setChoiceMenuOptions(options) {
|
|
|
814
839
|
if (option instanceof ChoiceMenuOptionClose) {
|
|
815
840
|
return {
|
|
816
841
|
text: option.text,
|
|
817
|
-
type: Close
|
|
842
|
+
type: Close,
|
|
843
|
+
closeCurrentLabel: option.closeCurrentLabel
|
|
818
844
|
};
|
|
819
845
|
}
|
|
820
846
|
return __spreadProps(__spreadValues({}, option), {
|
|
@@ -835,6 +861,7 @@ function getChoiceMenuOptions() {
|
|
|
835
861
|
text: option.text,
|
|
836
862
|
label: itemLabel,
|
|
837
863
|
type: Close,
|
|
864
|
+
closeCurrentLabel: option.closeCurrentLabel,
|
|
838
865
|
props: {}
|
|
839
866
|
});
|
|
840
867
|
return;
|
|
@@ -921,39 +948,42 @@ function clearAllGameDatas() {
|
|
|
921
948
|
var TickerBase = class {
|
|
922
949
|
/**
|
|
923
950
|
* @param args The arguments that you want to pass to the ticker.
|
|
924
|
-
* @param duration The duration of the ticker. If is undefined, the
|
|
925
|
-
* @param priority The priority of the ticker.
|
|
951
|
+
* @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
|
|
952
|
+
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
926
953
|
*/
|
|
927
954
|
constructor(args, duration, priority) {
|
|
955
|
+
/**
|
|
956
|
+
* Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}
|
|
957
|
+
*/
|
|
958
|
+
this.id = "ticker_id_not_set";
|
|
928
959
|
this.args = args;
|
|
929
960
|
this.duration = duration;
|
|
930
961
|
this.priority = priority;
|
|
962
|
+
this.id = this.constructor.prototype.id;
|
|
931
963
|
}
|
|
932
964
|
/**
|
|
933
965
|
* The method that will be called every frame.
|
|
934
966
|
* This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
|
|
935
|
-
* @param
|
|
936
|
-
* @param
|
|
937
|
-
* @param
|
|
967
|
+
* @param _ticker The ticker that is calling this method
|
|
968
|
+
* @param _args The arguments that you passed when you added the ticker
|
|
969
|
+
* @param _tags The tags of the canvas elements that are connected to this ticker
|
|
970
|
+
* @param _tickerId The id of the ticker. You can use this to get the ticker from the {@link GameWindowManager.currentTickers}
|
|
938
971
|
*/
|
|
939
|
-
fn(
|
|
972
|
+
fn(_ticker, _args, _tags, _tickerId) {
|
|
940
973
|
throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
|
|
941
974
|
}
|
|
942
975
|
};
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
* @param args The arguments that are passed to the ticker
|
|
948
|
-
* @param tags The tags of the canvas element that are connected to this ticker
|
|
949
|
-
*/
|
|
950
|
-
fn(t, args, tags) {
|
|
976
|
+
|
|
977
|
+
// src/classes/ticker/FadeAlphaTicker.ts
|
|
978
|
+
var FadeAlphaTicker = class extends TickerBase {
|
|
979
|
+
fn(ticker, args, tags, tickerId) {
|
|
951
980
|
let type = args.type === void 0 ? "hide" : args.type;
|
|
952
|
-
let
|
|
981
|
+
let duration = args.duration === void 0 ? 1 : args.duration;
|
|
982
|
+
let speed = 1 / (duration * 60);
|
|
953
983
|
let limit = args.limit === void 0 ? type === "hide" ? 0 : 1 : args.limit;
|
|
954
|
-
let
|
|
955
|
-
if (typeof
|
|
956
|
-
|
|
984
|
+
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
985
|
+
if (typeof tagToRemoveAfter2 === "string") {
|
|
986
|
+
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
957
987
|
}
|
|
958
988
|
if (type === "hide" && limit < 0) {
|
|
959
989
|
limit = 0;
|
|
@@ -974,61 +1004,88 @@ var TickerFadeAlpha = class extends TickerBase {
|
|
|
974
1004
|
let element = GameWindowManager.getCanvasElement(tag);
|
|
975
1005
|
if (element && element instanceof Container) {
|
|
976
1006
|
if (type === "show" && element.alpha < limit) {
|
|
977
|
-
element.alpha += speed *
|
|
1007
|
+
element.alpha += speed * ticker.deltaTime;
|
|
978
1008
|
} else if (type === "hide" && element.alpha > limit) {
|
|
979
|
-
element.alpha -= speed *
|
|
980
|
-
}
|
|
1009
|
+
element.alpha -= speed * ticker.deltaTime;
|
|
1010
|
+
}
|
|
1011
|
+
if (type === "show" && element.alpha >= limit) {
|
|
1012
|
+
element.alpha = limit;
|
|
1013
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
1014
|
+
} else if (type === "hide" && element.alpha <= limit) {
|
|
981
1015
|
element.alpha = limit;
|
|
982
|
-
GameWindowManager.
|
|
983
|
-
GameWindowManager.removeCanvasElement(removeElementAfter);
|
|
1016
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
984
1017
|
}
|
|
985
1018
|
}
|
|
986
1019
|
});
|
|
987
1020
|
}
|
|
988
1021
|
};
|
|
989
|
-
|
|
1022
|
+
FadeAlphaTicker = __decorateClass([
|
|
990
1023
|
tickerDecorator()
|
|
991
|
-
],
|
|
1024
|
+
], FadeAlphaTicker);
|
|
992
1025
|
|
|
993
1026
|
// src/functions/TickerUtility.ts
|
|
994
1027
|
function updateTickerProgression(args, propertyName, progression) {
|
|
995
|
-
if (args
|
|
1028
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === progression.limit) {
|
|
996
1029
|
return;
|
|
997
1030
|
}
|
|
998
|
-
if (
|
|
1031
|
+
if (typeof args[propertyName] === "number") {
|
|
999
1032
|
if (progression.type === "linear") {
|
|
1000
|
-
args[propertyName]
|
|
1001
|
-
if (progression.limit !== void 0) {
|
|
1002
|
-
if (args[propertyName] > progression.limit && progression.amt > 0) {
|
|
1003
|
-
args[propertyName] = progression.limit;
|
|
1004
|
-
} else if (args[propertyName] < progression.limit && progression.amt < 0) {
|
|
1005
|
-
args[propertyName] = progression.limit;
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1033
|
+
args[propertyName] = getLinearProgression(args[propertyName], progression);
|
|
1008
1034
|
} else if (progression.type === "exponential") {
|
|
1009
|
-
args[propertyName]
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1035
|
+
args[propertyName] = getExponentialProgression(args[propertyName], progression);
|
|
1036
|
+
}
|
|
1037
|
+
} 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") {
|
|
1038
|
+
if (progression.type === "linear") {
|
|
1039
|
+
args[propertyName].x = getLinearProgression(args[propertyName].x, progression);
|
|
1040
|
+
args[propertyName].y = getLinearProgression(args[propertyName].y, progression);
|
|
1041
|
+
} else if (progression.type === "exponential") {
|
|
1042
|
+
args[propertyName].x = getExponentialProgression(args[propertyName].x, progression);
|
|
1043
|
+
args[propertyName].y = getExponentialProgression(args[propertyName].y, progression);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
function getLinearProgression(number, progression) {
|
|
1048
|
+
if (progression.limit !== void 0) {
|
|
1049
|
+
if (number > progression.limit && progression.amt > 0) {
|
|
1050
|
+
return progression.limit;
|
|
1051
|
+
} else if (number < progression.limit && progression.amt < 0) {
|
|
1052
|
+
return progression.limit;
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
return number + progression.amt / 60;
|
|
1056
|
+
}
|
|
1057
|
+
function getExponentialProgression(number, progression) {
|
|
1058
|
+
if (progression.limit !== void 0) {
|
|
1059
|
+
if (number > progression.limit && progression.percentage > 0) {
|
|
1060
|
+
return progression.limit;
|
|
1061
|
+
} else if (number < progression.limit && progression.percentage < 0) {
|
|
1062
|
+
return progression.limit;
|
|
1017
1063
|
}
|
|
1018
1064
|
}
|
|
1065
|
+
return number + number * progression.percentage;
|
|
1019
1066
|
}
|
|
1020
1067
|
|
|
1021
|
-
// src/classes/ticker/
|
|
1022
|
-
var
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1068
|
+
// src/classes/ticker/MoveTicker.ts
|
|
1069
|
+
var MoveTicker = class extends TickerBase {
|
|
1070
|
+
fn(ticker, args, tags, tickerId) {
|
|
1071
|
+
let xSpeed = 1;
|
|
1072
|
+
let ySpeed = 1;
|
|
1073
|
+
if (args.speed) {
|
|
1074
|
+
if (typeof args.speed === "number") {
|
|
1075
|
+
xSpeed = args.speed;
|
|
1076
|
+
ySpeed = args.speed;
|
|
1077
|
+
} else {
|
|
1078
|
+
xSpeed = args.speed.x;
|
|
1079
|
+
ySpeed = args.speed.y;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
xSpeed /= 60;
|
|
1083
|
+
ySpeed /= 60;
|
|
1031
1084
|
let destination = args.destination;
|
|
1085
|
+
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
1086
|
+
if (typeof tagToRemoveAfter2 === "string") {
|
|
1087
|
+
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
1088
|
+
}
|
|
1032
1089
|
tags.filter((tag) => {
|
|
1033
1090
|
var _a;
|
|
1034
1091
|
let element = GameWindowManager.getCanvasElement(tag);
|
|
@@ -1041,41 +1098,42 @@ var TickerMove = class extends TickerBase {
|
|
|
1041
1098
|
}).forEach((tag) => {
|
|
1042
1099
|
let element = GameWindowManager.getCanvasElement(tag);
|
|
1043
1100
|
if (element && element instanceof Container) {
|
|
1044
|
-
let xDistance = destination.x - element.x;
|
|
1101
|
+
let xDistance = destination.x - element.x > 0 ? 1 : -1;
|
|
1045
1102
|
if (xDistance != 0) {
|
|
1046
|
-
element.x += xDistance
|
|
1103
|
+
element.x += xDistance * xSpeed * ticker.deltaTime;
|
|
1047
1104
|
let newDistance = destination.x - element.x;
|
|
1048
1105
|
if (xDistance < 0 && newDistance > 0 || xDistance > 0 && newDistance < 0) {
|
|
1049
1106
|
element.x = destination.x;
|
|
1050
1107
|
}
|
|
1051
1108
|
}
|
|
1052
|
-
let yDistance = destination.y - element.y;
|
|
1109
|
+
let yDistance = destination.y - element.y > 0 ? 1 : -1;
|
|
1053
1110
|
if (yDistance != 0) {
|
|
1054
|
-
element.y += yDistance
|
|
1111
|
+
element.y += yDistance * ySpeed * ticker.deltaTime;
|
|
1055
1112
|
let newDistance = destination.y - element.y;
|
|
1056
1113
|
if (yDistance < 0 && newDistance > 0 || yDistance > 0 && newDistance < 0) {
|
|
1057
1114
|
element.y = destination.y;
|
|
1058
1115
|
}
|
|
1059
1116
|
}
|
|
1117
|
+
if (element.x == destination.x && element.y == destination.y) {
|
|
1118
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
1119
|
+
}
|
|
1060
1120
|
}
|
|
1061
1121
|
});
|
|
1062
1122
|
if (args.speedProgression)
|
|
1063
1123
|
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1064
1124
|
}
|
|
1065
1125
|
};
|
|
1066
|
-
|
|
1126
|
+
MoveTicker = __decorateClass([
|
|
1067
1127
|
tickerDecorator()
|
|
1068
|
-
],
|
|
1069
|
-
var
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
* @param delta The delta time
|
|
1073
|
-
* @param args The arguments that are passed to the ticker
|
|
1074
|
-
* @param tags The tags of the canvas element that are connected to this ticker
|
|
1075
|
-
*/
|
|
1076
|
-
fn(t, args, tags) {
|
|
1077
|
-
let speed = args.speed === void 0 ? 0.1 : args.speed;
|
|
1128
|
+
], MoveTicker);
|
|
1129
|
+
var RotateTicker = class extends TickerBase {
|
|
1130
|
+
fn(ticker, args, tags, tickerId) {
|
|
1131
|
+
let speed = (args.speed === void 0 ? 1 : args.speed) / 60;
|
|
1078
1132
|
let clockwise = args.clockwise === void 0 ? true : args.clockwise;
|
|
1133
|
+
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
1134
|
+
if (typeof tagToRemoveAfter2 === "string") {
|
|
1135
|
+
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
1136
|
+
}
|
|
1079
1137
|
tags.filter((tag) => {
|
|
1080
1138
|
var _a;
|
|
1081
1139
|
let element = GameWindowManager.getCanvasElement(tag);
|
|
@@ -1089,18 +1147,133 @@ var TickerRotate = class extends TickerBase {
|
|
|
1089
1147
|
let element = GameWindowManager.getCanvasElement(tag);
|
|
1090
1148
|
if (element && element instanceof Container) {
|
|
1091
1149
|
if (clockwise)
|
|
1092
|
-
element.rotation += speed *
|
|
1150
|
+
element.rotation += speed * ticker.deltaTime;
|
|
1093
1151
|
else
|
|
1094
|
-
element.rotation -= speed *
|
|
1152
|
+
element.rotation -= speed * ticker.deltaTime;
|
|
1153
|
+
if (speed < 1e-5 && !(args.speedProgression && args.speedProgression.type == "linear" && args.speedProgression.amt != 0)) {
|
|
1154
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
1155
|
+
}
|
|
1095
1156
|
}
|
|
1096
1157
|
});
|
|
1097
1158
|
if (args.speedProgression)
|
|
1098
1159
|
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1099
1160
|
}
|
|
1100
1161
|
};
|
|
1101
|
-
|
|
1162
|
+
RotateTicker = __decorateClass([
|
|
1102
1163
|
tickerDecorator()
|
|
1103
|
-
],
|
|
1164
|
+
], RotateTicker);
|
|
1165
|
+
var ZoomTicker = class extends TickerBase {
|
|
1166
|
+
fn(ticker, args, tags, tickerId) {
|
|
1167
|
+
let xSpeed = 0.1;
|
|
1168
|
+
let ySpeed = 0.1;
|
|
1169
|
+
if (args.speed) {
|
|
1170
|
+
if (typeof args.speed === "number") {
|
|
1171
|
+
xSpeed = args.speed;
|
|
1172
|
+
ySpeed = args.speed;
|
|
1173
|
+
} else {
|
|
1174
|
+
xSpeed = args.speed.x;
|
|
1175
|
+
ySpeed = args.speed.y;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
xSpeed /= 60;
|
|
1179
|
+
ySpeed /= 60;
|
|
1180
|
+
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
1181
|
+
if (typeof tagToRemoveAfter2 === "string") {
|
|
1182
|
+
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
1183
|
+
}
|
|
1184
|
+
let type = args.type || "zoom";
|
|
1185
|
+
let xLimit = type === "zoom" ? Infinity : 0;
|
|
1186
|
+
let yLimit = type === "zoom" ? Infinity : 0;
|
|
1187
|
+
if (args.limit) {
|
|
1188
|
+
if (typeof args.limit === "number") {
|
|
1189
|
+
xLimit = args.limit;
|
|
1190
|
+
yLimit = args.limit;
|
|
1191
|
+
} else {
|
|
1192
|
+
xLimit = args.limit.x;
|
|
1193
|
+
yLimit = args.limit.y;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
tags.filter((tag) => {
|
|
1197
|
+
var _a;
|
|
1198
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
1199
|
+
if (args.startOnlyIfHaveTexture) {
|
|
1200
|
+
if (element && element instanceof Sprite && ((_a = element.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1201
|
+
return false;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
return true;
|
|
1205
|
+
}).forEach((tag) => {
|
|
1206
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
1207
|
+
if (element && element instanceof Container) {
|
|
1208
|
+
if (type === "zoom" && (element.scale.x < xLimit || element.scale.y < yLimit)) {
|
|
1209
|
+
element.scale.x += xSpeed * ticker.deltaTime;
|
|
1210
|
+
element.scale.y += ySpeed * ticker.deltaTime;
|
|
1211
|
+
} else if (type === "unzoom" && (element.scale.x > xLimit || element.scale.y > yLimit)) {
|
|
1212
|
+
element.scale.x -= xSpeed * ticker.deltaTime;
|
|
1213
|
+
element.scale.y -= ySpeed * ticker.deltaTime;
|
|
1214
|
+
}
|
|
1215
|
+
if (type === "zoom") {
|
|
1216
|
+
if (element.scale.x > xLimit) {
|
|
1217
|
+
element.scale.x = xLimit;
|
|
1218
|
+
}
|
|
1219
|
+
if (element.scale.y > yLimit) {
|
|
1220
|
+
element.scale.y = yLimit;
|
|
1221
|
+
}
|
|
1222
|
+
if (element.scale.x >= xLimit && element.scale.y >= yLimit) {
|
|
1223
|
+
element.scale.x = xLimit;
|
|
1224
|
+
element.scale.y = yLimit;
|
|
1225
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
1226
|
+
}
|
|
1227
|
+
} else if (type === "unzoom") {
|
|
1228
|
+
if (element.scale.x < xLimit) {
|
|
1229
|
+
element.scale.x = xLimit;
|
|
1230
|
+
}
|
|
1231
|
+
if (element.scale.y < yLimit) {
|
|
1232
|
+
element.scale.y = yLimit;
|
|
1233
|
+
}
|
|
1234
|
+
if (element.scale.x <= xLimit && element.scale.y <= yLimit) {
|
|
1235
|
+
element.scale.x = xLimit;
|
|
1236
|
+
element.scale.y = yLimit;
|
|
1237
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
if (xSpeed < 1e-5 && ySpeed < 1e-5 && !(args.speedProgression && args.speedProgression.type == "linear" && args.speedProgression.amt != 0)) {
|
|
1241
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
});
|
|
1245
|
+
if (args.speedProgression)
|
|
1246
|
+
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1247
|
+
}
|
|
1248
|
+
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
1249
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
1250
|
+
}
|
|
1251
|
+
};
|
|
1252
|
+
ZoomTicker = __decorateClass([
|
|
1253
|
+
tickerDecorator()
|
|
1254
|
+
], ZoomTicker);
|
|
1255
|
+
var ZoomInOutTicker = class extends ZoomTicker {
|
|
1256
|
+
constructor(props, duration, priority) {
|
|
1257
|
+
super(props, duration, priority);
|
|
1258
|
+
}
|
|
1259
|
+
onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2) {
|
|
1260
|
+
if (element.children.length > 0) {
|
|
1261
|
+
let elementChild = element.children[0];
|
|
1262
|
+
GameWindowManager.addCanvasElement(tag, elementChild);
|
|
1263
|
+
}
|
|
1264
|
+
super.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
1265
|
+
}
|
|
1266
|
+
};
|
|
1267
|
+
|
|
1268
|
+
// src/constants.ts
|
|
1269
|
+
var PIXIVN_VERSION = "0.6.2";
|
|
1270
|
+
var Repeat = "repeat";
|
|
1271
|
+
function Pause(duration) {
|
|
1272
|
+
return {
|
|
1273
|
+
type: "pause",
|
|
1274
|
+
duration
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1104
1277
|
|
|
1105
1278
|
// src/functions/ImageUtility.ts
|
|
1106
1279
|
function addImage(tag, imageUrl) {
|
|
@@ -1109,7 +1282,7 @@ function addImage(tag, imageUrl) {
|
|
|
1109
1282
|
GameWindowManager.addCanvasElement(tag, image);
|
|
1110
1283
|
return image;
|
|
1111
1284
|
}
|
|
1112
|
-
function
|
|
1285
|
+
function loadImage(canvasImages) {
|
|
1113
1286
|
return __async(this, null, function* () {
|
|
1114
1287
|
if (!Array.isArray(canvasImages)) {
|
|
1115
1288
|
return [canvasImages];
|
|
@@ -1130,39 +1303,233 @@ function loadImages(canvasImages) {
|
|
|
1130
1303
|
});
|
|
1131
1304
|
});
|
|
1132
1305
|
}
|
|
1306
|
+
function showImage(tag, imageUrl) {
|
|
1307
|
+
return __async(this, null, function* () {
|
|
1308
|
+
let image = addImage(tag, imageUrl);
|
|
1309
|
+
yield image.load();
|
|
1310
|
+
return image;
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1133
1313
|
function removeCanvasElement(tag) {
|
|
1134
1314
|
GameWindowManager.removeCanvasElement(tag);
|
|
1135
1315
|
}
|
|
1136
|
-
function showWithDissolveTransition(
|
|
1137
|
-
return __async(this,
|
|
1138
|
-
|
|
1316
|
+
function showWithDissolveTransition(_0, _1) {
|
|
1317
|
+
return __async(this, arguments, function* (tag, image, props = {}, priority) {
|
|
1318
|
+
var _a;
|
|
1319
|
+
let oldCanvasTag = void 0;
|
|
1139
1320
|
if (GameWindowManager.getCanvasElement(tag)) {
|
|
1140
|
-
|
|
1141
|
-
GameWindowManager.
|
|
1321
|
+
oldCanvasTag = tag + "_temp_disolve";
|
|
1322
|
+
GameWindowManager.editCanvasElementTag(tag, oldCanvasTag);
|
|
1142
1323
|
}
|
|
1143
1324
|
let canvasElement;
|
|
1144
1325
|
if (typeof image === "string") {
|
|
1145
1326
|
canvasElement = addImage(tag, image);
|
|
1146
1327
|
} else {
|
|
1147
1328
|
canvasElement = image;
|
|
1329
|
+
GameWindowManager.addCanvasElement(tag, canvasElement);
|
|
1330
|
+
}
|
|
1331
|
+
if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1332
|
+
yield canvasElement.load();
|
|
1148
1333
|
}
|
|
1149
1334
|
canvasElement.alpha = 0;
|
|
1150
|
-
let effect = new
|
|
1151
|
-
speed,
|
|
1335
|
+
let effect = new FadeAlphaTicker(__spreadProps(__spreadValues({}, props), {
|
|
1152
1336
|
type: "show",
|
|
1153
|
-
tagToRemoveAfter:
|
|
1337
|
+
tagToRemoveAfter: oldCanvasTag,
|
|
1154
1338
|
startOnlyIfHaveTexture: true
|
|
1155
|
-
},
|
|
1339
|
+
}), 10, priority);
|
|
1156
1340
|
GameWindowManager.addTicker(tag, effect);
|
|
1157
|
-
|
|
1158
|
-
|
|
1341
|
+
return;
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
function removeWithDissolveTransition(tag, props = {}, priority) {
|
|
1345
|
+
if (typeof tag === "string") {
|
|
1346
|
+
tag = [tag];
|
|
1347
|
+
}
|
|
1348
|
+
let effect = new FadeAlphaTicker(__spreadProps(__spreadValues({}, props), {
|
|
1349
|
+
type: "hide",
|
|
1350
|
+
tagToRemoveAfter: tag,
|
|
1351
|
+
startOnlyIfHaveTexture: true
|
|
1352
|
+
}), 10, priority);
|
|
1353
|
+
GameWindowManager.addTicker(tag, effect);
|
|
1354
|
+
}
|
|
1355
|
+
function showWithFadeTransition(_0, _1) {
|
|
1356
|
+
return __async(this, arguments, function* (tag, image, props = {}, priority) {
|
|
1357
|
+
var _a;
|
|
1358
|
+
if (!GameWindowManager.getCanvasElement(tag)) {
|
|
1359
|
+
return showWithDissolveTransition(tag, image, props, priority);
|
|
1360
|
+
}
|
|
1361
|
+
let oldCanvasTag = tag + "_temp_fade";
|
|
1362
|
+
GameWindowManager.editCanvasElementTag(tag, oldCanvasTag);
|
|
1363
|
+
let canvasElement;
|
|
1364
|
+
if (typeof image === "string") {
|
|
1365
|
+
canvasElement = addImage(tag, image);
|
|
1366
|
+
} else {
|
|
1367
|
+
canvasElement = image;
|
|
1368
|
+
GameWindowManager.addCanvasElement(tag, canvasElement);
|
|
1159
1369
|
}
|
|
1370
|
+
if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1371
|
+
yield canvasElement.load();
|
|
1372
|
+
}
|
|
1373
|
+
canvasElement.alpha = 0;
|
|
1374
|
+
GameWindowManager.addTickersSteps(oldCanvasTag, [
|
|
1375
|
+
new FadeAlphaTicker(__spreadProps(__spreadValues({}, props), {
|
|
1376
|
+
type: "hide",
|
|
1377
|
+
startOnlyIfHaveTexture: true
|
|
1378
|
+
}))
|
|
1379
|
+
]);
|
|
1380
|
+
GameWindowManager.addTickersSteps(tag, [
|
|
1381
|
+
Pause(props.duration || 1),
|
|
1382
|
+
new FadeAlphaTicker(__spreadProps(__spreadValues({}, props), {
|
|
1383
|
+
type: "show",
|
|
1384
|
+
startOnlyIfHaveTexture: true
|
|
1385
|
+
}))
|
|
1386
|
+
]);
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1389
|
+
function removeWithFadeTransition(tag, props = {}, priority) {
|
|
1390
|
+
return removeWithDissolveTransition(tag, props, priority);
|
|
1391
|
+
}
|
|
1392
|
+
function moveIn(_0, _1) {
|
|
1393
|
+
return __async(this, arguments, function* (tag, image, props = { direction: "right" }, priority) {
|
|
1394
|
+
var _a;
|
|
1395
|
+
let canvasElement;
|
|
1396
|
+
if (typeof image === "string") {
|
|
1397
|
+
canvasElement = addImage(tag, image);
|
|
1398
|
+
} else {
|
|
1399
|
+
canvasElement = image;
|
|
1400
|
+
GameWindowManager.addCanvasElement(tag, canvasElement);
|
|
1401
|
+
}
|
|
1402
|
+
if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1403
|
+
yield canvasElement.load();
|
|
1404
|
+
}
|
|
1405
|
+
let destination = { x: canvasElement.x, y: canvasElement.y };
|
|
1406
|
+
if (props.direction == "up") {
|
|
1407
|
+
canvasElement.y = GameWindowManager.canvasHeight + canvasElement.height;
|
|
1408
|
+
} else if (props.direction == "down") {
|
|
1409
|
+
canvasElement.y = -canvasElement.height;
|
|
1410
|
+
} else if (props.direction == "left") {
|
|
1411
|
+
canvasElement.x = GameWindowManager.canvasWidth + canvasElement.width;
|
|
1412
|
+
} else if (props.direction == "right") {
|
|
1413
|
+
canvasElement.x = -canvasElement.width;
|
|
1414
|
+
}
|
|
1415
|
+
let effect = new MoveTicker(__spreadProps(__spreadValues({}, props), {
|
|
1416
|
+
destination,
|
|
1417
|
+
startOnlyIfHaveTexture: true
|
|
1418
|
+
}), priority);
|
|
1419
|
+
GameWindowManager.addTicker(tag, effect);
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
function moveOut(tag, props = { direction: "right" }, priority) {
|
|
1423
|
+
let canvasElement = GameWindowManager.getCanvasElement(tag);
|
|
1424
|
+
if (!canvasElement) {
|
|
1425
|
+
console.warn("[Pixi'VN] The canvas element is not found.");
|
|
1160
1426
|
return;
|
|
1427
|
+
}
|
|
1428
|
+
let destination = { x: canvasElement.x, y: canvasElement.y };
|
|
1429
|
+
if (props.direction == "up") {
|
|
1430
|
+
destination.y = -canvasElement.height;
|
|
1431
|
+
} else if (props.direction == "down") {
|
|
1432
|
+
destination.y = GameWindowManager.canvasHeight + canvasElement.height;
|
|
1433
|
+
} else if (props.direction == "left") {
|
|
1434
|
+
destination.x = -canvasElement.width;
|
|
1435
|
+
} else if (props.direction == "right") {
|
|
1436
|
+
destination.x = GameWindowManager.canvasWidth + canvasElement.width;
|
|
1437
|
+
}
|
|
1438
|
+
let effect = new MoveTicker(__spreadProps(__spreadValues({}, props), {
|
|
1439
|
+
destination,
|
|
1440
|
+
startOnlyIfHaveTexture: true,
|
|
1441
|
+
tagToRemoveAfter: tag
|
|
1442
|
+
}), priority);
|
|
1443
|
+
GameWindowManager.addTicker(tag, effect);
|
|
1444
|
+
}
|
|
1445
|
+
function zoomIn(_0, _1) {
|
|
1446
|
+
return __async(this, arguments, function* (tag, image, props = { direction: "right" }, priority) {
|
|
1447
|
+
var _a;
|
|
1448
|
+
let canvasElement;
|
|
1449
|
+
if (typeof image === "string") {
|
|
1450
|
+
canvasElement = new CanvasImage({}, image);
|
|
1451
|
+
} else {
|
|
1452
|
+
canvasElement = image;
|
|
1453
|
+
}
|
|
1454
|
+
if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1455
|
+
yield canvasElement.load();
|
|
1456
|
+
}
|
|
1457
|
+
let container = new CanvasContainer();
|
|
1458
|
+
container.addChild(canvasElement);
|
|
1459
|
+
container.height = GameWindowManager.canvasHeight;
|
|
1460
|
+
container.width = GameWindowManager.canvasWidth;
|
|
1461
|
+
GameWindowManager.addCanvasElement(tag, container);
|
|
1462
|
+
if (props.direction == "up") {
|
|
1463
|
+
container.pivot.y = GameWindowManager.canvasHeight;
|
|
1464
|
+
container.pivot.x = GameWindowManager.canvasWidth / 2;
|
|
1465
|
+
container.y = GameWindowManager.canvasHeight;
|
|
1466
|
+
container.x = GameWindowManager.canvasWidth / 2;
|
|
1467
|
+
} else if (props.direction == "down") {
|
|
1468
|
+
container.pivot.y = 0;
|
|
1469
|
+
container.pivot.x = GameWindowManager.canvasWidth / 2;
|
|
1470
|
+
container.y = 0;
|
|
1471
|
+
container.x = GameWindowManager.canvasWidth / 2;
|
|
1472
|
+
} else if (props.direction == "left") {
|
|
1473
|
+
container.pivot.x = GameWindowManager.canvasWidth;
|
|
1474
|
+
container.pivot.y = GameWindowManager.canvasHeight / 2;
|
|
1475
|
+
container.x = GameWindowManager.canvasWidth;
|
|
1476
|
+
container.y = GameWindowManager.canvasHeight / 2;
|
|
1477
|
+
} else if (props.direction == "right") {
|
|
1478
|
+
container.pivot.x = 0;
|
|
1479
|
+
container.pivot.y = GameWindowManager.canvasHeight / 2;
|
|
1480
|
+
container.x = 0;
|
|
1481
|
+
container.y = GameWindowManager.canvasHeight / 2;
|
|
1482
|
+
}
|
|
1483
|
+
container.scale.set(0);
|
|
1484
|
+
let effect = new ZoomInOutTicker(__spreadProps(__spreadValues({}, props), {
|
|
1485
|
+
startOnlyIfHaveTexture: true,
|
|
1486
|
+
type: "zoom",
|
|
1487
|
+
limit: 1
|
|
1488
|
+
}), priority);
|
|
1489
|
+
GameWindowManager.addTicker(tag, effect);
|
|
1161
1490
|
});
|
|
1162
1491
|
}
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1492
|
+
function zoomOut(tag, props = { direction: "right" }, priority) {
|
|
1493
|
+
let canvasElement = GameWindowManager.getCanvasElement(tag);
|
|
1494
|
+
if (!canvasElement) {
|
|
1495
|
+
console.warn("[Pixi'VN] The canvas element is not found.");
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
let container = new CanvasContainer();
|
|
1499
|
+
container.addChild(canvasElement);
|
|
1500
|
+
container.height = GameWindowManager.canvasHeight;
|
|
1501
|
+
container.width = GameWindowManager.canvasWidth;
|
|
1502
|
+
GameWindowManager.addCanvasElement(tag, container);
|
|
1503
|
+
if (props.direction == "up") {
|
|
1504
|
+
container.pivot.y = GameWindowManager.canvasHeight;
|
|
1505
|
+
container.pivot.x = GameWindowManager.canvasWidth / 2;
|
|
1506
|
+
container.y = GameWindowManager.canvasHeight;
|
|
1507
|
+
container.x = GameWindowManager.canvasWidth / 2;
|
|
1508
|
+
} else if (props.direction == "down") {
|
|
1509
|
+
container.pivot.y = 0;
|
|
1510
|
+
container.pivot.x = GameWindowManager.canvasWidth / 2;
|
|
1511
|
+
container.y = 0;
|
|
1512
|
+
container.x = GameWindowManager.canvasWidth / 2;
|
|
1513
|
+
} else if (props.direction == "left") {
|
|
1514
|
+
container.pivot.x = GameWindowManager.canvasWidth;
|
|
1515
|
+
container.pivot.y = GameWindowManager.canvasHeight / 2;
|
|
1516
|
+
container.x = GameWindowManager.canvasWidth;
|
|
1517
|
+
container.y = GameWindowManager.canvasHeight / 2;
|
|
1518
|
+
} else if (props.direction == "right") {
|
|
1519
|
+
container.pivot.x = 0;
|
|
1520
|
+
container.pivot.y = GameWindowManager.canvasHeight / 2;
|
|
1521
|
+
container.x = 0;
|
|
1522
|
+
container.y = GameWindowManager.canvasHeight / 2;
|
|
1523
|
+
}
|
|
1524
|
+
container.scale.set(1);
|
|
1525
|
+
let effect = new ZoomInOutTicker(__spreadProps(__spreadValues({}, props), {
|
|
1526
|
+
startOnlyIfHaveTexture: true,
|
|
1527
|
+
type: "unzoom",
|
|
1528
|
+
limit: 0,
|
|
1529
|
+
tagToRemoveAfter: tag
|
|
1530
|
+
}), priority);
|
|
1531
|
+
GameWindowManager.addTicker(tag, effect);
|
|
1532
|
+
}
|
|
1166
1533
|
|
|
1167
1534
|
// src/functions/SavesUtility.ts
|
|
1168
1535
|
function getSaveData() {
|
|
@@ -1339,6 +1706,9 @@ function asciiArtLog() {
|
|
|
1339
1706
|
`);
|
|
1340
1707
|
}
|
|
1341
1708
|
|
|
1709
|
+
// src/types/ticker/TagToRemoveAfterType.ts
|
|
1710
|
+
var tagToRemoveAfter = "tagToRemoveAfter";
|
|
1711
|
+
|
|
1342
1712
|
// src/managers/WindowManager.ts
|
|
1343
1713
|
var _GameWindowManager = class _GameWindowManager {
|
|
1344
1714
|
constructor() {
|
|
@@ -1521,25 +1891,25 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1521
1891
|
/**
|
|
1522
1892
|
* Remove a canvas element from the canvas.
|
|
1523
1893
|
* And remove all tickers that are not connected to any canvas element.
|
|
1524
|
-
* @param
|
|
1894
|
+
* @param tags The tag of the canvas element to be removed.
|
|
1525
1895
|
* @returns
|
|
1526
1896
|
* @example
|
|
1527
1897
|
* ```typescript
|
|
1528
1898
|
* GameWindowManager.removeCanvasElement("bunny");
|
|
1529
1899
|
* ```
|
|
1530
1900
|
*/
|
|
1531
|
-
static removeCanvasElement(
|
|
1532
|
-
if (typeof
|
|
1533
|
-
|
|
1901
|
+
static removeCanvasElement(tags) {
|
|
1902
|
+
if (typeof tags === "string") {
|
|
1903
|
+
tags = [tags];
|
|
1534
1904
|
}
|
|
1535
|
-
|
|
1536
|
-
if (_GameWindowManager._children[
|
|
1537
|
-
_GameWindowManager.app.stage.removeChild(_GameWindowManager._children[
|
|
1538
|
-
delete _GameWindowManager._children[
|
|
1905
|
+
tags.forEach((tag) => {
|
|
1906
|
+
if (_GameWindowManager._children[tag]) {
|
|
1907
|
+
_GameWindowManager.app.stage.removeChild(_GameWindowManager._children[tag]);
|
|
1908
|
+
delete _GameWindowManager._children[tag];
|
|
1909
|
+
_GameWindowManager.removeTickerByCanvasElement(tag);
|
|
1539
1910
|
}
|
|
1540
1911
|
});
|
|
1541
|
-
_GameWindowManager.
|
|
1542
|
-
_GameWindowManager.childrenTagsOrder = _GameWindowManager.childrenTagsOrder.filter((t) => !tag.includes(t));
|
|
1912
|
+
_GameWindowManager.childrenTagsOrder = _GameWindowManager.childrenTagsOrder.filter((t) => !tags.includes(t));
|
|
1543
1913
|
}
|
|
1544
1914
|
/**
|
|
1545
1915
|
* Get a canvas element by the tag.
|
|
@@ -1569,18 +1939,43 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1569
1939
|
_GameWindowManager.app.stage.removeChildren();
|
|
1570
1940
|
_GameWindowManager._children = {};
|
|
1571
1941
|
_GameWindowManager.childrenTagsOrder = [];
|
|
1572
|
-
_GameWindowManager.
|
|
1942
|
+
_GameWindowManager.removeAllTickers();
|
|
1573
1943
|
}
|
|
1574
1944
|
/**
|
|
1575
1945
|
* Edit the tag of a canvas element.
|
|
1576
1946
|
* @param oldTag The old tag of the canvas element.
|
|
1577
1947
|
* @param newTag The new tag of the canvas element.
|
|
1578
1948
|
*/
|
|
1579
|
-
static
|
|
1949
|
+
static editCanvasElementTag(oldTag, newTag) {
|
|
1580
1950
|
if (_GameWindowManager._children[oldTag]) {
|
|
1581
1951
|
_GameWindowManager._children[newTag] = _GameWindowManager._children[oldTag];
|
|
1582
1952
|
delete _GameWindowManager._children[oldTag];
|
|
1583
1953
|
}
|
|
1954
|
+
if (_GameWindowManager._currentTickersSteps[oldTag]) {
|
|
1955
|
+
_GameWindowManager._currentTickersSteps[newTag] = _GameWindowManager._currentTickersSteps[oldTag];
|
|
1956
|
+
delete _GameWindowManager._currentTickersSteps[oldTag];
|
|
1957
|
+
}
|
|
1958
|
+
for (let id in _GameWindowManager._currentTickers) {
|
|
1959
|
+
let ticker = _GameWindowManager._currentTickers[id];
|
|
1960
|
+
if (ticker.canvasElementTags.includes(oldTag)) {
|
|
1961
|
+
ticker.canvasElementTags = ticker.canvasElementTags.map((t) => t === oldTag ? newTag : t);
|
|
1962
|
+
if (ticker.args.hasOwnProperty(tagToRemoveAfter)) {
|
|
1963
|
+
let tagToRemoveAfter2 = ticker.args.tagToRemoveAfter;
|
|
1964
|
+
if (typeof tagToRemoveAfter2 === "string") {
|
|
1965
|
+
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
1966
|
+
}
|
|
1967
|
+
if (Array.isArray(tagToRemoveAfter2)) {
|
|
1968
|
+
ticker.args.tagToRemoveAfter = tagToRemoveAfter2.map((t) => t === oldTag ? newTag : t);
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
for (let timeout in _GameWindowManager._currentTickersTimeouts) {
|
|
1974
|
+
let TickerTimeout = _GameWindowManager._currentTickersTimeouts[timeout];
|
|
1975
|
+
if (TickerTimeout.tags.includes(oldTag)) {
|
|
1976
|
+
TickerTimeout.tags = TickerTimeout.tags.map((t) => t === oldTag ? newTag : t);
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1584
1979
|
}
|
|
1585
1980
|
/** Edit Tickers Methods */
|
|
1586
1981
|
/**
|
|
@@ -1589,106 +1984,127 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1589
1984
|
static get currentTickers() {
|
|
1590
1985
|
return _GameWindowManager._currentTickers;
|
|
1591
1986
|
}
|
|
1987
|
+
static get currentTickersList() {
|
|
1988
|
+
return Object.values(_GameWindowManager._currentTickers);
|
|
1989
|
+
}
|
|
1990
|
+
static get currentTickersWithoutCreatedBySteps() {
|
|
1991
|
+
return Object.fromEntries(Object.entries(_GameWindowManager._currentTickers).filter(([_, ticker]) => !ticker.createdByTicketStepsId));
|
|
1992
|
+
}
|
|
1592
1993
|
/**
|
|
1593
1994
|
* The steps of the tickers
|
|
1594
1995
|
*/
|
|
1595
1996
|
static get currentTickersSteps() {
|
|
1596
1997
|
return _GameWindowManager._currentTickersSteps;
|
|
1597
1998
|
}
|
|
1999
|
+
static generateTickerId(tickerData) {
|
|
2000
|
+
try {
|
|
2001
|
+
return sha1(JSON.stringify(tickerData)).toString() + "_" + Math.random().toString(36).substring(7);
|
|
2002
|
+
} catch (e) {
|
|
2003
|
+
throw new Error(`[Pixi'VN] Error to generate ticker id: ${e}`);
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
1598
2006
|
/**
|
|
1599
|
-
* Run a ticker.
|
|
2007
|
+
* Run a ticker. You can run multiple addTicker with the same tag and different tickerClasses.
|
|
2008
|
+
* If you run a ticker with the same tag and tickerClass, the old ticker will be removed.
|
|
2009
|
+
* If already exists a sequence of tickers with the same tag, it will be removed.
|
|
1600
2010
|
* @param canvasEslementTag The tag of the canvas element that will use the ticker.
|
|
1601
2011
|
* @param ticker The ticker class to be run.
|
|
1602
2012
|
* @param args The arguments to be used in the ticker.
|
|
1603
|
-
* @param duration The time to be used in the ticker. This number is in
|
|
2013
|
+
* @param duration The time to be used in the ticker. This number is in seconds. If it is undefined, the ticker will run forever.
|
|
1604
2014
|
* @param priority The priority to be used in the ticker.
|
|
1605
2015
|
* @returns
|
|
1606
2016
|
* @example
|
|
1607
2017
|
* ```typescript
|
|
1608
|
-
* GameWindowManager.addTicker("alien", new
|
|
2018
|
+
* GameWindowManager.addTicker("alien", new RotateTicker({ speed: 0.2 }))
|
|
1609
2019
|
* ```
|
|
1610
2020
|
*/
|
|
1611
2021
|
static addTicker(canvasElementTag, ticker) {
|
|
1612
|
-
let
|
|
2022
|
+
let tickerId = ticker.id;
|
|
1613
2023
|
if (typeof canvasElementTag === "string") {
|
|
1614
2024
|
canvasElementTag = [canvasElementTag];
|
|
1615
2025
|
}
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
console.error(`[Pixi'VN] Ticker ${tickerName} not found`);
|
|
2026
|
+
if (!geTickerInstanceById(tickerId, ticker.args, ticker.duration, ticker.priority)) {
|
|
2027
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
1619
2028
|
return;
|
|
1620
2029
|
}
|
|
1621
|
-
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(canvasElementTag, ticker);
|
|
1622
2030
|
let tickerHistory = {
|
|
1623
2031
|
fn: () => {
|
|
1624
2032
|
},
|
|
1625
|
-
|
|
1626
|
-
args: ticker.args,
|
|
2033
|
+
id: tickerId,
|
|
2034
|
+
args: createExportableElement(ticker.args),
|
|
1627
2035
|
canvasElementTags: canvasElementTag,
|
|
1628
2036
|
priority: ticker.priority,
|
|
1629
2037
|
duration: ticker.duration
|
|
1630
2038
|
};
|
|
1631
|
-
_GameWindowManager.
|
|
1632
|
-
_GameWindowManager.
|
|
2039
|
+
let id = _GameWindowManager.generateTickerId(tickerHistory);
|
|
2040
|
+
_GameWindowManager.pushTicker(id, tickerHistory, ticker);
|
|
1633
2041
|
if (ticker.duration) {
|
|
1634
2042
|
let timeout = setTimeout(() => {
|
|
1635
2043
|
_GameWindowManager.removeTickerTimeoutInfo(timeout);
|
|
1636
|
-
_GameWindowManager.
|
|
1637
|
-
|
|
1638
|
-
|
|
2044
|
+
let tickerTimeoutInfo = _GameWindowManager._currentTickersTimeouts[timeout.toString()];
|
|
2045
|
+
if (tickerTimeoutInfo) {
|
|
2046
|
+
_GameWindowManager.removeTicker(id);
|
|
2047
|
+
}
|
|
2048
|
+
}, ticker.duration * 1e3);
|
|
2049
|
+
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag, tickerId, timeout.toString(), true);
|
|
1639
2050
|
}
|
|
1640
2051
|
}
|
|
1641
|
-
static pushTicker(tickerData, ticker) {
|
|
1642
|
-
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags,
|
|
1643
|
-
_GameWindowManager._currentTickers
|
|
2052
|
+
static pushTicker(id, tickerData, ticker) {
|
|
2053
|
+
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags, ticker);
|
|
2054
|
+
_GameWindowManager._currentTickers[id] = tickerData;
|
|
1644
2055
|
tickerData.fn = (t) => {
|
|
1645
|
-
|
|
2056
|
+
let data = _GameWindowManager._currentTickers[id];
|
|
2057
|
+
if (data) {
|
|
2058
|
+
ticker == null ? void 0 : ticker.fn(t, data.args, data.canvasElementTags, id);
|
|
2059
|
+
}
|
|
1646
2060
|
};
|
|
1647
2061
|
_GameWindowManager.app.ticker.add(tickerData.fn, void 0, tickerData.priority);
|
|
1648
2062
|
}
|
|
1649
2063
|
/**
|
|
1650
|
-
* Run a sequence of tickers.
|
|
2064
|
+
* Run a sequence of tickers. If exists a ticker steps with the same tag, it will be removed.
|
|
1651
2065
|
* @param tag The tag of canvas element that will use the tickers.
|
|
1652
2066
|
* @param steps The steps of the tickers.
|
|
2067
|
+
* @param currentStepNumber The current step number. It is used to continue the sequence of tickers.
|
|
1653
2068
|
* @returns
|
|
1654
2069
|
* @example
|
|
1655
2070
|
* ```typescript
|
|
1656
2071
|
* GameWindowManager.addTickersSteps("alien", [
|
|
1657
|
-
* new
|
|
1658
|
-
* Pause(
|
|
1659
|
-
* new
|
|
2072
|
+
* new RotateTicker({ speed: 0.1, clockwise: true }, 2), // 2 seconds
|
|
2073
|
+
* Pause(1), // 1 second
|
|
2074
|
+
* new RotateTicker({ speed: 0.2, clockwise: false }, 2),
|
|
1660
2075
|
* Repeat,
|
|
1661
2076
|
* ])
|
|
1662
2077
|
* ```
|
|
1663
2078
|
*/
|
|
1664
|
-
static addTickersSteps(tag, steps) {
|
|
2079
|
+
static addTickersSteps(tag, steps, currentStepNumber = 0) {
|
|
1665
2080
|
if (steps.length == 0) {
|
|
1666
2081
|
console.warn("[Pixi'VN] The steps of the tickers is empty");
|
|
1667
2082
|
return;
|
|
1668
2083
|
}
|
|
1669
|
-
|
|
2084
|
+
_GameWindowManager.removeTickerStepByCanvasElement(tag);
|
|
1670
2085
|
_GameWindowManager._currentTickersSteps[tag] = {
|
|
1671
|
-
currentStepNumber
|
|
1672
|
-
steps: steps.map((
|
|
1673
|
-
if (
|
|
1674
|
-
return
|
|
1675
|
-
}
|
|
1676
|
-
if (!s.duration) {
|
|
1677
|
-
console.warn("[Pixi'VN] Duration is not defined, so it will be set to 1000");
|
|
1678
|
-
s.duration = 1e3;
|
|
2086
|
+
currentStepNumber,
|
|
2087
|
+
steps: steps.map((step) => {
|
|
2088
|
+
if (step === Repeat) {
|
|
2089
|
+
return step;
|
|
1679
2090
|
}
|
|
1680
|
-
if (
|
|
1681
|
-
return
|
|
2091
|
+
if (step.hasOwnProperty("type") && step.type === "pause") {
|
|
2092
|
+
return step;
|
|
1682
2093
|
}
|
|
1683
|
-
let
|
|
2094
|
+
let tickerId = step.id;
|
|
1684
2095
|
return {
|
|
1685
|
-
ticker:
|
|
1686
|
-
args:
|
|
1687
|
-
duration:
|
|
2096
|
+
ticker: tickerId,
|
|
2097
|
+
args: createExportableElement(step.args),
|
|
2098
|
+
duration: step.duration
|
|
1688
2099
|
};
|
|
1689
2100
|
})
|
|
1690
2101
|
};
|
|
1691
|
-
|
|
2102
|
+
_GameWindowManager.runTickersSteps(tag);
|
|
2103
|
+
}
|
|
2104
|
+
static restoneTickersSteps(data) {
|
|
2105
|
+
for (let tag in data) {
|
|
2106
|
+
let steps = data[tag];
|
|
2107
|
+
_GameWindowManager._currentTickersSteps[tag] = steps;
|
|
1692
2108
|
_GameWindowManager.runTickersSteps(tag);
|
|
1693
2109
|
}
|
|
1694
2110
|
}
|
|
@@ -1702,70 +2118,106 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1702
2118
|
return;
|
|
1703
2119
|
}
|
|
1704
2120
|
}
|
|
1705
|
-
if (step.hasOwnProperty("type") && step.type ===
|
|
2121
|
+
if (step.hasOwnProperty("type") && step.type === "pause") {
|
|
1706
2122
|
let timeout = setTimeout(() => {
|
|
2123
|
+
let tickerTimeoutInfo = _GameWindowManager._currentTickersTimeouts[timeout.toString()];
|
|
2124
|
+
if (tickerTimeoutInfo) {
|
|
2125
|
+
tickerTimeoutInfo.tags.forEach((tag2) => {
|
|
2126
|
+
_GameWindowManager.nextTickerStep(tag2);
|
|
2127
|
+
});
|
|
2128
|
+
}
|
|
1707
2129
|
_GameWindowManager.removeTickerTimeoutInfo(timeout);
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
_GameWindowManager.addTickerTimeoutInfo(tag, "steps", timeout.toString());
|
|
2130
|
+
}, step.duration * 1e3);
|
|
2131
|
+
_GameWindowManager.addTickerTimeoutInfo(tag, "steps", timeout.toString(), false);
|
|
1711
2132
|
return;
|
|
1712
2133
|
}
|
|
1713
|
-
let ticker =
|
|
2134
|
+
let ticker = geTickerInstanceById(step.ticker, step.args, step.duration, step.priority);
|
|
1714
2135
|
if (!ticker) {
|
|
1715
2136
|
console.error(`[Pixi'VN] Ticker ${step.ticker} not found`);
|
|
1716
2137
|
return;
|
|
1717
2138
|
}
|
|
1718
|
-
|
|
2139
|
+
let tickerName = ticker.id;
|
|
2140
|
+
let tickerHistory = {
|
|
2141
|
+
fn: () => {
|
|
2142
|
+
},
|
|
2143
|
+
id: tickerName,
|
|
2144
|
+
args: createExportableElement(ticker.args),
|
|
2145
|
+
canvasElementTags: [tag],
|
|
2146
|
+
priority: ticker.priority,
|
|
2147
|
+
duration: ticker.duration,
|
|
2148
|
+
createdByTicketStepsId: tag
|
|
2149
|
+
};
|
|
2150
|
+
let id = _GameWindowManager.generateTickerId(tickerHistory);
|
|
2151
|
+
_GameWindowManager.pushTicker(id, tickerHistory, ticker);
|
|
2152
|
+
if (ticker.duration) {
|
|
2153
|
+
let timeout = setTimeout(() => {
|
|
2154
|
+
let tickerTimeoutInfo = _GameWindowManager._currentTickersTimeouts[timeout.toString()];
|
|
2155
|
+
if (tickerTimeoutInfo) {
|
|
2156
|
+
_GameWindowManager.removeTicker(id);
|
|
2157
|
+
tickerTimeoutInfo.tags.forEach((tag2) => {
|
|
2158
|
+
_GameWindowManager.nextTickerStep(tag2);
|
|
2159
|
+
});
|
|
2160
|
+
}
|
|
2161
|
+
_GameWindowManager.removeTickerTimeoutInfo(timeout);
|
|
2162
|
+
}, ticker.duration * 1e3);
|
|
2163
|
+
_GameWindowManager.addTickerTimeoutInfo(tag, tickerName, timeout.toString(), false);
|
|
2164
|
+
}
|
|
1719
2165
|
}
|
|
1720
2166
|
static nextTickerStep(tag) {
|
|
1721
|
-
if (
|
|
1722
|
-
|
|
2167
|
+
if (_GameWindowManager._currentTickersSteps[tag]) {
|
|
2168
|
+
let steps = _GameWindowManager._currentTickersSteps[tag];
|
|
2169
|
+
if (steps.currentStepNumber + 1 < steps.steps.length) {
|
|
2170
|
+
steps.currentStepNumber++;
|
|
2171
|
+
_GameWindowManager._currentTickersSteps[tag] = steps;
|
|
2172
|
+
_GameWindowManager.runTickersSteps(tag);
|
|
2173
|
+
} else {
|
|
2174
|
+
_GameWindowManager.removeTickerStepByCanvasElement(tag);
|
|
2175
|
+
}
|
|
1723
2176
|
}
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
}
|
|
2177
|
+
}
|
|
2178
|
+
static onEndOfTicker(canvasElementTags, ticker, canvasElementTagsToDelete, tickerId) {
|
|
2179
|
+
let tickerData = _GameWindowManager._currentTickers[tickerId];
|
|
2180
|
+
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(canvasElementTags, ticker);
|
|
2181
|
+
_GameWindowManager.removeCanvasElement(canvasElementTagsToDelete);
|
|
2182
|
+
if (tickerData) {
|
|
2183
|
+
_GameWindowManager.removeTicker(tickerId);
|
|
2184
|
+
if (tickerData.duration == void 0 && tickerData.createdByTicketStepsId) {
|
|
2185
|
+
_GameWindowManager.nextTickerStep(tickerData.createdByTicketStepsId);
|
|
1734
2186
|
}
|
|
1735
|
-
}
|
|
2187
|
+
}
|
|
1736
2188
|
}
|
|
1737
2189
|
/**
|
|
1738
2190
|
* Remove a connection between a canvas element and a ticker.
|
|
1739
2191
|
* And remove the ticker if there is no canvas element connected to it.
|
|
1740
|
-
* @param
|
|
2192
|
+
* @param tags The tag of the canvas element that will use the ticker.
|
|
1741
2193
|
* @param ticker The ticker class to be removed.
|
|
1742
2194
|
* @example
|
|
1743
2195
|
* ```typescript
|
|
1744
|
-
* GameWindowManager.removeAssociationBetweenTickerCanvasElement("alien",
|
|
2196
|
+
* GameWindowManager.removeAssociationBetweenTickerCanvasElement("alien", RotateTicker)
|
|
1745
2197
|
* ```
|
|
1746
2198
|
*/
|
|
1747
|
-
static removeAssociationBetweenTickerCanvasElement(
|
|
1748
|
-
let
|
|
1749
|
-
if (ticker
|
|
1750
|
-
|
|
2199
|
+
static removeAssociationBetweenTickerCanvasElement(tags, ticker) {
|
|
2200
|
+
let tickerId;
|
|
2201
|
+
if (typeof ticker === "string") {
|
|
2202
|
+
tickerId = ticker;
|
|
2203
|
+
} else if (ticker instanceof TickerBase) {
|
|
2204
|
+
tickerId = ticker.id;
|
|
1751
2205
|
} else {
|
|
1752
|
-
|
|
2206
|
+
tickerId = ticker.prototype.id;
|
|
1753
2207
|
}
|
|
1754
|
-
if (typeof
|
|
1755
|
-
|
|
2208
|
+
if (typeof tags === "string") {
|
|
2209
|
+
tags = [tags];
|
|
1756
2210
|
}
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
2211
|
+
for (let id in _GameWindowManager._currentTickers) {
|
|
2212
|
+
let ticker2 = _GameWindowManager._currentTickers[id];
|
|
2213
|
+
if (ticker2.id === tickerId) {
|
|
2214
|
+
_GameWindowManager._currentTickers[id].canvasElementTags = ticker2.canvasElementTags.filter((e) => !tags.includes(e));
|
|
1760
2215
|
}
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
_GameWindowManager.removeTickerTimeoutInfo(timeout);
|
|
1767
|
-
} else {
|
|
1768
|
-
_GameWindowManager.currentTickersTimeouts[timeout].tags = t;
|
|
2216
|
+
}
|
|
2217
|
+
for (let timeout in _GameWindowManager._currentTickersTimeouts) {
|
|
2218
|
+
let TickerTimeout = _GameWindowManager._currentTickersTimeouts[timeout];
|
|
2219
|
+
if (TickerTimeout.ticker === tickerId && TickerTimeout.canBeDeletedBeforeEnd) {
|
|
2220
|
+
_GameWindowManager._currentTickersTimeouts[timeout].tags = TickerTimeout.tags.filter((t) => !tags.includes(t));
|
|
1769
2221
|
}
|
|
1770
2222
|
}
|
|
1771
2223
|
_GameWindowManager.removeTickersWithoutAssociatedCanvasElement();
|
|
@@ -1774,49 +2226,117 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1774
2226
|
* Remove all tickers that are not connected to any existing canvas element.
|
|
1775
2227
|
*/
|
|
1776
2228
|
static removeTickersWithoutAssociatedCanvasElement() {
|
|
1777
|
-
let
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
}
|
|
1784
|
-
currentTickers = currentTickers.filter((t) => t.canvasElementTags.length > 0);
|
|
1785
|
-
_GameWindowManager._currentTickers = currentTickers;
|
|
2229
|
+
for (let id in _GameWindowManager._currentTickers) {
|
|
2230
|
+
let ticker = _GameWindowManager._currentTickers[id];
|
|
2231
|
+
ticker.canvasElementTags = ticker.canvasElementTags.filter((e) => _GameWindowManager._children[e]);
|
|
2232
|
+
if (ticker.canvasElementTags.length === 0) {
|
|
2233
|
+
_GameWindowManager.removeTicker(id);
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
1786
2236
|
for (let tag in _GameWindowManager._currentTickersSteps) {
|
|
1787
2237
|
if (_GameWindowManager._children[tag] === void 0) {
|
|
1788
2238
|
delete _GameWindowManager._currentTickersSteps[tag];
|
|
1789
2239
|
}
|
|
1790
2240
|
}
|
|
2241
|
+
Object.entries(_GameWindowManager._currentTickersTimeouts).forEach(([timeout, { tags }]) => {
|
|
2242
|
+
if (tags.length === 0) {
|
|
2243
|
+
_GameWindowManager.removeTickerTimeout(timeout);
|
|
2244
|
+
}
|
|
2245
|
+
});
|
|
1791
2246
|
}
|
|
1792
|
-
static addTickerTimeoutInfo(tags, ticker, timeout) {
|
|
2247
|
+
static addTickerTimeoutInfo(tags, ticker, timeout, canBeDeletedBeforeEnd) {
|
|
1793
2248
|
if (typeof tags === "string") {
|
|
1794
2249
|
tags = [tags];
|
|
1795
2250
|
}
|
|
1796
|
-
_GameWindowManager.
|
|
2251
|
+
_GameWindowManager._currentTickersTimeouts[timeout] = {
|
|
1797
2252
|
tags,
|
|
1798
|
-
ticker
|
|
2253
|
+
ticker,
|
|
2254
|
+
canBeDeletedBeforeEnd
|
|
1799
2255
|
};
|
|
1800
2256
|
}
|
|
1801
2257
|
static removeTickerTimeoutInfo(timeout) {
|
|
1802
2258
|
if (typeof timeout !== "string") {
|
|
1803
2259
|
timeout = timeout.toString();
|
|
1804
2260
|
}
|
|
1805
|
-
if (_GameWindowManager.
|
|
1806
|
-
delete _GameWindowManager.
|
|
2261
|
+
if (_GameWindowManager._currentTickersTimeouts[timeout]) {
|
|
2262
|
+
delete _GameWindowManager._currentTickersTimeouts[timeout];
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
static removeTickerTimeout(timeout) {
|
|
2266
|
+
if (typeof timeout !== "string") {
|
|
2267
|
+
timeout = timeout.toString();
|
|
2268
|
+
}
|
|
2269
|
+
clearTimeout(Number(timeout));
|
|
2270
|
+
_GameWindowManager.removeTickerTimeoutInfo(timeout);
|
|
2271
|
+
}
|
|
2272
|
+
static removeTickerTimeoutsByTag(tag, checkCanBeDeletedBeforeEnd) {
|
|
2273
|
+
for (let timeout in _GameWindowManager._currentTickersTimeouts) {
|
|
2274
|
+
let tagsWithoutTagToRemove = _GameWindowManager._currentTickersTimeouts[timeout].tags.filter((t) => t !== tag);
|
|
2275
|
+
if (tagsWithoutTagToRemove.length === 0) {
|
|
2276
|
+
let canBeDeletedBeforeEnd = _GameWindowManager._currentTickersTimeouts[timeout].canBeDeletedBeforeEnd;
|
|
2277
|
+
if (!checkCanBeDeletedBeforeEnd || canBeDeletedBeforeEnd) {
|
|
2278
|
+
_GameWindowManager.removeTickerTimeout(timeout);
|
|
2279
|
+
}
|
|
2280
|
+
} else {
|
|
2281
|
+
_GameWindowManager._currentTickersTimeouts[timeout].tags = tagsWithoutTagToRemove;
|
|
2282
|
+
}
|
|
1807
2283
|
}
|
|
1808
2284
|
}
|
|
1809
2285
|
/**
|
|
1810
2286
|
* Remove all tickers from the canvas.
|
|
1811
2287
|
*/
|
|
1812
|
-
static
|
|
2288
|
+
static removeAllTickers() {
|
|
1813
2289
|
_GameWindowManager._currentTickersSteps = {};
|
|
1814
|
-
_GameWindowManager._currentTickers.forEach((
|
|
1815
|
-
_GameWindowManager.
|
|
2290
|
+
Object.keys(_GameWindowManager._currentTickers).forEach((id) => {
|
|
2291
|
+
_GameWindowManager.removeTicker(id);
|
|
2292
|
+
});
|
|
2293
|
+
_GameWindowManager._currentTickers = {};
|
|
2294
|
+
for (let timeout in _GameWindowManager._currentTickersTimeouts) {
|
|
2295
|
+
_GameWindowManager.removeTickerTimeout(timeout);
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
/**
|
|
2299
|
+
* Remove all tickers from a canvas element.
|
|
2300
|
+
* @param tag The tag of the canvas element that will use the ticker.
|
|
2301
|
+
*/
|
|
2302
|
+
static removeTickerByCanvasElement(tag) {
|
|
2303
|
+
if (typeof tag === "string") {
|
|
2304
|
+
tag = [tag];
|
|
2305
|
+
}
|
|
2306
|
+
tag.forEach((tag2) => {
|
|
2307
|
+
for (let id in _GameWindowManager._currentTickers) {
|
|
2308
|
+
let ticker = _GameWindowManager._currentTickers[id];
|
|
2309
|
+
if (ticker.canvasElementTags.includes(tag2)) {
|
|
2310
|
+
_GameWindowManager.removeTicker(id);
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
if (_GameWindowManager._currentTickersSteps[tag2]) {
|
|
2314
|
+
delete _GameWindowManager._currentTickersSteps[tag2];
|
|
2315
|
+
}
|
|
2316
|
+
_GameWindowManager.removeTickerTimeoutsByTag(tag2, false);
|
|
2317
|
+
delete _GameWindowManager._currentTickersSteps[tag2];
|
|
1816
2318
|
});
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
2319
|
+
}
|
|
2320
|
+
static removeTickerStepByCanvasElement(tag) {
|
|
2321
|
+
if (_GameWindowManager._currentTickersSteps[tag]) {
|
|
2322
|
+
delete _GameWindowManager._currentTickersSteps[tag];
|
|
2323
|
+
}
|
|
2324
|
+
for (let id in _GameWindowManager._currentTickers) {
|
|
2325
|
+
let ticker = _GameWindowManager._currentTickers[id];
|
|
2326
|
+
if (ticker.createdByTicketStepsId === tag) {
|
|
2327
|
+
_GameWindowManager.removeTicker(id);
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
static removeTicker(tickerId) {
|
|
2332
|
+
let ticker = _GameWindowManager._currentTickers[tickerId];
|
|
2333
|
+
if (ticker) {
|
|
2334
|
+
if (ticker.args.hasOwnProperty(tagToRemoveAfter)) {
|
|
2335
|
+
let tagToRemoveAfter2 = ticker.args.tagToRemoveAfter;
|
|
2336
|
+
_GameWindowManager.removeCanvasElement(tagToRemoveAfter2);
|
|
2337
|
+
}
|
|
2338
|
+
_GameWindowManager.app.ticker.remove(ticker.fn);
|
|
2339
|
+
delete _GameWindowManager._currentTickers[tickerId];
|
|
1820
2340
|
}
|
|
1821
2341
|
}
|
|
1822
2342
|
/**
|
|
@@ -1843,7 +2363,8 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1843
2363
|
currentElements[tag] = exportCanvasElement(_GameWindowManager._children[tag]);
|
|
1844
2364
|
}
|
|
1845
2365
|
return {
|
|
1846
|
-
currentTickers: createExportableElement(_GameWindowManager.
|
|
2366
|
+
currentTickers: createExportableElement(_GameWindowManager.currentTickersWithoutCreatedBySteps),
|
|
2367
|
+
currentTickersSteps: createExportableElement(_GameWindowManager._currentTickersSteps),
|
|
1847
2368
|
currentElements: createExportableElement(currentElements),
|
|
1848
2369
|
childrenTagsOrder: createExportableElement(_GameWindowManager.childrenTagsOrder)
|
|
1849
2370
|
};
|
|
@@ -1878,15 +2399,20 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1878
2399
|
}
|
|
1879
2400
|
if (data.hasOwnProperty("currentTickers")) {
|
|
1880
2401
|
let currentTickers = data["currentTickers"];
|
|
1881
|
-
currentTickers
|
|
2402
|
+
for (let id in currentTickers) {
|
|
2403
|
+
let t = currentTickers[id];
|
|
1882
2404
|
let tags = t.canvasElementTags;
|
|
1883
|
-
let ticker =
|
|
2405
|
+
let ticker = geTickerInstanceById(t.id, t.args, t.duration, t.priority);
|
|
1884
2406
|
if (ticker) {
|
|
1885
2407
|
_GameWindowManager.addTicker(tags, ticker);
|
|
1886
2408
|
} else {
|
|
1887
|
-
console.error(`[Pixi'VN] Ticker ${t.
|
|
2409
|
+
console.error(`[Pixi'VN] Ticker ${t.id} not found`);
|
|
1888
2410
|
}
|
|
1889
|
-
}
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
if (data.hasOwnProperty("currentTickersSteps")) {
|
|
2414
|
+
let currentTickersSteps = data["currentTickersSteps"];
|
|
2415
|
+
_GameWindowManager.restoneTickersSteps(currentTickersSteps);
|
|
1890
2416
|
}
|
|
1891
2417
|
} catch (e) {
|
|
1892
2418
|
console.error("[Pixi'VN] Error importing data", e);
|
|
@@ -1900,9 +2426,9 @@ _GameWindowManager._children = {};
|
|
|
1900
2426
|
* The order of the children tags.
|
|
1901
2427
|
*/
|
|
1902
2428
|
_GameWindowManager.childrenTagsOrder = [];
|
|
1903
|
-
_GameWindowManager._currentTickers =
|
|
2429
|
+
_GameWindowManager._currentTickers = {};
|
|
1904
2430
|
_GameWindowManager._currentTickersSteps = {};
|
|
1905
|
-
_GameWindowManager.
|
|
2431
|
+
_GameWindowManager._currentTickersTimeouts = {};
|
|
1906
2432
|
var GameWindowManager = _GameWindowManager;
|
|
1907
2433
|
|
|
1908
2434
|
// src/managers/StepManager.ts
|
|
@@ -1969,7 +2495,8 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1969
2495
|
canvas: {
|
|
1970
2496
|
childrenTagsOrder: [],
|
|
1971
2497
|
currentElements: {},
|
|
1972
|
-
currentTickers:
|
|
2498
|
+
currentTickers: {},
|
|
2499
|
+
currentTickersSteps: {}
|
|
1973
2500
|
},
|
|
1974
2501
|
labelIndex: -1,
|
|
1975
2502
|
openedLabels: []
|
|
@@ -2080,6 +2607,13 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2080
2607
|
_GameStepManager._openedLabels = _GameStepManager.originalStepData.openedLabels;
|
|
2081
2608
|
}
|
|
2082
2609
|
/* Run Methods */
|
|
2610
|
+
static get canGoNext() {
|
|
2611
|
+
let options = getChoiceMenuOptions();
|
|
2612
|
+
if (options && options.length > 0) {
|
|
2613
|
+
return false;
|
|
2614
|
+
}
|
|
2615
|
+
return true;
|
|
2616
|
+
}
|
|
2083
2617
|
/**
|
|
2084
2618
|
* Execute the next step and add it to the history.
|
|
2085
2619
|
* @param props The props to pass to the step.
|
|
@@ -2089,7 +2623,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2089
2623
|
* ```typescript
|
|
2090
2624
|
* function nextOnClick() {
|
|
2091
2625
|
* setLoading(true)
|
|
2092
|
-
* GameStepManager.
|
|
2626
|
+
* GameStepManager.goNext(yourParams)
|
|
2093
2627
|
* .then((result) => {
|
|
2094
2628
|
* setUpdate((p) => p + 1)
|
|
2095
2629
|
* setLoading(false)
|
|
@@ -2104,8 +2638,12 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2104
2638
|
* }
|
|
2105
2639
|
* ```
|
|
2106
2640
|
*/
|
|
2107
|
-
static
|
|
2641
|
+
static goNext(props, choiseMade) {
|
|
2108
2642
|
return __async(this, null, function* () {
|
|
2643
|
+
if (!_GameStepManager.canGoNext) {
|
|
2644
|
+
console.warn("[Pixi'VN] The player must make a choice");
|
|
2645
|
+
return;
|
|
2646
|
+
}
|
|
2109
2647
|
_GameStepManager.increaseCurrentStepIndex();
|
|
2110
2648
|
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
2111
2649
|
});
|
|
@@ -2136,7 +2674,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2136
2674
|
return result;
|
|
2137
2675
|
} else if (_GameStepManager.openedLabels.length > 1) {
|
|
2138
2676
|
_GameStepManager.closeCurrentLabel();
|
|
2139
|
-
return yield _GameStepManager.
|
|
2677
|
+
return yield _GameStepManager.goNext(props, choiseMade);
|
|
2140
2678
|
} else {
|
|
2141
2679
|
_GameStepManager.restorLastLabelList();
|
|
2142
2680
|
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");
|
|
@@ -2180,8 +2718,15 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2180
2718
|
}
|
|
2181
2719
|
try {
|
|
2182
2720
|
if (labelId === CLOSE_LABEL_ID) {
|
|
2183
|
-
let
|
|
2184
|
-
|
|
2721
|
+
let closeCurrentLabel = newCloseLabel(choiseMade);
|
|
2722
|
+
let choice = {
|
|
2723
|
+
label: closeCurrentLabel,
|
|
2724
|
+
text: "",
|
|
2725
|
+
closeCurrentLabel: false,
|
|
2726
|
+
type: "close",
|
|
2727
|
+
props: {}
|
|
2728
|
+
};
|
|
2729
|
+
return _GameStepManager.closeChoiceMenu(choice, props);
|
|
2185
2730
|
}
|
|
2186
2731
|
let tempLabel = getLabelById(labelId);
|
|
2187
2732
|
if (!tempLabel) {
|
|
@@ -2231,8 +2776,15 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2231
2776
|
}
|
|
2232
2777
|
try {
|
|
2233
2778
|
if (labelId === CLOSE_LABEL_ID) {
|
|
2234
|
-
let
|
|
2235
|
-
|
|
2779
|
+
let closeCurrentLabel = newCloseLabel(choiseMade);
|
|
2780
|
+
let choice = {
|
|
2781
|
+
label: closeCurrentLabel,
|
|
2782
|
+
text: "",
|
|
2783
|
+
closeCurrentLabel: false,
|
|
2784
|
+
type: "close",
|
|
2785
|
+
props: {}
|
|
2786
|
+
};
|
|
2787
|
+
return _GameStepManager.closeChoiceMenu(choice, props);
|
|
2236
2788
|
}
|
|
2237
2789
|
let tempLabel = getLabelById(labelId);
|
|
2238
2790
|
if (!tempLabel) {
|
|
@@ -2248,7 +2800,8 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2248
2800
|
}
|
|
2249
2801
|
/**
|
|
2250
2802
|
* When the player is in a choice menu, can use this function to exit to the choice menu.
|
|
2251
|
-
* @param
|
|
2803
|
+
* @param choice
|
|
2804
|
+
* @param props
|
|
2252
2805
|
* @returns StepLabelResultType or undefined.
|
|
2253
2806
|
* @example
|
|
2254
2807
|
* ```typescript
|
|
@@ -2259,13 +2812,17 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2259
2812
|
* })
|
|
2260
2813
|
* ```
|
|
2261
2814
|
*/
|
|
2262
|
-
static closeChoiceMenu(
|
|
2815
|
+
static closeChoiceMenu(choice, props) {
|
|
2263
2816
|
return __async(this, null, function* () {
|
|
2817
|
+
let label = choice.label;
|
|
2264
2818
|
let choiseMade = void 0;
|
|
2265
2819
|
if (typeof label.choiseIndex === "number") {
|
|
2266
2820
|
choiseMade = label.choiseIndex;
|
|
2267
2821
|
}
|
|
2268
|
-
|
|
2822
|
+
if (choice.closeCurrentLabel) {
|
|
2823
|
+
_GameStepManager.closeCurrentLabel();
|
|
2824
|
+
}
|
|
2825
|
+
return _GameStepManager.goNext(props, choiseMade);
|
|
2269
2826
|
});
|
|
2270
2827
|
}
|
|
2271
2828
|
/* After Update Methods */
|
|
@@ -2593,15 +3150,15 @@ var DialogueBaseModel = class {
|
|
|
2593
3150
|
if (typeof text === "string") {
|
|
2594
3151
|
this.text = text;
|
|
2595
3152
|
if (typeof character === "string") {
|
|
2596
|
-
this.
|
|
3153
|
+
this.character = character;
|
|
2597
3154
|
} else {
|
|
2598
|
-
this.
|
|
3155
|
+
this.character = character == null ? void 0 : character.id;
|
|
2599
3156
|
}
|
|
2600
3157
|
this.oltherParams = oltherParams;
|
|
2601
3158
|
} else {
|
|
2602
3159
|
this.text = text.text;
|
|
2603
|
-
if (text.
|
|
2604
|
-
this.
|
|
3160
|
+
if (text.character) {
|
|
3161
|
+
this.character = text.character;
|
|
2605
3162
|
}
|
|
2606
3163
|
this.oltherParams = text.oltherParams || {};
|
|
2607
3164
|
}
|
|
@@ -2614,12 +3171,703 @@ var DialogueBaseModel = class {
|
|
|
2614
3171
|
export() {
|
|
2615
3172
|
return {
|
|
2616
3173
|
text: this.text,
|
|
2617
|
-
|
|
3174
|
+
character: this.character,
|
|
2618
3175
|
oltherParams: this.oltherParams
|
|
2619
3176
|
};
|
|
2620
3177
|
}
|
|
2621
3178
|
};
|
|
2622
3179
|
|
|
2623
|
-
|
|
3180
|
+
// src/labels/TestConstant.ts
|
|
3181
|
+
var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
|
|
3182
|
+
name: "Juliette",
|
|
3183
|
+
age: 25,
|
|
3184
|
+
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",
|
|
3185
|
+
color: "#ac0086"
|
|
3186
|
+
});
|
|
3187
|
+
saveCharacter(juliette);
|
|
3188
|
+
var eggHeadImage = "https://pixijs.com/assets/eggHead.png";
|
|
3189
|
+
var eggHeadName = `<span style="color:purple">Egg Head</span>`;
|
|
3190
|
+
var flowerTopImage = "https://pixijs.com/assets/flowerTop.png";
|
|
3191
|
+
var flowerTopName = `<span style="color:green">Flower Top</span>`;
|
|
3192
|
+
var helmlokImage = "https://pixijs.com/assets/helmlok.png";
|
|
3193
|
+
var helmlokName = `<span style="color:blue">Helmlok</span>`;
|
|
3194
|
+
var skullyImage = "https://pixijs.com/assets/skully.png";
|
|
3195
|
+
var skullyName = `<span style="color:red">Skully</span>`;
|
|
3196
|
+
var bunnyImage = "https://pixijs.com/assets/bunny.png";
|
|
3197
|
+
var bunnyName = `Bunny`;
|
|
3198
|
+
|
|
3199
|
+
// src/labels/CanvasEventsTestLabel.ts
|
|
3200
|
+
var EventTest1 = class extends CanvasEvent {
|
|
3201
|
+
fn(event, sprite) {
|
|
3202
|
+
if (event === "pointerdown") {
|
|
3203
|
+
sprite.scale.x *= 1.25;
|
|
3204
|
+
sprite.scale.y *= 1.25;
|
|
3205
|
+
}
|
|
3206
|
+
}
|
|
3207
|
+
};
|
|
3208
|
+
EventTest1 = __decorateClass([
|
|
3209
|
+
eventDecorator("___pixi_vn_canvas_events_test_event1___")
|
|
3210
|
+
], EventTest1);
|
|
3211
|
+
var EventTest2 = class extends CanvasEvent {
|
|
3212
|
+
constructor() {
|
|
3213
|
+
super(...arguments);
|
|
3214
|
+
this.textureButtonDown = Texture.from("https://pixijs.com/assets/button_down.png");
|
|
3215
|
+
this.textureButtonOver = Texture.from("https://pixijs.com/assets/button_over.png");
|
|
3216
|
+
this.textureButton = Texture.from("https://pixijs.com/assets/button.png");
|
|
3217
|
+
}
|
|
3218
|
+
fn(event, sprite) {
|
|
3219
|
+
if (event === "pointerdown") {
|
|
3220
|
+
sprite.isdown = true;
|
|
3221
|
+
sprite.texture = this.textureButtonDown;
|
|
3222
|
+
sprite.alpha = 1;
|
|
3223
|
+
} else if (event === "pointerup" || event === "pointerupoutside") {
|
|
3224
|
+
sprite.isdown = false;
|
|
3225
|
+
if (sprite.isOver) {
|
|
3226
|
+
sprite.texture = this.textureButtonOver;
|
|
3227
|
+
} else {
|
|
3228
|
+
sprite.texture = this.textureButton;
|
|
3229
|
+
}
|
|
3230
|
+
} else if (event === "pointerover") {
|
|
3231
|
+
sprite.isOver = true;
|
|
3232
|
+
if (sprite.isdown) {
|
|
3233
|
+
return;
|
|
3234
|
+
}
|
|
3235
|
+
sprite.texture = this.textureButtonOver;
|
|
3236
|
+
} else if (event === "pointerout") {
|
|
3237
|
+
sprite.isOver = false;
|
|
3238
|
+
if (sprite.isdown) {
|
|
3239
|
+
return;
|
|
3240
|
+
}
|
|
3241
|
+
sprite.texture = this.textureButton;
|
|
3242
|
+
}
|
|
3243
|
+
}
|
|
3244
|
+
};
|
|
3245
|
+
EventTest2 = __decorateClass([
|
|
3246
|
+
eventDecorator("___pixi_vn_canvas_events_test_event2___")
|
|
3247
|
+
], EventTest2);
|
|
3248
|
+
var CANVAS_EVENTS_TEST_LABEL = "___pixi_vn_canvas_events_test___";
|
|
3249
|
+
var canvasEventsTestLabel = newLabel(
|
|
3250
|
+
CANVAS_EVENTS_TEST_LABEL,
|
|
3251
|
+
[
|
|
3252
|
+
() => setDialogue({
|
|
3253
|
+
character: juliette,
|
|
3254
|
+
text: "This is the test of clickable elements in a canvas."
|
|
3255
|
+
}),
|
|
3256
|
+
() => __async(void 0, null, function* () {
|
|
3257
|
+
setDialogue({
|
|
3258
|
+
character: juliette,
|
|
3259
|
+
text: `This is my friend, ${bunnyName}. It's small now, but if you try to click on it it will get bigger and bigger. (This example is from the official [PixiJS website](https://pixijs.com/8.x/examples/events/click).)`
|
|
3260
|
+
});
|
|
3261
|
+
const texture = yield Assets.load(bunnyImage);
|
|
3262
|
+
const sprite = CanvasSprite.from(texture);
|
|
3263
|
+
sprite.anchor.set(0.5);
|
|
3264
|
+
sprite.x = GameWindowManager.screen.width / 2;
|
|
3265
|
+
sprite.y = GameWindowManager.screen.height / 2;
|
|
3266
|
+
sprite.eventMode = "static";
|
|
3267
|
+
sprite.cursor = "pointer";
|
|
3268
|
+
sprite.onEvent("pointerdown", EventTest1);
|
|
3269
|
+
GameWindowManager.addCanvasElement("bunny", sprite);
|
|
3270
|
+
}),
|
|
3271
|
+
() => __async(void 0, null, function* () {
|
|
3272
|
+
GameWindowManager.clear();
|
|
3273
|
+
setDialogue({
|
|
3274
|
+
character: juliette,
|
|
3275
|
+
text: `This is the test of buttons in a canvas. (This example is from the official [PixiJS website](https://pixijs.com/8.x/examples/events/interactivity).)`
|
|
3276
|
+
});
|
|
3277
|
+
yield Assets.load([
|
|
3278
|
+
"https://pixijs.com/assets/bg_button.jpg",
|
|
3279
|
+
"https://pixijs.com/assets/button.png",
|
|
3280
|
+
"https://pixijs.com/assets/button_down.png",
|
|
3281
|
+
"https://pixijs.com/assets/button_over.png"
|
|
3282
|
+
]);
|
|
3283
|
+
const background = CanvasSprite.from("https://pixijs.com/assets/bg_button.jpg");
|
|
3284
|
+
background.width = GameWindowManager.screen.width;
|
|
3285
|
+
background.height = GameWindowManager.screen.height;
|
|
3286
|
+
GameWindowManager.addCanvasElement("bg", background);
|
|
3287
|
+
const textureButton = Texture.from("https://pixijs.com/assets/button.png");
|
|
3288
|
+
const buttons = [];
|
|
3289
|
+
const buttonPositions = [175, 75, 655, 75, 410, 325, 150, 465, 685, 445];
|
|
3290
|
+
for (let i = 0; i < 5; i++) {
|
|
3291
|
+
const button = new CanvasSprite(textureButton);
|
|
3292
|
+
button.anchor.set(0.5);
|
|
3293
|
+
button.x = buttonPositions[i * 2];
|
|
3294
|
+
button.y = buttonPositions[i * 2 + 1];
|
|
3295
|
+
button.eventMode = "static";
|
|
3296
|
+
button.cursor = "pointer";
|
|
3297
|
+
button.onEvent("pointerdown", EventTest2).onEvent("pointerup", EventTest2).onEvent("pointerupoutside", EventTest2).onEvent("pointerover", EventTest2).onEvent("pointerout", EventTest2);
|
|
3298
|
+
GameWindowManager.addCanvasElement("button" + i, button);
|
|
3299
|
+
buttons.push(button);
|
|
3300
|
+
}
|
|
3301
|
+
buttons[0].scale.set(1.2);
|
|
3302
|
+
buttons[2].rotation = Math.PI / 10;
|
|
3303
|
+
buttons[3].scale.set(0.8);
|
|
3304
|
+
buttons[4].scale.set(0.8, 1.2);
|
|
3305
|
+
buttons[4].rotation = Math.PI;
|
|
3306
|
+
})
|
|
3307
|
+
]
|
|
3308
|
+
);
|
|
3309
|
+
var AlienTintingTest = class extends CanvasSprite {
|
|
3310
|
+
constructor() {
|
|
3311
|
+
super(...arguments);
|
|
3312
|
+
this.direction = 0;
|
|
3313
|
+
this.turningSpeed = 0;
|
|
3314
|
+
this.speed = 0;
|
|
3315
|
+
}
|
|
3316
|
+
get memory() {
|
|
3317
|
+
return __spreadProps(__spreadValues({}, super.memory), {
|
|
3318
|
+
direction: this.direction,
|
|
3319
|
+
turningSpeed: this.turningSpeed,
|
|
3320
|
+
speed: this.speed
|
|
3321
|
+
});
|
|
3322
|
+
}
|
|
3323
|
+
set memory(memory) {
|
|
3324
|
+
super.memory = memory;
|
|
3325
|
+
this.direction = memory.direction;
|
|
3326
|
+
this.turningSpeed = memory.turningSpeed;
|
|
3327
|
+
this.speed = memory.speed;
|
|
3328
|
+
}
|
|
3329
|
+
static from(source, skipCache) {
|
|
3330
|
+
let sprite = Sprite.from(source, skipCache);
|
|
3331
|
+
let mySprite = new AlienTintingTest();
|
|
3332
|
+
mySprite.texture = sprite.texture;
|
|
3333
|
+
return mySprite;
|
|
3334
|
+
}
|
|
3335
|
+
};
|
|
3336
|
+
AlienTintingTest = __decorateClass([
|
|
3337
|
+
canvasElementDecorator("___pixi_vn_custom_canvas_element___")
|
|
3338
|
+
], AlienTintingTest);
|
|
3339
|
+
var TintingTestTicker = class extends TickerBase {
|
|
3340
|
+
constructor() {
|
|
3341
|
+
super({});
|
|
3342
|
+
}
|
|
3343
|
+
fn(_t, _args, tags) {
|
|
3344
|
+
tags.forEach((tag) => {
|
|
3345
|
+
const dudeBoundsPadding = 100;
|
|
3346
|
+
const dudeBounds = new Rectangle(
|
|
3347
|
+
-dudeBoundsPadding,
|
|
3348
|
+
-dudeBoundsPadding,
|
|
3349
|
+
GameWindowManager.screen.width + dudeBoundsPadding * 2,
|
|
3350
|
+
GameWindowManager.screen.height + dudeBoundsPadding * 2
|
|
3351
|
+
);
|
|
3352
|
+
let dude = GameWindowManager.getCanvasElement(tag);
|
|
3353
|
+
if (dude && dude instanceof AlienTintingTest) {
|
|
3354
|
+
dude.direction += dude.turningSpeed * 0.01;
|
|
3355
|
+
dude.x += Math.sin(dude.direction) * dude.speed;
|
|
3356
|
+
dude.y += Math.cos(dude.direction) * dude.speed;
|
|
3357
|
+
dude.rotation = -dude.direction - Math.PI / 2;
|
|
3358
|
+
if (dude.x < dudeBounds.x) {
|
|
3359
|
+
dude.x += dudeBounds.width;
|
|
3360
|
+
} else if (dude.x > dudeBounds.x + dudeBounds.width) {
|
|
3361
|
+
dude.x -= dudeBounds.width;
|
|
3362
|
+
}
|
|
3363
|
+
if (dude.y < dudeBounds.y) {
|
|
3364
|
+
dude.y += dudeBounds.height;
|
|
3365
|
+
} else if (dude.y > dudeBounds.y + dudeBounds.height) {
|
|
3366
|
+
dude.y -= dudeBounds.height;
|
|
3367
|
+
}
|
|
3368
|
+
}
|
|
3369
|
+
});
|
|
3370
|
+
}
|
|
3371
|
+
};
|
|
3372
|
+
TintingTestTicker = __decorateClass([
|
|
3373
|
+
tickerDecorator("___pixi_vn_custom_ticker___")
|
|
3374
|
+
], TintingTestTicker);
|
|
3375
|
+
var CUSTOM_TICKER_CANVAS_ELEMENT_TEST_LABEL = "___pixi_vn_custom_ticker_canvas_element_test___";
|
|
3376
|
+
var customTickerCanvasElementTestLabel = newLabel(
|
|
3377
|
+
CUSTOM_TICKER_CANVAS_ELEMENT_TEST_LABEL,
|
|
3378
|
+
[
|
|
3379
|
+
() => __async(void 0, null, function* () {
|
|
3380
|
+
const totalDudes = 100;
|
|
3381
|
+
for (let i = 0; i < totalDudes; i++) {
|
|
3382
|
+
const texture = yield Assets.load(eggHeadImage);
|
|
3383
|
+
const dude = AlienTintingTest.from(texture);
|
|
3384
|
+
dude.anchor.set(0.5);
|
|
3385
|
+
dude.scale.set(0.8 + Math.random() * 0.3);
|
|
3386
|
+
dude.x = Math.random() * GameWindowManager.screen.width;
|
|
3387
|
+
dude.y = Math.random() * GameWindowManager.screen.height;
|
|
3388
|
+
dude.tint = Math.random() * 16777215;
|
|
3389
|
+
dude.direction = Math.random() * Math.PI * 2;
|
|
3390
|
+
dude.turningSpeed = Math.random() - 0.8;
|
|
3391
|
+
dude.speed = 2 + Math.random() * 2;
|
|
3392
|
+
GameWindowManager.addCanvasElement("alien" + i, dude);
|
|
3393
|
+
GameWindowManager.addTicker("alien" + i, new TintingTestTicker());
|
|
3394
|
+
}
|
|
3395
|
+
setDialogue({
|
|
3396
|
+
character: juliette,
|
|
3397
|
+
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).)`
|
|
3398
|
+
});
|
|
3399
|
+
})
|
|
3400
|
+
]
|
|
3401
|
+
);
|
|
3402
|
+
|
|
3403
|
+
// src/labels/ImagesAnimationsTestLabel.ts
|
|
3404
|
+
var IMAGE_ANIMAIONS_TEST_LABEL = "___pixi_vn_images_animations_test___";
|
|
3405
|
+
var imagesAnimationsTest = newLabel(IMAGE_ANIMAIONS_TEST_LABEL, [
|
|
3406
|
+
() => __async(void 0, null, function* () {
|
|
3407
|
+
setDialogue({ character: juliette, text: `These are my 4 puppets: ${eggHeadName}, ${flowerTopName}, ${helmlokName} and ${skullyName}. They can appear, disappear and animate at my will.` });
|
|
3408
|
+
let eggHead = addImage("eggHead", eggHeadImage);
|
|
3409
|
+
yield eggHead.load();
|
|
3410
|
+
eggHead.x = 100;
|
|
3411
|
+
eggHead.y = 100;
|
|
3412
|
+
let flowerTop = addImage("flowerTop", flowerTopImage);
|
|
3413
|
+
flowerTop.x = 300;
|
|
3414
|
+
flowerTop.y = 100;
|
|
3415
|
+
flowerTop.load();
|
|
3416
|
+
let helmlok = addImage("helmlok", helmlokImage);
|
|
3417
|
+
helmlok.x = 100;
|
|
3418
|
+
helmlok.y = 300;
|
|
3419
|
+
let skully = addImage("skully", skullyImage);
|
|
3420
|
+
skully.x = 300;
|
|
3421
|
+
skully.y = 300;
|
|
3422
|
+
yield loadImage([helmlok, skully]);
|
|
3423
|
+
}),
|
|
3424
|
+
() => __async(void 0, null, function* () {
|
|
3425
|
+
setDialogue({ character: juliette, text: "Here's what they can do." });
|
|
3426
|
+
setChoiceMenuOptions([
|
|
3427
|
+
new ChoiceMenuOption("Dissolve effect", imagesDissolveTest),
|
|
3428
|
+
new ChoiceMenuOption("Fade effect", imagesFadeTest),
|
|
3429
|
+
new ChoiceMenuOption("Rotate", imagesRotateTest),
|
|
3430
|
+
new ChoiceMenuOption("Move", imagesMoveTest),
|
|
3431
|
+
new ChoiceMenuOption("Zoom", imagesZoomTest),
|
|
3432
|
+
new ChoiceMenuOption("Move in/out", imagesMoveInOutTest),
|
|
3433
|
+
new ChoiceMenuOption("Zoom in/out", imagesZoomInOutTest),
|
|
3434
|
+
new ChoiceMenuOptionClose("Cancel", true)
|
|
3435
|
+
]);
|
|
3436
|
+
}),
|
|
3437
|
+
(props) => GameStepManager.jumpLabel(IMAGE_ANIMAIONS_TEST_LABEL, props)
|
|
3438
|
+
]);
|
|
3439
|
+
var imagesDissolveTest = newLabel("___pixi_vn_images_dissolve_test___", [
|
|
3440
|
+
() => {
|
|
3441
|
+
setDialogue({
|
|
3442
|
+
character: juliette,
|
|
3443
|
+
text: `Here's what's going to happen:
|
|
3444
|
+
- ${eggHeadName} will disappear with a dissolve effect. If you go next, ${eggHeadName} reappears with a dissolve effect without stopping the dissolve effect
|
|
3445
|
+
- ${eggHeadName} will appear instead of ${flowerTopName}.
|
|
3446
|
+
- ${helmlokName} will disappear with a fade effect and reappear with a fade effect, and repeat.
|
|
3447
|
+
- ${skullyName} will disappear with a fade effect, wait for 0.5 seconds, and reappear with a fade effect.`
|
|
3448
|
+
});
|
|
3449
|
+
removeWithDissolveTransition(["eggHead"], { duration: 2 });
|
|
3450
|
+
let eggHead = new CanvasImage({ x: 300, y: 100 }, eggHeadImage);
|
|
3451
|
+
showWithDissolveTransition("flowerTop", eggHead, { duration: 1 });
|
|
3452
|
+
GameWindowManager.addTickersSteps(
|
|
3453
|
+
"helmlok",
|
|
3454
|
+
[
|
|
3455
|
+
new FadeAlphaTicker({
|
|
3456
|
+
duration: 1,
|
|
3457
|
+
type: "hide"
|
|
3458
|
+
}, 1),
|
|
3459
|
+
new FadeAlphaTicker({
|
|
3460
|
+
duration: 1,
|
|
3461
|
+
type: "show"
|
|
3462
|
+
}, 1),
|
|
3463
|
+
Repeat
|
|
3464
|
+
]
|
|
3465
|
+
);
|
|
3466
|
+
GameWindowManager.addTickersSteps(
|
|
3467
|
+
"skully",
|
|
3468
|
+
[
|
|
3469
|
+
new FadeAlphaTicker({
|
|
3470
|
+
duration: 0.5,
|
|
3471
|
+
type: "hide",
|
|
3472
|
+
limit: 0.3
|
|
3473
|
+
}, 1),
|
|
3474
|
+
Pause(0.5),
|
|
3475
|
+
new FadeAlphaTicker({
|
|
3476
|
+
duration: 1,
|
|
3477
|
+
type: "show"
|
|
3478
|
+
}, 1)
|
|
3479
|
+
]
|
|
3480
|
+
);
|
|
3481
|
+
},
|
|
3482
|
+
() => __async(void 0, null, function* () {
|
|
3483
|
+
showWithDissolveTransition("eggHead", eggHeadImage, { duration: 0.5 });
|
|
3484
|
+
})
|
|
3485
|
+
]);
|
|
3486
|
+
var imagesFadeTest = newLabel("___pixi_vn_images_fade_test___", [
|
|
3487
|
+
() => {
|
|
3488
|
+
setDialogue({
|
|
3489
|
+
character: juliette,
|
|
3490
|
+
text: `Here's what's going to happen:
|
|
3491
|
+
- ${eggHeadName} will disappear with a dissolve effect. If you go next, ${eggHeadName} reappears with a dissolve effect with stopping the dissolve effect
|
|
3492
|
+
- ${eggHeadName} will appear instead of ${flowerTopName}.
|
|
3493
|
+
- ${helmlokName} will disappear with a fade effect and reappear with a fade effect, and repeat.
|
|
3494
|
+
- ${skullyName} will disappear with a fade effect, wait for 0.5 seconds, and reappear with a fade effect.`
|
|
3495
|
+
});
|
|
3496
|
+
removeWithFadeTransition(["eggHead"], { duration: 2 });
|
|
3497
|
+
let eggHead = new CanvasImage({ x: 300, y: 100 }, eggHeadImage);
|
|
3498
|
+
showWithFadeTransition("flowerTop", eggHead, { duration: 1 });
|
|
3499
|
+
GameWindowManager.addTickersSteps(
|
|
3500
|
+
"helmlok",
|
|
3501
|
+
[
|
|
3502
|
+
new FadeAlphaTicker({
|
|
3503
|
+
duration: 1,
|
|
3504
|
+
type: "hide"
|
|
3505
|
+
}),
|
|
3506
|
+
new FadeAlphaTicker({
|
|
3507
|
+
duration: 1,
|
|
3508
|
+
type: "show"
|
|
3509
|
+
}),
|
|
3510
|
+
Repeat
|
|
3511
|
+
]
|
|
3512
|
+
);
|
|
3513
|
+
GameWindowManager.addTickersSteps(
|
|
3514
|
+
"skully",
|
|
3515
|
+
[
|
|
3516
|
+
new FadeAlphaTicker({
|
|
3517
|
+
duration: 0.5,
|
|
3518
|
+
type: "hide",
|
|
3519
|
+
limit: 0.3
|
|
3520
|
+
}),
|
|
3521
|
+
Pause(0.5),
|
|
3522
|
+
new FadeAlphaTicker({
|
|
3523
|
+
duration: 1,
|
|
3524
|
+
type: "show"
|
|
3525
|
+
})
|
|
3526
|
+
]
|
|
3527
|
+
);
|
|
3528
|
+
},
|
|
3529
|
+
() => __async(void 0, null, function* () {
|
|
3530
|
+
let eggHeadOld = GameWindowManager.getCanvasElement("eggHead");
|
|
3531
|
+
if (eggHeadOld)
|
|
3532
|
+
eggHeadOld.alpha = 0;
|
|
3533
|
+
showWithFadeTransition("eggHead", eggHeadImage, { duration: 0.5 });
|
|
3534
|
+
})
|
|
3535
|
+
]);
|
|
3536
|
+
var imagesRotateTest = newLabel("___pixi_vn_images_rotate_test___", [
|
|
3537
|
+
() => {
|
|
3538
|
+
setDialogue({
|
|
3539
|
+
character: juliette,
|
|
3540
|
+
text: `Here's what's going to happen:
|
|
3541
|
+
- ${eggHeadName} will rotate with a anchor set to 0.
|
|
3542
|
+
- ${flowerTopName} will rotate with a anchor set to 0.5 and a exponential speed progression.
|
|
3543
|
+
- ${helmlokName} will rotate with a anchor set to 0.5, rotate 2 times, move to the right, rotate 5 times, and repeat.
|
|
3544
|
+
- ${skullyName} will rotate with a anchor set to 1, rotate 3 times, wait for 0.5 seconds, rotate 7 times.`
|
|
3545
|
+
});
|
|
3546
|
+
let eggHead = GameWindowManager.getCanvasElement("eggHead");
|
|
3547
|
+
if (eggHead)
|
|
3548
|
+
eggHead.anchor.set(0);
|
|
3549
|
+
let flowerTop = GameWindowManager.getCanvasElement("flowerTop");
|
|
3550
|
+
if (flowerTop)
|
|
3551
|
+
flowerTop.anchor.set(0.5);
|
|
3552
|
+
let helmlok = GameWindowManager.getCanvasElement("helmlok");
|
|
3553
|
+
if (helmlok)
|
|
3554
|
+
helmlok.anchor.set(0.5);
|
|
3555
|
+
let skully = GameWindowManager.getCanvasElement("skully");
|
|
3556
|
+
if (skully)
|
|
3557
|
+
skully.anchor.set(1);
|
|
3558
|
+
GameWindowManager.addTicker("eggHead", new RotateTicker({
|
|
3559
|
+
speed: 6,
|
|
3560
|
+
clockwise: true
|
|
3561
|
+
}));
|
|
3562
|
+
GameWindowManager.addTicker("flowerTop", new RotateTicker({
|
|
3563
|
+
speed: 6,
|
|
3564
|
+
clockwise: false,
|
|
3565
|
+
speedProgression: { type: "exponential", percentage: 0.01, limit: 300 }
|
|
3566
|
+
}));
|
|
3567
|
+
GameWindowManager.addTickersSteps("helmlok", [
|
|
3568
|
+
new RotateTicker({
|
|
3569
|
+
speed: 6,
|
|
3570
|
+
clockwise: true
|
|
3571
|
+
}, 2),
|
|
3572
|
+
new RotateTicker({
|
|
3573
|
+
speed: 100,
|
|
3574
|
+
clockwise: false,
|
|
3575
|
+
speedProgression: { type: "exponential", percentage: -0.05 }
|
|
3576
|
+
}),
|
|
3577
|
+
Repeat
|
|
3578
|
+
]);
|
|
3579
|
+
GameWindowManager.addTickersSteps("skully", [
|
|
3580
|
+
new RotateTicker({
|
|
3581
|
+
speed: 6,
|
|
3582
|
+
clockwise: true
|
|
3583
|
+
}, 3),
|
|
3584
|
+
Pause(0.5),
|
|
3585
|
+
new RotateTicker({
|
|
3586
|
+
speed: 6,
|
|
3587
|
+
clockwise: false
|
|
3588
|
+
}, 7)
|
|
3589
|
+
]);
|
|
3590
|
+
}
|
|
3591
|
+
]);
|
|
3592
|
+
var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
3593
|
+
() => {
|
|
3594
|
+
setDialogue({
|
|
3595
|
+
character: juliette,
|
|
3596
|
+
text: `Here's what's going to happen:
|
|
3597
|
+
- ${eggHeadName} will move to { x: 500, y: 100 } with a speed of 0.4.
|
|
3598
|
+
- ${flowerTopName} will move to { x: 500, y: 300 } with a speed of 0.3.
|
|
3599
|
+
- ${helmlokName} will move to the right with a speed of 20 and a linear speed progression of -0.2, and then move to the left with a speed of 0.1 and a linear speed progression of 0.05.
|
|
3600
|
+
- ${skullyName} will move to { x: 500, y: 500 } with a speed of 0.5, wait for 0.5 seconds, and move to { x: 100, y: 100 } with a speed of 0.5.`
|
|
3601
|
+
});
|
|
3602
|
+
GameWindowManager.addTicker("eggHead", new MoveTicker({
|
|
3603
|
+
destination: { x: 500, y: 100 },
|
|
3604
|
+
speed: 24
|
|
3605
|
+
}));
|
|
3606
|
+
GameWindowManager.addTicker("flowerTop", new MoveTicker({
|
|
3607
|
+
destination: { x: 500, y: 300 },
|
|
3608
|
+
speed: 18
|
|
3609
|
+
}));
|
|
3610
|
+
GameWindowManager.addTickersSteps("helmlok", [
|
|
3611
|
+
new MoveTicker({
|
|
3612
|
+
destination: { x: 100, y: 500 },
|
|
3613
|
+
speed: 1200,
|
|
3614
|
+
speedProgression: { type: "linear", amt: -12, limit: 60 }
|
|
3615
|
+
}),
|
|
3616
|
+
new MoveTicker({
|
|
3617
|
+
destination: { x: 1700, y: 500 },
|
|
3618
|
+
speed: 6,
|
|
3619
|
+
speedProgression: { type: "linear", amt: 3 }
|
|
3620
|
+
}),
|
|
3621
|
+
Repeat
|
|
3622
|
+
]);
|
|
3623
|
+
GameWindowManager.addTickersSteps("skully", [
|
|
3624
|
+
new MoveTicker({
|
|
3625
|
+
destination: { x: 500, y: 500 },
|
|
3626
|
+
speed: 60
|
|
3627
|
+
}),
|
|
3628
|
+
Pause(0.5),
|
|
3629
|
+
new MoveTicker({
|
|
3630
|
+
destination: { x: 100, y: 100 },
|
|
3631
|
+
speed: 60
|
|
3632
|
+
})
|
|
3633
|
+
]);
|
|
3634
|
+
}
|
|
3635
|
+
]);
|
|
3636
|
+
var imagesZoomTest = newLabel("___pixi_vn_images_zoom_test___", [
|
|
3637
|
+
() => {
|
|
3638
|
+
setDialogue({
|
|
3639
|
+
character: juliette,
|
|
3640
|
+
text: `Here's what's going to happen:
|
|
3641
|
+
- ${eggHeadName} will zoom out with a speed of 3 and a limit of -0.5.
|
|
3642
|
+
- ${flowerTopName} will zoom in with a speed of 3 and a limit of 2.
|
|
3643
|
+
- ${helmlokName} will unzoom with a speed of 3 and a limit of -1, and zoom in with a speed of 3 and a limit of 1, and repeat.
|
|
3644
|
+
- ${skullyName} will zoom in with a speed of 0.1 and a limit of 5, wait for 0.5 seconds, and zoom out with a speed of 3 and a limit of 1.`
|
|
3645
|
+
});
|
|
3646
|
+
let eggHead = GameWindowManager.getCanvasElement("eggHead");
|
|
3647
|
+
if (eggHead)
|
|
3648
|
+
eggHead.scale.set(2);
|
|
3649
|
+
let helmlok = GameWindowManager.getCanvasElement("helmlok");
|
|
3650
|
+
if (helmlok)
|
|
3651
|
+
helmlok.anchor.set(0.5);
|
|
3652
|
+
GameWindowManager.addTicker("eggHead", new ZoomTicker({
|
|
3653
|
+
speed: 3,
|
|
3654
|
+
limit: -0.5,
|
|
3655
|
+
type: "unzoom"
|
|
3656
|
+
}));
|
|
3657
|
+
GameWindowManager.addTicker("flowerTop", new ZoomTicker({
|
|
3658
|
+
speed: 3,
|
|
3659
|
+
limit: 2
|
|
3660
|
+
}));
|
|
3661
|
+
GameWindowManager.addTickersSteps("helmlok", [
|
|
3662
|
+
new ZoomTicker({
|
|
3663
|
+
speed: 3,
|
|
3664
|
+
limit: -1,
|
|
3665
|
+
type: "unzoom"
|
|
3666
|
+
}),
|
|
3667
|
+
new ZoomTicker({
|
|
3668
|
+
speed: 3,
|
|
3669
|
+
limit: 1
|
|
3670
|
+
}),
|
|
3671
|
+
Repeat
|
|
3672
|
+
]);
|
|
3673
|
+
GameWindowManager.addTickersSteps("skully", [
|
|
3674
|
+
new ZoomTicker({
|
|
3675
|
+
speed: 0.1,
|
|
3676
|
+
limit: 5,
|
|
3677
|
+
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3678
|
+
}),
|
|
3679
|
+
Pause(0.5),
|
|
3680
|
+
new ZoomTicker({
|
|
3681
|
+
"type": "unzoom",
|
|
3682
|
+
speed: 3,
|
|
3683
|
+
limit: 1
|
|
3684
|
+
})
|
|
3685
|
+
]);
|
|
3686
|
+
}
|
|
3687
|
+
]);
|
|
3688
|
+
var imagesMoveInOutTest = newLabel("___pixi_vn_images_move_in_out_test___", [
|
|
3689
|
+
() => __async(void 0, null, function* () {
|
|
3690
|
+
setDialogue({
|
|
3691
|
+
character: juliette,
|
|
3692
|
+
text: `Here's what's going to happen:
|
|
3693
|
+
- ${eggHeadName} will move in from the top with a speed of 800. If you go next, ${eggHeadName} will move out from the bottom with a speed of 800.
|
|
3694
|
+
- ${flowerTopName} will move in from the right with a speed of 800 and a speed progression of 0.02. If you go next, ${flowerTopName} will move out from the left with a speed of 800 and a speed progression of 0.02.
|
|
3695
|
+
- ${helmlokName} will move in from the left with a speed of 800. If you go next, ${helmlokName} will move out from the right with a speed of 800.
|
|
3696
|
+
- ${skullyName} will move in from the bottom with a speed of 800 and a speed progression of 0.02. If you go next, ${skullyName} will move out from the top with a speed of 800 and a speed progression of 0.02.`
|
|
3697
|
+
});
|
|
3698
|
+
let eggHead = new CanvasImage({ x: 100, y: 100 }, eggHeadImage);
|
|
3699
|
+
let flowerTop = new CanvasImage({ x: 300, y: 100 }, flowerTopImage);
|
|
3700
|
+
let helmlok = new CanvasImage({ x: 100, y: 300 }, helmlokImage);
|
|
3701
|
+
let skully = new CanvasImage({ x: 300, y: 300 }, skullyImage);
|
|
3702
|
+
moveIn("eggHead", eggHead, { speed: 800, direction: "down" });
|
|
3703
|
+
moveIn("flowerTop", flowerTop, {
|
|
3704
|
+
speed: 800,
|
|
3705
|
+
direction: "left",
|
|
3706
|
+
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3707
|
+
});
|
|
3708
|
+
moveIn("helmlok", helmlok, { speed: 800, direction: "right" });
|
|
3709
|
+
moveIn("skully", skully, {
|
|
3710
|
+
speed: 800,
|
|
3711
|
+
direction: "up",
|
|
3712
|
+
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3713
|
+
});
|
|
3714
|
+
}),
|
|
3715
|
+
() => {
|
|
3716
|
+
moveOut("eggHead", { speed: 800, direction: "down" });
|
|
3717
|
+
moveOut("flowerTop", { speed: 800, direction: "left" });
|
|
3718
|
+
moveOut("helmlok", { speed: 800, direction: "right" });
|
|
3719
|
+
moveOut("skully", { speed: 800, direction: "up" });
|
|
3720
|
+
}
|
|
3721
|
+
]);
|
|
3722
|
+
var imagesZoomInOutTest = newLabel("___pixi_vn_images_zoom_in_out_test___", [
|
|
3723
|
+
() => __async(void 0, null, function* () {
|
|
3724
|
+
GameWindowManager.removeCanvasElements();
|
|
3725
|
+
let eggHead = new CanvasImage({ x: 100, y: 100 }, eggHeadImage);
|
|
3726
|
+
let flowerTop = new CanvasImage({ x: 300, y: 100 }, flowerTopImage);
|
|
3727
|
+
let helmlok = new CanvasImage({ x: 100, y: 300 }, helmlokImage);
|
|
3728
|
+
let skully = new CanvasImage({ x: 300, y: 300 }, skullyImage);
|
|
3729
|
+
zoomIn("eggHead", eggHead, { speed: 3, direction: "down" });
|
|
3730
|
+
zoomIn("flowerTop", flowerTop, {
|
|
3731
|
+
speed: 3,
|
|
3732
|
+
direction: "left",
|
|
3733
|
+
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3734
|
+
});
|
|
3735
|
+
zoomIn("helmlok", helmlok, { speed: 3, direction: "right" });
|
|
3736
|
+
zoomIn("skully", skully, {
|
|
3737
|
+
speed: 3,
|
|
3738
|
+
direction: "up",
|
|
3739
|
+
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3740
|
+
});
|
|
3741
|
+
}),
|
|
3742
|
+
() => __async(void 0, null, function* () {
|
|
3743
|
+
zoomOut("eggHead", {
|
|
3744
|
+
speed: 3,
|
|
3745
|
+
direction: "down",
|
|
3746
|
+
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3747
|
+
});
|
|
3748
|
+
zoomOut("flowerTop", { speed: 3, direction: "left" });
|
|
3749
|
+
zoomOut("helmlok", { speed: 3, direction: "right" });
|
|
3750
|
+
zoomOut("skully", {
|
|
3751
|
+
speed: 3,
|
|
3752
|
+
direction: "up",
|
|
3753
|
+
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3754
|
+
});
|
|
3755
|
+
})
|
|
3756
|
+
]);
|
|
3757
|
+
|
|
3758
|
+
// src/labels/MarkdownTest.ts
|
|
3759
|
+
var MARKDOWN_TEST_LABEL = "___pixi_vn_markdown_test___";
|
|
3760
|
+
var markdownTest = newLabel(MARKDOWN_TEST_LABEL, [
|
|
3761
|
+
() => __async(void 0, null, function* () {
|
|
3762
|
+
setDialogue({
|
|
3763
|
+
character: juliette,
|
|
3764
|
+
text: `
|
|
3765
|
+
# Markdown Test
|
|
3766
|
+
|
|
3767
|
+
Hello, this is a test of the markdown parser. Pixi'VN does not manage markdown, but you can implement a markdown parser to display text with markdown syntax.
|
|
3768
|
+
|
|
3769
|
+
For example in React, you can use the library [react-markdown](https://www.npmjs.com/package/react-markdown).
|
|
3770
|
+
|
|
3771
|
+
## Colored Text
|
|
3772
|
+
|
|
3773
|
+
<span style="color:blue">some *blue* text</span>.
|
|
3774
|
+
|
|
3775
|
+
<span style="color:red">some *red* text</span>.
|
|
3776
|
+
|
|
3777
|
+
<span style="color:green">some *green* text</span>.
|
|
3778
|
+
|
|
3779
|
+
## Bold Text
|
|
3780
|
+
|
|
3781
|
+
**This is bold text.**
|
|
3782
|
+
|
|
3783
|
+
## Italic Text
|
|
3784
|
+
|
|
3785
|
+
*This is italic text.*
|
|
3786
|
+
|
|
3787
|
+
## Delete Text
|
|
3788
|
+
|
|
3789
|
+
~~This is deleted text.~~
|
|
3790
|
+
|
|
3791
|
+
## Link Test
|
|
3792
|
+
|
|
3793
|
+
[Link to Google](https://www.google.com)
|
|
3794
|
+
|
|
3795
|
+
## H2 Test
|
|
3796
|
+
|
|
3797
|
+
### H3 Test
|
|
3798
|
+
|
|
3799
|
+
#### H4 Test
|
|
3800
|
+
|
|
3801
|
+
## Code Test
|
|
3802
|
+
|
|
3803
|
+
\`Hello World\`
|
|
3804
|
+
|
|
3805
|
+
\`\`\`js
|
|
3806
|
+
console.log("Hello World")
|
|
3807
|
+
\`\`\`
|
|
3808
|
+
|
|
3809
|
+
## List Test
|
|
3810
|
+
|
|
3811
|
+
- Item 1
|
|
3812
|
+
* Item 2
|
|
3813
|
+
- [x] Item 3
|
|
3814
|
+
|
|
3815
|
+
## Table Test
|
|
3816
|
+
|
|
3817
|
+
| Header 1 | Header 2 |
|
|
3818
|
+
| -------- | -------- |
|
|
3819
|
+
| Cell 1 | Cell 2 |
|
|
3820
|
+
|
|
3821
|
+
## Separator Test
|
|
3822
|
+
|
|
3823
|
+
***
|
|
3824
|
+
Footer
|
|
3825
|
+
|
|
3826
|
+
`
|
|
3827
|
+
});
|
|
3828
|
+
})
|
|
3829
|
+
]);
|
|
3830
|
+
|
|
3831
|
+
// src/labels/StartLabel.ts
|
|
3832
|
+
var pixivnTestStartLabel = newLabel(
|
|
3833
|
+
"___pixi_vn_example_start_label___",
|
|
3834
|
+
[
|
|
3835
|
+
() => {
|
|
3836
|
+
let currentTimeName = "";
|
|
3837
|
+
const hour = (/* @__PURE__ */ new Date()).getHours();
|
|
3838
|
+
if (hour >= 5 && hour < 12) {
|
|
3839
|
+
currentTimeName = "morning";
|
|
3840
|
+
} else if (hour >= 12 && hour < 18) {
|
|
3841
|
+
currentTimeName = "afternoon";
|
|
3842
|
+
} else if (hour >= 18 && hour < 22) {
|
|
3843
|
+
currentTimeName = "evening";
|
|
3844
|
+
} else {
|
|
3845
|
+
currentTimeName = "night";
|
|
3846
|
+
}
|
|
3847
|
+
setDialogue({ character: juliette, text: `Good ${currentTimeName}! I'm ${juliette.name}, your virtual assistant. I'm here to help you with your tests.` });
|
|
3848
|
+
},
|
|
3849
|
+
() => setDialogue({ character: juliette, text: `You are running the Pixi\u2019VN test. This test will guide you through the different features of the library.` }),
|
|
3850
|
+
(props) => GameStepManager.jumpLabel(pixivnTestStartLabel2, props)
|
|
3851
|
+
]
|
|
3852
|
+
);
|
|
3853
|
+
var RESTART_TEST_LABEL = "___pixi_vn_restart_test_label___";
|
|
3854
|
+
var pixivnTestStartLabel2 = newLabel(
|
|
3855
|
+
RESTART_TEST_LABEL,
|
|
3856
|
+
[
|
|
3857
|
+
() => {
|
|
3858
|
+
GameWindowManager.clear();
|
|
3859
|
+
setDialogue({ character: juliette, text: "Which test would you like to start with?" });
|
|
3860
|
+
setChoiceMenuOptions([
|
|
3861
|
+
new ChoiceMenuOption("Images, Transitions and Animations Test", imagesAnimationsTest),
|
|
3862
|
+
new ChoiceMenuOption("Canvas Events Test Label", canvasEventsTestLabel),
|
|
3863
|
+
new ChoiceMenuOption("Custom Ticker Canvas Element Test", customTickerCanvasElementTestLabel),
|
|
3864
|
+
new ChoiceMenuOption("Markdown Test", markdownTest)
|
|
3865
|
+
]);
|
|
3866
|
+
},
|
|
3867
|
+
(props) => GameStepManager.jumpLabel(RESTART_TEST_LABEL, props)
|
|
3868
|
+
]
|
|
3869
|
+
);
|
|
3870
|
+
|
|
3871
|
+
export { CanvasBase, CanvasContainer, CanvasEvent, CanvasImage, CanvasSprite, CanvasText, CharacterBaseModel2 as CharacterBaseModel, ChoiceMenuOption, ChoiceMenuOptionClose, Close, DialogueBaseModel, FadeAlphaTicker, GameStepManager, GameStorageManager, GameWindowManager, Label, MoveTicker, Pause, Repeat, RotateTicker, StoredClassModel, TickerBase, ZoomTicker, addImage, canvasElementDecorator, clearAllGameDatas, clearChoiceMenuOptions, clearDialogue, eventDecorator, getAllCharacters, getCharacterById, getChoiceMenuOptions, getDialogue, getDialogueHistory, getFlag, getLabelById, getSaveData, getSaveJson, getTexture, juliette, loadImage, loadSaveData, loadSaveJson, moveIn, moveOut, newLabel, pixivnTestStartLabel, removeCanvasElement, removeWithDissolveTransition, removeWithFadeTransition, saveCharacter, setChoiceMenuOptions, setDialogue, setFlag, showImage, showWithDissolveTransition, showWithFadeTransition, tickerDecorator, zoomIn, zoomOut };
|
|
2624
3872
|
//# sourceMappingURL=out.js.map
|
|
2625
3873
|
//# sourceMappingURL=index.mjs.map
|