@drincs/pixi-vn 0.6.3 → 0.6.5
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/README.md +8 -5
- package/dist/LabelProps-CFV-zRjG.d.ts +113 -0
- package/dist/LabelProps-CmRpvUJm.d.mts +113 -0
- package/dist/classes/CharacterBaseModel.js +42 -33
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +42 -33
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +68 -8
- package/dist/classes/ChoiceMenuOption.d.ts +68 -8
- package/dist/classes/ChoiceMenuOption.js +119 -53
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +119 -53
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.d.mts +2 -2
- package/dist/classes/CloseLabel.d.ts +2 -2
- package/dist/classes/CloseLabel.js +53 -17
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +53 -17
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +4 -72
- package/dist/classes/Label.d.ts +4 -72
- package/dist/classes/Label.js +50 -16
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +50 -16
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/StoredClassModel.js +42 -33
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs +42 -33
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/canvas/CanvasContainer.js +2 -2
- package/dist/classes/canvas/CanvasContainer.js.map +1 -1
- package/dist/classes/canvas/CanvasContainer.mjs +2 -2
- package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
- package/dist/classes/canvas/CanvasImage.js +2 -2
- package/dist/classes/canvas/CanvasImage.js.map +1 -1
- package/dist/classes/canvas/CanvasImage.mjs +2 -2
- package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
- package/dist/classes/canvas/CanvasSprite.js +2 -2
- package/dist/classes/canvas/CanvasSprite.js.map +1 -1
- package/dist/classes/canvas/CanvasSprite.mjs +2 -2
- package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
- package/dist/classes/canvas/CanvasText.js +2 -2
- package/dist/classes/canvas/CanvasText.js.map +1 -1
- package/dist/classes/canvas/CanvasText.mjs +2 -2
- package/dist/classes/canvas/CanvasText.mjs.map +1 -1
- package/dist/classes/canvas/index.js +2 -2
- package/dist/classes/canvas/index.js.map +1 -1
- package/dist/classes/canvas/index.mjs +2 -2
- package/dist/classes/canvas/index.mjs.map +1 -1
- package/dist/classes/index.d.mts +2 -2
- package/dist/classes/index.d.ts +2 -2
- package/dist/classes/index.js +119 -53
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +119 -53
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.js +42 -33
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs +42 -33
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
- package/dist/classes/ticker/MoveTicker.d.mts +1 -0
- package/dist/classes/ticker/MoveTicker.d.ts +1 -0
- package/dist/classes/ticker/MoveTicker.js +42 -33
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs +42 -33
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
- package/dist/classes/ticker/RotateTicker.d.mts +1 -0
- package/dist/classes/ticker/RotateTicker.d.ts +1 -0
- package/dist/classes/ticker/RotateTicker.js +42 -33
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs +42 -33
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.d.mts +1 -0
- package/dist/classes/ticker/ZoomTicker.d.ts +1 -0
- package/dist/classes/ticker/ZoomTicker.js +42 -33
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs +42 -33
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
- package/dist/classes/ticker/index.js +42 -33
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs +42 -33
- package/dist/classes/ticker/index.mjs.map +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/decorators/CanvasElementDecorator.js +2 -2
- package/dist/decorators/CanvasElementDecorator.js.map +1 -1
- package/dist/decorators/CanvasElementDecorator.mjs +2 -2
- package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
- package/dist/decorators/LabelDecorator.d.mts +3 -3
- package/dist/decorators/LabelDecorator.d.ts +3 -3
- package/dist/decorators/LabelDecorator.js +74 -50
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +74 -50
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +2 -2
- package/dist/decorators/index.d.ts +2 -2
- package/dist/decorators/index.js +74 -50
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +74 -50
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/CanvasUtility.js +2 -2
- package/dist/functions/CanvasUtility.js.map +1 -1
- package/dist/functions/CanvasUtility.mjs +2 -2
- package/dist/functions/CanvasUtility.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +9 -9
- package/dist/functions/DialogueUtility.d.ts +9 -9
- package/dist/functions/DialogueUtility.js +184 -106
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +184 -106
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js +42 -33
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs +42 -33
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js +42 -33
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs +42 -33
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js +45 -36
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs +45 -36
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/SavesUtility.d.mts +4 -4
- package/dist/functions/SavesUtility.d.ts +4 -4
- package/dist/functions/SavesUtility.js +173 -111
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +173 -111
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/TickerUtility.d.mts +2 -1
- package/dist/functions/TickerUtility.d.ts +2 -1
- package/dist/functions/TickerUtility.js +19 -15
- package/dist/functions/TickerUtility.js.map +1 -1
- package/dist/functions/TickerUtility.mjs +19 -15
- package/dist/functions/TickerUtility.mjs.map +1 -1
- package/dist/functions/index.d.mts +3 -3
- package/dist/functions/index.d.ts +3 -3
- package/dist/functions/index.js +197 -115
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +197 -115
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +325 -190
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +326 -191
- package/dist/index.mjs.map +1 -1
- package/dist/interface/IHistoryStep.d.mts +1 -1
- package/dist/interface/IHistoryStep.d.ts +1 -1
- package/dist/interface/ISaveData.d.mts +2 -2
- package/dist/interface/ISaveData.d.ts +2 -2
- package/dist/interface/LabelProps.d.mts +5 -0
- package/dist/interface/LabelProps.d.ts +5 -0
- package/dist/interface/LabelProps.js +4 -0
- package/dist/interface/LabelProps.js.map +1 -0
- package/dist/interface/LabelProps.mjs +3 -0
- package/dist/interface/LabelProps.mjs.map +1 -0
- package/dist/interface/export/ExportedStep.d.mts +2 -2
- package/dist/interface/export/ExportedStep.d.ts +2 -2
- package/dist/interface/export/index.d.mts +2 -2
- package/dist/interface/export/index.d.ts +2 -2
- package/dist/interface/index.d.mts +4 -4
- package/dist/interface/index.d.ts +4 -4
- package/dist/labels/BaseCanvasElementTestLabel.d.mts +2 -2
- package/dist/labels/BaseCanvasElementTestLabel.d.ts +2 -2
- package/dist/labels/BaseCanvasElementTestLabel.js +175 -111
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +176 -112
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.d.mts +3 -6
- package/dist/labels/CanvasEventsTestLabel.d.ts +3 -6
- package/dist/labels/CanvasEventsTestLabel.js +186 -128
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.mjs +187 -129
- package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.mts +2 -2
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.ts +2 -2
- package/dist/labels/CustomTickerCanvasElementTestLabel.js +166 -108
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +166 -108
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.d.mts +2 -2
- package/dist/labels/ImagesAnimationsTestLabel.d.ts +2 -2
- package/dist/labels/ImagesAnimationsTestLabel.js +253 -147
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.mjs +253 -147
- package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -1
- package/dist/labels/MarkdownTest.d.mts +2 -2
- package/dist/labels/MarkdownTest.d.ts +2 -2
- package/dist/labels/MarkdownTest.js +166 -108
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +166 -108
- package/dist/labels/MarkdownTest.mjs.map +1 -1
- package/dist/labels/StartLabel.d.mts +2 -2
- package/dist/labels/StartLabel.d.ts +2 -2
- package/dist/labels/StartLabel.js +316 -184
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +317 -185
- package/dist/labels/StartLabel.mjs.map +1 -1
- package/dist/labels/StepLabelTest.d.mts +9 -0
- package/dist/labels/StepLabelTest.d.ts +9 -0
- package/dist/labels/StepLabelTest.js +2758 -0
- package/dist/labels/StepLabelTest.js.map +1 -0
- package/dist/labels/StepLabelTest.mjs +2752 -0
- package/dist/labels/StepLabelTest.mjs.map +1 -0
- package/dist/labels/TestConstant.js +43 -34
- package/dist/labels/TestConstant.js.map +1 -1
- package/dist/labels/TestConstant.mjs +43 -34
- package/dist/labels/TestConstant.mjs.map +1 -1
- package/dist/labels/index.d.mts +2 -2
- package/dist/labels/index.d.ts +2 -2
- package/dist/labels/index.js +316 -184
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +317 -185
- package/dist/labels/index.mjs.map +1 -1
- package/dist/managers/StepManager.d.mts +6 -5
- package/dist/managers/StepManager.d.ts +6 -5
- package/dist/managers/StepManager.js +163 -105
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +163 -105
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/WindowManager.js +2 -2
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs +2 -2
- package/dist/managers/WindowManager.mjs.map +1 -1
- package/dist/managers/index.d.mts +2 -2
- package/dist/managers/index.d.ts +2 -2
- package/dist/managers/index.js +163 -105
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +163 -105
- package/dist/managers/index.mjs.map +1 -1
- package/dist/types/ChoiceMenuOptionsType.d.mts +2 -2
- package/dist/types/ChoiceMenuOptionsType.d.ts +2 -2
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +6 -6
|
@@ -63,14 +63,15 @@ var Label = class {
|
|
|
63
63
|
/**
|
|
64
64
|
* @param id is the id of the label
|
|
65
65
|
* @param steps is the list of steps that the label will perform
|
|
66
|
-
* @param
|
|
67
|
-
* @param choiseIndex is the index of the choice that the label will perform
|
|
66
|
+
* @param props is the properties of the label
|
|
68
67
|
*/
|
|
69
|
-
constructor(id, steps,
|
|
68
|
+
constructor(id, steps, props) {
|
|
70
69
|
this._id = id;
|
|
71
70
|
this._steps = steps;
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
71
|
+
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
72
|
+
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
73
|
+
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
74
|
+
this._choiseIndex = props == null ? void 0 : props.choiseIndex;
|
|
74
75
|
}
|
|
75
76
|
/**
|
|
76
77
|
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
@@ -107,18 +108,32 @@ var Label = class {
|
|
|
107
108
|
return res;
|
|
108
109
|
}
|
|
109
110
|
/**
|
|
110
|
-
*
|
|
111
|
+
* Is a function that will be executed in {@link Label#onStepStart} and when the user goes back to it or when the user laods a save file.
|
|
112
|
+
* @returns Promise<void> or void
|
|
113
|
+
*/
|
|
114
|
+
get onStepStart() {
|
|
115
|
+
return (stepIndex, label) => __async(this, null, function* () {
|
|
116
|
+
if (this._onLoadStep) {
|
|
117
|
+
yield this._onLoadStep(stepIndex, label);
|
|
118
|
+
}
|
|
119
|
+
if (this._onStepStart) {
|
|
120
|
+
return yield this._onStepStart(stepIndex, label);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get the function that will be executed a old step is reloaded. A step is reloaded when the user goes back to it or when the user laods a save file.
|
|
126
|
+
* @returns Promise<void> or void
|
|
127
|
+
*/
|
|
128
|
+
get onLoadStep() {
|
|
129
|
+
return this._onLoadStep;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Is a function that will be executed when the step ends.
|
|
111
133
|
* @returns Promise<void> or void
|
|
112
|
-
* @example
|
|
113
|
-
* ```typescript
|
|
114
|
-
* newLabel("id", [], () => {
|
|
115
|
-
* Assets.load('path/to/image1.png')
|
|
116
|
-
* Assets.load('path/to/image2.png')
|
|
117
|
-
* })
|
|
118
|
-
* ```
|
|
119
134
|
*/
|
|
120
|
-
get
|
|
121
|
-
return this.
|
|
135
|
+
get onStepEnd() {
|
|
136
|
+
return this._onStepEnd;
|
|
122
137
|
}
|
|
123
138
|
get choiseIndex() {
|
|
124
139
|
return this._choiseIndex;
|
|
@@ -128,16 +143,18 @@ var Label = class {
|
|
|
128
143
|
// src/classes/CloseLabel.ts
|
|
129
144
|
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
130
145
|
function newCloseLabel(choiseIndex) {
|
|
131
|
-
return new Label(CLOSE_LABEL_ID, [],
|
|
146
|
+
return new Label(CLOSE_LABEL_ID, [], {
|
|
147
|
+
choiseIndex
|
|
148
|
+
});
|
|
132
149
|
}
|
|
133
150
|
|
|
134
151
|
// src/decorators/LabelDecorator.ts
|
|
135
152
|
var registeredLabels = {};
|
|
136
|
-
function newLabel(id, steps,
|
|
153
|
+
function newLabel(id, steps, props) {
|
|
137
154
|
if (registeredLabels[id]) {
|
|
138
155
|
console.info(`[Pixi'VN] Label ${id} already exists, it will be overwritten`);
|
|
139
156
|
}
|
|
140
|
-
let label = new Label(id, steps,
|
|
157
|
+
let label = new Label(id, steps, props);
|
|
141
158
|
registeredLabels[id] = label;
|
|
142
159
|
return label;
|
|
143
160
|
}
|
|
@@ -226,8 +243,6 @@ function getMemoryContainer(element) {
|
|
|
226
243
|
};
|
|
227
244
|
}
|
|
228
245
|
function setMemoryContainer(element, memory) {
|
|
229
|
-
memory.width && (element.width = memory.width);
|
|
230
|
-
memory.height && (element.height = memory.height);
|
|
231
246
|
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
232
247
|
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
233
248
|
memory.tint && (element.tint = memory.tint);
|
|
@@ -260,6 +275,8 @@ function setMemoryContainer(element, memory) {
|
|
|
260
275
|
memory.interactive && (element.interactive = memory.interactive);
|
|
261
276
|
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
262
277
|
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
278
|
+
memory.width && (element.width = memory.width);
|
|
279
|
+
memory.height && (element.height = memory.height);
|
|
263
280
|
}
|
|
264
281
|
function getTexture(imageUrl) {
|
|
265
282
|
return __async(this, null, function* () {
|
|
@@ -681,12 +698,32 @@ var ChoiceMenuOption = class {
|
|
|
681
698
|
/**
|
|
682
699
|
* @param text Text to be displayed in the menu
|
|
683
700
|
* @param label Label to be opened when the option is selected or the id of the label
|
|
701
|
+
* @param props Properties to be passed to the label and olther parameters that you can use when get all the choice menu options. It be converted to a JSON string, so it cannot contain functions or classes.
|
|
684
702
|
* @param type Type of the label to be opened. @default "call"
|
|
685
|
-
* @param props Properties to be passed to the label, when the label is called. it cannot contain functions or classes. @default {}
|
|
686
703
|
*/
|
|
687
|
-
constructor(text, label, type = "call"
|
|
704
|
+
constructor(text, label, props, type = "call") {
|
|
688
705
|
/**
|
|
689
|
-
* Properties to be passed to the label
|
|
706
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
707
|
+
* @example
|
|
708
|
+
* ```tsx
|
|
709
|
+
* setChoiceMenuOptions([
|
|
710
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
711
|
+
* ])
|
|
712
|
+
* return <List>
|
|
713
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
714
|
+
* return (
|
|
715
|
+
* <ChoiceButton
|
|
716
|
+
* disabled={item.props.disabled}
|
|
717
|
+
* onClick={() => {
|
|
718
|
+
* afterSelectChoice(item)
|
|
719
|
+
* }}
|
|
720
|
+
* >
|
|
721
|
+
* {item.text}
|
|
722
|
+
* </ChoiceButton>
|
|
723
|
+
* )
|
|
724
|
+
* })}
|
|
725
|
+
* </List>
|
|
726
|
+
* ```
|
|
690
727
|
*/
|
|
691
728
|
this.props = {};
|
|
692
729
|
if (typeof label === "string") {
|
|
@@ -720,7 +757,27 @@ var ChoiceMenuOptionClose = class {
|
|
|
720
757
|
*/
|
|
721
758
|
this.type = Close;
|
|
722
759
|
/**
|
|
723
|
-
* Properties to be passed to the label
|
|
760
|
+
* Properties to be passed to the label and olther parameters that you can use when get all the choice menu options.
|
|
761
|
+
* @example
|
|
762
|
+
* ```tsx
|
|
763
|
+
* setChoiceMenuOptions([
|
|
764
|
+
* new ChoiceMenuOption("Hello", helloLabel, { disabled: true }),
|
|
765
|
+
* ])
|
|
766
|
+
* return <List>
|
|
767
|
+
* {getChoiceMenuOptions()?.map((item, index) => {
|
|
768
|
+
* return (
|
|
769
|
+
* <ChoiceButton
|
|
770
|
+
* disabled={item.props.disabled}
|
|
771
|
+
* onClick={() => {
|
|
772
|
+
* afterSelectChoice(item)
|
|
773
|
+
* }}
|
|
774
|
+
* >
|
|
775
|
+
* {item.text}
|
|
776
|
+
* </ChoiceButton>
|
|
777
|
+
* )
|
|
778
|
+
* })}
|
|
779
|
+
* </List>
|
|
780
|
+
* ```
|
|
724
781
|
*/
|
|
725
782
|
this.props = {};
|
|
726
783
|
this.text = text;
|
|
@@ -789,7 +846,10 @@ function getChoiceMenuOptions() {
|
|
|
789
846
|
}
|
|
790
847
|
let label = getLabelById(option.label);
|
|
791
848
|
if (label) {
|
|
792
|
-
let itemLabel = new Label(label.id, label.steps,
|
|
849
|
+
let itemLabel = new Label(label.id, label.steps, {
|
|
850
|
+
onStepStart: label.onStepStart,
|
|
851
|
+
choiseIndex: index
|
|
852
|
+
});
|
|
793
853
|
options.push(__spreadProps(__spreadValues({}, option), {
|
|
794
854
|
label: itemLabel
|
|
795
855
|
}));
|
|
@@ -880,8 +940,9 @@ FadeAlphaTicker = __decorateClass([
|
|
|
880
940
|
], FadeAlphaTicker);
|
|
881
941
|
|
|
882
942
|
// src/functions/TickerUtility.ts
|
|
883
|
-
function updateTickerProgression(args, propertyName, progression) {
|
|
884
|
-
|
|
943
|
+
function updateTickerProgression(args, propertyName, progression, valueConvert) {
|
|
944
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
945
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === limit) {
|
|
885
946
|
return;
|
|
886
947
|
}
|
|
887
948
|
if (typeof args[propertyName] === "number") {
|
|
@@ -900,22 +961,25 @@ function updateTickerProgression(args, propertyName, progression) {
|
|
|
900
961
|
}
|
|
901
962
|
}
|
|
902
963
|
}
|
|
903
|
-
function getLinearProgression(number, progression) {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
return
|
|
964
|
+
function getLinearProgression(number, progression, valueConvert) {
|
|
965
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
966
|
+
let amt = valueConvert ? valueConvert(progression.amt) : progression.amt;
|
|
967
|
+
if (limit !== void 0) {
|
|
968
|
+
if (number > limit && amt > 0) {
|
|
969
|
+
return limit;
|
|
970
|
+
} else if (number < limit && amt < 0) {
|
|
971
|
+
return limit;
|
|
909
972
|
}
|
|
910
973
|
}
|
|
911
|
-
return number +
|
|
974
|
+
return number + amt;
|
|
912
975
|
}
|
|
913
|
-
function getExponentialProgression(number, progression) {
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
976
|
+
function getExponentialProgression(number, progression, valueConvert) {
|
|
977
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
978
|
+
if (limit !== void 0) {
|
|
979
|
+
if (number > limit && progression.percentage > 0) {
|
|
980
|
+
return limit;
|
|
981
|
+
} else if (number < limit && progression.percentage < 0) {
|
|
982
|
+
return limit;
|
|
919
983
|
}
|
|
920
984
|
}
|
|
921
985
|
return number + number * progression.percentage;
|
|
@@ -928,15 +992,13 @@ var MoveTicker = class extends TickerBase {
|
|
|
928
992
|
let ySpeed = 1;
|
|
929
993
|
if (args.speed) {
|
|
930
994
|
if (typeof args.speed === "number") {
|
|
931
|
-
xSpeed = args.speed;
|
|
932
|
-
ySpeed = args.speed;
|
|
995
|
+
xSpeed = this.speedConvert(args.speed);
|
|
996
|
+
ySpeed = this.speedConvert(args.speed);
|
|
933
997
|
} else {
|
|
934
|
-
xSpeed = args.speed.x;
|
|
935
|
-
ySpeed = args.speed.y;
|
|
998
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
999
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
936
1000
|
}
|
|
937
1001
|
}
|
|
938
|
-
xSpeed /= 60;
|
|
939
|
-
ySpeed /= 60;
|
|
940
1002
|
let destination = args.destination;
|
|
941
1003
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
942
1004
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -976,7 +1038,10 @@ var MoveTicker = class extends TickerBase {
|
|
|
976
1038
|
}
|
|
977
1039
|
});
|
|
978
1040
|
if (args.speedProgression)
|
|
979
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1041
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
1042
|
+
}
|
|
1043
|
+
speedConvert(speed) {
|
|
1044
|
+
return speed / 6;
|
|
980
1045
|
}
|
|
981
1046
|
};
|
|
982
1047
|
MoveTicker = __decorateClass([
|
|
@@ -984,7 +1049,7 @@ MoveTicker = __decorateClass([
|
|
|
984
1049
|
], MoveTicker);
|
|
985
1050
|
var RotateTicker = class extends TickerBase {
|
|
986
1051
|
fn(ticker, args, tags, tickerId) {
|
|
987
|
-
let speed = (args.speed === void 0 ? 1 : args.speed)
|
|
1052
|
+
let speed = this.speedConvert(args.speed === void 0 ? 1 : args.speed);
|
|
988
1053
|
let clockwise = args.clockwise === void 0 ? true : args.clockwise;
|
|
989
1054
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
990
1055
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -1012,7 +1077,10 @@ var RotateTicker = class extends TickerBase {
|
|
|
1012
1077
|
}
|
|
1013
1078
|
});
|
|
1014
1079
|
if (args.speedProgression)
|
|
1015
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1080
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
1081
|
+
}
|
|
1082
|
+
speedConvert(speed) {
|
|
1083
|
+
return speed / 60;
|
|
1016
1084
|
}
|
|
1017
1085
|
};
|
|
1018
1086
|
RotateTicker = __decorateClass([
|
|
@@ -1024,15 +1092,13 @@ var ZoomTicker = class extends TickerBase {
|
|
|
1024
1092
|
let ySpeed = 0.1;
|
|
1025
1093
|
if (args.speed) {
|
|
1026
1094
|
if (typeof args.speed === "number") {
|
|
1027
|
-
xSpeed = args.speed;
|
|
1028
|
-
ySpeed = args.speed;
|
|
1095
|
+
xSpeed = this.speedConvert(args.speed);
|
|
1096
|
+
ySpeed = this.speedConvert(args.speed);
|
|
1029
1097
|
} else {
|
|
1030
|
-
xSpeed = args.speed.x;
|
|
1031
|
-
ySpeed = args.speed.y;
|
|
1098
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
1099
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
1032
1100
|
}
|
|
1033
1101
|
}
|
|
1034
|
-
xSpeed /= 60;
|
|
1035
|
-
ySpeed /= 60;
|
|
1036
1102
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
1037
1103
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
1038
1104
|
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
@@ -1099,7 +1165,10 @@ var ZoomTicker = class extends TickerBase {
|
|
|
1099
1165
|
}
|
|
1100
1166
|
});
|
|
1101
1167
|
if (args.speedProgression)
|
|
1102
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1168
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
1169
|
+
}
|
|
1170
|
+
speedConvert(speed) {
|
|
1171
|
+
return speed / 60;
|
|
1103
1172
|
}
|
|
1104
1173
|
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
1105
1174
|
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
@@ -1296,14 +1365,14 @@ function zoomIn(_0, _1) {
|
|
|
1296
1365
|
} else {
|
|
1297
1366
|
canvasElement = image;
|
|
1298
1367
|
}
|
|
1299
|
-
if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1300
|
-
yield canvasElement.load();
|
|
1301
|
-
}
|
|
1302
1368
|
let container = new CanvasContainer();
|
|
1303
1369
|
container.addChild(canvasElement);
|
|
1304
1370
|
container.height = GameWindowManager.canvasHeight;
|
|
1305
1371
|
container.width = GameWindowManager.canvasWidth;
|
|
1306
1372
|
GameWindowManager.addCanvasElement(tag, container);
|
|
1373
|
+
if (canvasElement instanceof CanvasImage && ((_a = canvasElement.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1374
|
+
yield canvasElement.load();
|
|
1375
|
+
}
|
|
1307
1376
|
if (props.direction == "up") {
|
|
1308
1377
|
container.pivot.y = GameWindowManager.canvasHeight;
|
|
1309
1378
|
container.pivot.x = GameWindowManager.canvasWidth / 2;
|
|
@@ -2325,6 +2394,16 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2325
2394
|
static set originalStepData(value) {
|
|
2326
2395
|
_GameStepManager._originalStepData = createExportableElement(value);
|
|
2327
2396
|
}
|
|
2397
|
+
static get currentStepData() {
|
|
2398
|
+
let currentStepData = {
|
|
2399
|
+
path: window.location.pathname,
|
|
2400
|
+
storage: GameStorageManager.export(),
|
|
2401
|
+
canvas: GameWindowManager.export(),
|
|
2402
|
+
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
2403
|
+
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
2404
|
+
};
|
|
2405
|
+
return currentStepData;
|
|
2406
|
+
}
|
|
2328
2407
|
/* Edit History Methods */
|
|
2329
2408
|
/**
|
|
2330
2409
|
* Add a label to the history.
|
|
@@ -2332,19 +2411,13 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2332
2411
|
*/
|
|
2333
2412
|
static addStepHistory(step, choiseMade) {
|
|
2334
2413
|
let stepHistory = getStepSha1(step);
|
|
2335
|
-
let
|
|
2336
|
-
path: window.location.pathname,
|
|
2337
|
-
storage: GameStorageManager.export(),
|
|
2338
|
-
canvas: GameWindowManager.export(),
|
|
2339
|
-
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
2340
|
-
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
2341
|
-
};
|
|
2414
|
+
let currentStepData = _GameStepManager.currentStepData;
|
|
2342
2415
|
if (_GameStepManager.originalStepData) {
|
|
2343
|
-
if (_GameStepManager.originalStepData.openedLabels.length ===
|
|
2416
|
+
if (_GameStepManager.originalStepData.openedLabels.length === currentStepData.openedLabels.length) {
|
|
2344
2417
|
try {
|
|
2345
2418
|
let lastStepDataOpenedLabelsString = JSON.stringify(_GameStepManager.originalStepData.openedLabels);
|
|
2346
|
-
let historyStepOpenedLabelsString = JSON.stringify(
|
|
2347
|
-
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path ===
|
|
2419
|
+
let historyStepOpenedLabelsString = JSON.stringify(currentStepData.openedLabels);
|
|
2420
|
+
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path === currentStepData.path && _GameStepManager.originalStepData.labelIndex === currentStepData.labelIndex) {
|
|
2348
2421
|
return;
|
|
2349
2422
|
}
|
|
2350
2423
|
} catch (e) {
|
|
@@ -2352,7 +2425,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2352
2425
|
}
|
|
2353
2426
|
}
|
|
2354
2427
|
}
|
|
2355
|
-
let data = diff(_GameStepManager.originalStepData,
|
|
2428
|
+
let data = diff(_GameStepManager.originalStepData, currentStepData);
|
|
2356
2429
|
if (data) {
|
|
2357
2430
|
let dialoge = void 0;
|
|
2358
2431
|
let requiredChoices = void 0;
|
|
@@ -2371,7 +2444,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2371
2444
|
index: _GameStepManager.lastStepIndex,
|
|
2372
2445
|
choiceIndexMade: choiseMade
|
|
2373
2446
|
});
|
|
2374
|
-
_GameStepManager.originalStepData =
|
|
2447
|
+
_GameStepManager.originalStepData = currentStepData;
|
|
2375
2448
|
}
|
|
2376
2449
|
_GameStepManager.increaseLastStepIndex();
|
|
2377
2450
|
}
|
|
@@ -2462,6 +2535,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2462
2535
|
console.warn("[Pixi'VN] The player must make a choice");
|
|
2463
2536
|
return;
|
|
2464
2537
|
}
|
|
2538
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2539
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2540
|
+
}
|
|
2465
2541
|
_GameStepManager.increaseCurrentStepIndex();
|
|
2466
2542
|
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
2467
2543
|
});
|
|
@@ -2486,6 +2562,10 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2486
2562
|
return;
|
|
2487
2563
|
}
|
|
2488
2564
|
if (currentLabel.steps.length > currentLabelStepIndex) {
|
|
2565
|
+
let onStepRun = currentLabel.onStepStart;
|
|
2566
|
+
if (onStepRun) {
|
|
2567
|
+
yield onStepRun(currentLabelStepIndex, currentLabel);
|
|
2568
|
+
}
|
|
2489
2569
|
let step = currentLabel.steps[currentLabelStepIndex];
|
|
2490
2570
|
let result = yield step(props);
|
|
2491
2571
|
_GameStepManager.addStepHistory(step, choiseMade);
|
|
@@ -2550,6 +2630,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2550
2630
|
if (!tempLabel) {
|
|
2551
2631
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2552
2632
|
}
|
|
2633
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2634
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2635
|
+
}
|
|
2553
2636
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2554
2637
|
} catch (e) {
|
|
2555
2638
|
console.error("[Pixi'VN] Error calling label", e);
|
|
@@ -2608,6 +2691,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2608
2691
|
if (!tempLabel) {
|
|
2609
2692
|
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2610
2693
|
}
|
|
2694
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onStepEnd) {
|
|
2695
|
+
yield _GameStepManager.currentLabel.onStepEnd(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2696
|
+
}
|
|
2611
2697
|
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2612
2698
|
} catch (e) {
|
|
2613
2699
|
console.error("[Pixi'VN] Error jumping label", e);
|
|
@@ -2713,24 +2799,29 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2713
2799
|
* ```
|
|
2714
2800
|
*/
|
|
2715
2801
|
static goBack(navigate, steps = 1) {
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2802
|
+
return __async(this, null, function* () {
|
|
2803
|
+
if (steps <= 0) {
|
|
2804
|
+
console.warn("[Pixi'VN] Steps must be greater than 0");
|
|
2805
|
+
return;
|
|
2806
|
+
}
|
|
2807
|
+
if (_GameStepManager._stepsHistory.length <= 1) {
|
|
2808
|
+
console.warn("[Pixi'VN] No steps to go back");
|
|
2809
|
+
return;
|
|
2810
|
+
}
|
|
2811
|
+
let restoredStep = _GameStepManager.goBackInternal(steps, _GameStepManager.originalStepData);
|
|
2812
|
+
if (restoredStep) {
|
|
2813
|
+
_GameStepManager._originalStepData = restoredStep;
|
|
2814
|
+
_GameStepManager._openedLabels = createExportableElement(restoredStep.openedLabels);
|
|
2815
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2816
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2817
|
+
}
|
|
2818
|
+
GameStorageManager.import(createExportableElement(restoredStep.storage));
|
|
2819
|
+
GameWindowManager.import(createExportableElement(restoredStep.canvas));
|
|
2820
|
+
navigate(restoredStep.path);
|
|
2821
|
+
} else {
|
|
2822
|
+
console.error("[Pixi'VN] Error going back");
|
|
2823
|
+
}
|
|
2824
|
+
});
|
|
2734
2825
|
}
|
|
2735
2826
|
static goBackInternal(steps, restoredStep) {
|
|
2736
2827
|
if (steps <= 0) {
|
|
@@ -2792,38 +2883,45 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2792
2883
|
* @param dataString The history in a JSON string.
|
|
2793
2884
|
*/
|
|
2794
2885
|
static importJson(dataString) {
|
|
2795
|
-
|
|
2886
|
+
return __async(this, null, function* () {
|
|
2887
|
+
yield _GameStepManager.import(JSON.parse(dataString));
|
|
2888
|
+
});
|
|
2796
2889
|
}
|
|
2797
2890
|
/**
|
|
2798
2891
|
* Import the history from an object.
|
|
2799
2892
|
* @param data The history in an object.
|
|
2800
2893
|
*/
|
|
2801
2894
|
static import(data) {
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2895
|
+
return __async(this, null, function* () {
|
|
2896
|
+
_GameStepManager.clear();
|
|
2897
|
+
try {
|
|
2898
|
+
if (data.hasOwnProperty("stepsHistory")) {
|
|
2899
|
+
_GameStepManager._stepsHistory = data["stepsHistory"];
|
|
2900
|
+
} else {
|
|
2901
|
+
console.warn("[Pixi'VN] Could not import stepsHistory data, so will be ignored");
|
|
2902
|
+
}
|
|
2903
|
+
if (data.hasOwnProperty("openedLabels")) {
|
|
2904
|
+
_GameStepManager._openedLabels = data["openedLabels"];
|
|
2905
|
+
} else {
|
|
2906
|
+
console.warn("[Pixi'VN] Could not import openedLabels data, so will be ignored");
|
|
2907
|
+
}
|
|
2908
|
+
if (data.hasOwnProperty("lastStepIndex")) {
|
|
2909
|
+
_GameStepManager._lastStepIndex = data["lastStepIndex"];
|
|
2910
|
+
} else {
|
|
2911
|
+
console.warn("[Pixi'VN] Could not import lastStepIndex data, so will be ignored");
|
|
2912
|
+
}
|
|
2913
|
+
if (data.hasOwnProperty("originalStepData")) {
|
|
2914
|
+
_GameStepManager._originalStepData = data["originalStepData"];
|
|
2915
|
+
} else {
|
|
2916
|
+
console.warn("[Pixi'VN] Could not import originalStepData data, so will be ignored");
|
|
2917
|
+
}
|
|
2918
|
+
if (_GameStepManager.currentLabel && _GameStepManager.currentLabel.onLoadStep) {
|
|
2919
|
+
yield _GameStepManager.currentLabel.onLoadStep(_GameStepManager.currentLabelStepIndex || 0, _GameStepManager.currentLabel);
|
|
2920
|
+
}
|
|
2921
|
+
} catch (e) {
|
|
2922
|
+
console.error("[Pixi'VN] Error importing data", e);
|
|
2823
2923
|
}
|
|
2824
|
-
}
|
|
2825
|
-
console.error("[Pixi'VN] Error importing data", e);
|
|
2826
|
-
}
|
|
2924
|
+
});
|
|
2827
2925
|
}
|
|
2828
2926
|
};
|
|
2829
2927
|
/**
|
|
@@ -2999,7 +3097,7 @@ var DialogueBaseModel = class {
|
|
|
2999
3097
|
var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
|
|
3000
3098
|
name: "Juliette",
|
|
3001
3099
|
age: 25,
|
|
3002
|
-
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media
|
|
3100
|
+
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media",
|
|
3003
3101
|
color: "#ac0086"
|
|
3004
3102
|
});
|
|
3005
3103
|
saveCharacter(juliette);
|
|
@@ -3036,13 +3134,13 @@ var imagesAnimationsTest = newLabel(IMAGE_ANIMAIONS_TEST_LABEL, [
|
|
|
3036
3134
|
() => __async(void 0, null, function* () {
|
|
3037
3135
|
setDialogue({ character: juliette, text: "Here's what they can do." });
|
|
3038
3136
|
setChoiceMenuOptions([
|
|
3039
|
-
new ChoiceMenuOption("Dissolve effect", imagesDissolveTest),
|
|
3040
|
-
new ChoiceMenuOption("Fade effect", imagesFadeTest),
|
|
3041
|
-
new ChoiceMenuOption("Rotate", imagesRotateTest),
|
|
3042
|
-
new ChoiceMenuOption("Move", imagesMoveTest),
|
|
3043
|
-
new ChoiceMenuOption("Zoom", imagesZoomTest),
|
|
3044
|
-
new ChoiceMenuOption("Move in/out", imagesMoveInOutTest),
|
|
3045
|
-
new ChoiceMenuOption("Zoom in/out", imagesZoomInOutTest),
|
|
3137
|
+
new ChoiceMenuOption("Dissolve effect", imagesDissolveTest, {}),
|
|
3138
|
+
new ChoiceMenuOption("Fade effect", imagesFadeTest, {}),
|
|
3139
|
+
new ChoiceMenuOption("Rotate", imagesRotateTest, {}),
|
|
3140
|
+
new ChoiceMenuOption("Move", imagesMoveTest, {}),
|
|
3141
|
+
new ChoiceMenuOption("Zoom", imagesZoomTest, {}),
|
|
3142
|
+
new ChoiceMenuOption("Move in/out", imagesMoveInOutTest, {}),
|
|
3143
|
+
new ChoiceMenuOption("Zoom in/out", imagesZoomInOutTest, {}),
|
|
3046
3144
|
new ChoiceMenuOptionClose("Cancel", true)
|
|
3047
3145
|
]);
|
|
3048
3146
|
}),
|
|
@@ -3152,8 +3250,8 @@ var imagesRotateTest = newLabel("___pixi_vn_images_rotate_test___", [
|
|
|
3152
3250
|
text: `Here's what's going to happen:
|
|
3153
3251
|
- ${eggHeadName} will rotate with a anchor set to 0.
|
|
3154
3252
|
- ${flowerTopName} will rotate with a anchor set to 0.5 and a exponential speed progression.
|
|
3155
|
-
- ${helmlokName} will rotate with a anchor set to 0.5, rotate 2
|
|
3156
|
-
- ${skullyName} will rotate with a anchor set to 1, rotate 3
|
|
3253
|
+
- ${helmlokName} will rotate with a anchor set to 0.5, rotate clockwise for 2 seconds, rotate counterclockwise with a exponential (-0.05) speed progression, and when it reaches 0, it will repeat.
|
|
3254
|
+
- ${skullyName} will rotate with a anchor set to 1, rotate 3 seconds clockwise, wait for 0.5 seconds, and rotate 7 seconds counterclockwise.`
|
|
3157
3255
|
});
|
|
3158
3256
|
let eggHead = GameWindowManager.getCanvasElement("eggHead");
|
|
3159
3257
|
if (eggHead)
|
|
@@ -3206,10 +3304,10 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
3206
3304
|
setDialogue({
|
|
3207
3305
|
character: juliette,
|
|
3208
3306
|
text: `Here's what's going to happen:
|
|
3209
|
-
- ${eggHeadName} will move to { x: 500, y: 100 } with a speed of
|
|
3210
|
-
- ${flowerTopName} will move to { x: 500, y: 300 } with a speed of
|
|
3211
|
-
- ${helmlokName} will move to
|
|
3212
|
-
- ${skullyName} will move to { x: 500, y: 500 } with a speed of
|
|
3307
|
+
- ${eggHeadName} will move to { x: 500, y: 100 } with a speed of 24.
|
|
3308
|
+
- ${flowerTopName} will move to { x: 500, y: 300 } with a speed of 18.
|
|
3309
|
+
- ${helmlokName} will move to { x: 100, y: 500 } with a speed of 150 and a linear speed progression of -2 ( limit 10 ), and then move to { x: 1700, y: 500 } with a speed of 10 and a linear speed progression of 2 ( limit 150 ), and repeat.
|
|
3310
|
+
- ${skullyName} will move to { x: 500, y: 500 } with a speed of 40, wait for 0.5 seconds, and move to { x: 100, y: 100 } with a speed of 40.`
|
|
3213
3311
|
});
|
|
3214
3312
|
GameWindowManager.addTicker("eggHead", new MoveTicker({
|
|
3215
3313
|
destination: { x: 500, y: 100 },
|
|
@@ -3222,25 +3320,25 @@ var imagesMoveTest = newLabel("___pixi_vn_images_move_test___", [
|
|
|
3222
3320
|
GameWindowManager.addTickersSteps("helmlok", [
|
|
3223
3321
|
new MoveTicker({
|
|
3224
3322
|
destination: { x: 100, y: 500 },
|
|
3225
|
-
speed:
|
|
3226
|
-
speedProgression: { type: "linear", amt: -
|
|
3323
|
+
speed: 150,
|
|
3324
|
+
speedProgression: { type: "linear", amt: -2, limit: 10 }
|
|
3227
3325
|
}),
|
|
3228
3326
|
new MoveTicker({
|
|
3229
3327
|
destination: { x: 1700, y: 500 },
|
|
3230
|
-
speed:
|
|
3231
|
-
speedProgression: { type: "linear", amt:
|
|
3328
|
+
speed: 10,
|
|
3329
|
+
speedProgression: { type: "linear", amt: 2, limit: 150 }
|
|
3232
3330
|
}),
|
|
3233
3331
|
Repeat
|
|
3234
3332
|
]);
|
|
3235
3333
|
GameWindowManager.addTickersSteps("skully", [
|
|
3236
3334
|
new MoveTicker({
|
|
3237
3335
|
destination: { x: 500, y: 500 },
|
|
3238
|
-
speed:
|
|
3336
|
+
speed: 40
|
|
3239
3337
|
}),
|
|
3240
3338
|
Pause(0.5),
|
|
3241
3339
|
new MoveTicker({
|
|
3242
3340
|
destination: { x: 100, y: 100 },
|
|
3243
|
-
speed:
|
|
3341
|
+
speed: 40
|
|
3244
3342
|
})
|
|
3245
3343
|
]);
|
|
3246
3344
|
}
|
|
@@ -3302,37 +3400,45 @@ var imagesMoveInOutTest = newLabel("___pixi_vn_images_move_in_out_test___", [
|
|
|
3302
3400
|
setDialogue({
|
|
3303
3401
|
character: juliette,
|
|
3304
3402
|
text: `Here's what's going to happen:
|
|
3305
|
-
- ${eggHeadName} will move in from the top with a speed of
|
|
3306
|
-
- ${flowerTopName} will move in from the right with a speed of
|
|
3307
|
-
- ${helmlokName} will move in from the left with a speed of
|
|
3308
|
-
- ${skullyName} will move in from the bottom with a speed of
|
|
3403
|
+
- ${eggHeadName} will move in from the top with a speed of 80. If you go next, ${eggHeadName} will move out from the bottom with a speed of 80.
|
|
3404
|
+
- ${flowerTopName} will move in from the right with a speed of 80 and a speed progression of 0.02. If you go next, ${flowerTopName} will move out from the left with a speed of 80 and a speed progression of 0.02.
|
|
3405
|
+
- ${helmlokName} will move in from the left with a speed of 80. If you go next, ${helmlokName} will move out from the right with a speed of 80.
|
|
3406
|
+
- ${skullyName} will move in from the bottom with a speed of 80 and a speed progression of 0.02. If you go next, ${skullyName} will move out from the top with a speed of 80 and a speed progression of 0.02.`
|
|
3309
3407
|
});
|
|
3310
3408
|
let eggHead = new CanvasImage({ x: 100, y: 100 }, eggHeadImage);
|
|
3311
3409
|
let flowerTop = new CanvasImage({ x: 300, y: 100 }, flowerTopImage);
|
|
3312
3410
|
let helmlok = new CanvasImage({ x: 100, y: 300 }, helmlokImage);
|
|
3313
3411
|
let skully = new CanvasImage({ x: 300, y: 300 }, skullyImage);
|
|
3314
|
-
moveIn("eggHead", eggHead, { speed:
|
|
3412
|
+
moveIn("eggHead", eggHead, { speed: 80, direction: "down" });
|
|
3315
3413
|
moveIn("flowerTop", flowerTop, {
|
|
3316
|
-
speed:
|
|
3414
|
+
speed: 80,
|
|
3317
3415
|
direction: "left",
|
|
3318
3416
|
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3319
3417
|
});
|
|
3320
|
-
moveIn("helmlok", helmlok, { speed:
|
|
3418
|
+
moveIn("helmlok", helmlok, { speed: 80, direction: "right" });
|
|
3321
3419
|
moveIn("skully", skully, {
|
|
3322
|
-
speed:
|
|
3420
|
+
speed: 80,
|
|
3323
3421
|
direction: "up",
|
|
3324
3422
|
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3325
3423
|
});
|
|
3326
3424
|
}),
|
|
3327
3425
|
() => {
|
|
3328
|
-
moveOut("eggHead", { speed:
|
|
3329
|
-
moveOut("flowerTop", { speed:
|
|
3330
|
-
moveOut("helmlok", { speed:
|
|
3331
|
-
moveOut("skully", { speed:
|
|
3426
|
+
moveOut("eggHead", { speed: 80, direction: "down" });
|
|
3427
|
+
moveOut("flowerTop", { speed: 80, direction: "left" });
|
|
3428
|
+
moveOut("helmlok", { speed: 80, direction: "right" });
|
|
3429
|
+
moveOut("skully", { speed: 80, direction: "up" });
|
|
3332
3430
|
}
|
|
3333
3431
|
]);
|
|
3334
3432
|
var imagesZoomInOutTest = newLabel("___pixi_vn_images_zoom_in_out_test___", [
|
|
3335
3433
|
() => __async(void 0, null, function* () {
|
|
3434
|
+
setDialogue({
|
|
3435
|
+
character: juliette,
|
|
3436
|
+
text: `Here's what's going to happen:
|
|
3437
|
+
- ${eggHeadName} will zoom in with a speed of 3. If you go next, ${eggHeadName} will zoom out with a speed of 3.
|
|
3438
|
+
- ${flowerTopName} will zoom in with a speed of 3 and a speed progression of 0.02. If you go next, ${flowerTopName} will zoom out with a speed of 3.
|
|
3439
|
+
- ${helmlokName} will zoom in with a speed of 3. If you go next, ${helmlokName} will zoom out with a speed of 1.
|
|
3440
|
+
- ${skullyName} will zoom in with a speed of 3 and a speed progression of 0.02. If you go next, ${skullyName} will zoom out with a speed of 3 and a speed progression of 0.02.`
|
|
3441
|
+
});
|
|
3336
3442
|
GameWindowManager.removeCanvasElements();
|
|
3337
3443
|
let eggHead = new CanvasImage({ x: 100, y: 100 }, eggHeadImage);
|
|
3338
3444
|
let flowerTop = new CanvasImage({ x: 300, y: 100 }, flowerTopImage);
|
|
@@ -3358,7 +3464,7 @@ var imagesZoomInOutTest = newLabel("___pixi_vn_images_zoom_in_out_test___", [
|
|
|
3358
3464
|
speedProgression: { type: "exponential", percentage: 0.02 }
|
|
3359
3465
|
});
|
|
3360
3466
|
zoomOut("flowerTop", { speed: 3, direction: "left" });
|
|
3361
|
-
zoomOut("helmlok", { speed:
|
|
3467
|
+
zoomOut("helmlok", { speed: 1, direction: "right" });
|
|
3362
3468
|
zoomOut("skully", {
|
|
3363
3469
|
speed: 3,
|
|
3364
3470
|
direction: "up",
|