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