@m2c2kit/addons 0.3.19 → 0.3.21
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/index.d.ts +12 -0
- package/dist/index.js +75 -6
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -763,6 +763,8 @@ declare class VirtualKeyboard extends Composite {
|
|
|
763
763
|
interface InstructionScene {
|
|
764
764
|
/** Primary instruction text */
|
|
765
765
|
text?: string;
|
|
766
|
+
/** Interpolation for text */
|
|
767
|
+
textInterpolation?: StringInterpolationMap;
|
|
766
768
|
/** Margin from left screen edge to primary instruction text. Default is 48 */
|
|
767
769
|
textMarginStart?: number;
|
|
768
770
|
/** Margin from right to primary instruction text. Default is 48 */
|
|
@@ -775,6 +777,8 @@ interface InstructionScene {
|
|
|
775
777
|
textFontSize?: number;
|
|
776
778
|
/** A text heading to appear at the top of the scene */
|
|
777
779
|
title?: string;
|
|
780
|
+
/** Interpolation for title */
|
|
781
|
+
titleInterpolation?: StringInterpolationMap;
|
|
778
782
|
/** Margin from top of screen edge to title text. Default is 48 */
|
|
779
783
|
titleMarginTop?: number;
|
|
780
784
|
/** Font size of title text. Default is 16 */
|
|
@@ -793,8 +797,12 @@ interface InstructionScene {
|
|
|
793
797
|
backgroundColor?: RgbaColor;
|
|
794
798
|
/** Button text for the back button. Will override what is set in InstructionsOptions */
|
|
795
799
|
backButtonText?: string;
|
|
800
|
+
/** Interpolation for back button text */
|
|
801
|
+
backButtonTextInterpolation?: StringInterpolationMap;
|
|
796
802
|
/** Button text for the next button. Will override what is set in InstructionsOptions */
|
|
797
803
|
nextButtonText?: string;
|
|
804
|
+
/** Interpolation map for next button text */
|
|
805
|
+
nextButtonTextInterpolation?: StringInterpolationMap;
|
|
798
806
|
/** Width of back button. Will override what is set in InstructionsOptions */
|
|
799
807
|
backButtonWidth?: number;
|
|
800
808
|
/** Width of next button. Will override what is set in InstructionsOptions */
|
|
@@ -831,8 +839,12 @@ interface InstructionsOptions extends StoryOptions {
|
|
|
831
839
|
backSceneTransition?: Transition;
|
|
832
840
|
/** Button text for the back button. Default is "Back". Can be overridden within a single instruction scene */
|
|
833
841
|
backButtonText?: string;
|
|
842
|
+
/** Interpolation map for back button text */
|
|
843
|
+
backButtonTextInterpolation?: StringInterpolationMap;
|
|
834
844
|
/** Button text for the next button. Default is "Next". Can be overridden within a single instruction scene */
|
|
835
845
|
nextButtonText?: string;
|
|
846
|
+
/** Interpolation map for next button text */
|
|
847
|
+
nextButtonTextInterpolation?: StringInterpolationMap;
|
|
836
848
|
/** Width of back button. Default is 125. Can be overridden within a single instruction scene */
|
|
837
849
|
backButtonWidth?: number;
|
|
838
850
|
/** Width of next button. Default is 125. Can be overridden within a single instruction scene */
|
package/dist/index.js
CHANGED
|
@@ -2176,7 +2176,9 @@ class Instructions extends Story {
|
|
|
2176
2176
|
easing: SCENE_TRANSITION_EASING$1
|
|
2177
2177
|
});
|
|
2178
2178
|
const backButtonText = s.backButtonText ?? options.backButtonText ?? "Back";
|
|
2179
|
+
const backButtonTextInterpolation = s.backButtonTextInterpolation ?? options.backButtonTextInterpolation;
|
|
2179
2180
|
const nextButtonText = s.nextButtonText ?? options.nextButtonText ?? "Next";
|
|
2181
|
+
const nextButtonTextInterpolation = s.nextButtonTextInterpolation ?? options.nextButtonTextInterpolation;
|
|
2180
2182
|
const backButtonWidth = s.backButtonWidth ?? options.backButtonWidth ?? 125;
|
|
2181
2183
|
const nextButtonWidth = s.nextButtonWidth ?? options.nextButtonWidth ?? 125;
|
|
2182
2184
|
const backButtonHeight = s.backButtonHeight ?? options.backButtonHeight ?? 50;
|
|
@@ -2204,6 +2206,7 @@ class Instructions extends Story {
|
|
|
2204
2206
|
if (s.title !== void 0) {
|
|
2205
2207
|
titleLabel = new Label({
|
|
2206
2208
|
text: s.title,
|
|
2209
|
+
interpolation: s.titleInterpolation,
|
|
2207
2210
|
fontSize: titleFontSize,
|
|
2208
2211
|
layout: {
|
|
2209
2212
|
marginTop: titleMarginTop,
|
|
@@ -2220,6 +2223,7 @@ class Instructions extends Story {
|
|
|
2220
2223
|
if (s.text !== void 0) {
|
|
2221
2224
|
textLabel = new Label({
|
|
2222
2225
|
text: s.text,
|
|
2226
|
+
interpolation: s.textInterpolation,
|
|
2223
2227
|
preferredMaxLayoutWidth: Dimensions.MatchConstraint,
|
|
2224
2228
|
horizontalAlignmentMode: textAlignmentMode,
|
|
2225
2229
|
fontSize: textFontSize,
|
|
@@ -2283,7 +2287,9 @@ class Instructions extends Story {
|
|
|
2283
2287
|
}
|
|
2284
2288
|
if (i > 0) {
|
|
2285
2289
|
const backButton = new Button({
|
|
2290
|
+
name: "backButton",
|
|
2286
2291
|
text: backButtonText,
|
|
2292
|
+
interpolation: backButtonTextInterpolation,
|
|
2287
2293
|
fontColor: backButtonFontColor,
|
|
2288
2294
|
backgroundColor: backButtonBackgroundColor,
|
|
2289
2295
|
size: { width: backButtonWidth, height: backButtonHeight },
|
|
@@ -2305,6 +2311,7 @@ class Instructions extends Story {
|
|
|
2305
2311
|
const nextButton = new Button({
|
|
2306
2312
|
name: "nextButton",
|
|
2307
2313
|
text: nextButtonText,
|
|
2314
|
+
interpolation: nextButtonTextInterpolation,
|
|
2308
2315
|
fontColor: nextButtonFontColor,
|
|
2309
2316
|
backgroundColor: nextButtonBackgroundColor,
|
|
2310
2317
|
size: { width: nextButtonWidth, height: nextButtonHeight },
|
|
@@ -2642,9 +2649,22 @@ class LocalePicker extends Composite {
|
|
|
2642
2649
|
isUserInteractionEnabled: true
|
|
2643
2650
|
});
|
|
2644
2651
|
this.addChild(this.iconSprite);
|
|
2645
|
-
this.iconSprite.onTapDown(() => {
|
|
2652
|
+
this.iconSprite.onTapDown((e) => {
|
|
2653
|
+
e.handled = true;
|
|
2646
2654
|
this.setDialogVisibility(true);
|
|
2647
2655
|
});
|
|
2656
|
+
this.iconSprite.onTapUp((e) => {
|
|
2657
|
+
e.handled = true;
|
|
2658
|
+
});
|
|
2659
|
+
this.iconSprite.onTapUpAny((e) => {
|
|
2660
|
+
e.handled = true;
|
|
2661
|
+
});
|
|
2662
|
+
this.iconSprite.onPointerUp((e) => {
|
|
2663
|
+
e.handled = true;
|
|
2664
|
+
});
|
|
2665
|
+
this.iconSprite.onPointerDown((e) => {
|
|
2666
|
+
e.handled = true;
|
|
2667
|
+
});
|
|
2648
2668
|
}
|
|
2649
2669
|
const overlay = new Shape({
|
|
2650
2670
|
rect: {
|
|
@@ -2658,7 +2678,7 @@ class LocalePicker extends Composite {
|
|
|
2658
2678
|
isUserInteractionEnabled: true,
|
|
2659
2679
|
hidden: true
|
|
2660
2680
|
});
|
|
2661
|
-
overlay.
|
|
2681
|
+
overlay.onTapUp((e) => {
|
|
2662
2682
|
e.handled = true;
|
|
2663
2683
|
if (this.eventListeners.length > 0) {
|
|
2664
2684
|
this.eventListeners.filter((listener) => listener.type === "LocalePickerResult").forEach((listener) => {
|
|
@@ -2679,6 +2699,18 @@ class LocalePicker extends Composite {
|
|
|
2679
2699
|
}
|
|
2680
2700
|
this.setDialogVisibility(false);
|
|
2681
2701
|
});
|
|
2702
|
+
overlay.onTapUpAny((e) => {
|
|
2703
|
+
e.handled = true;
|
|
2704
|
+
});
|
|
2705
|
+
overlay.onTapDown((e) => {
|
|
2706
|
+
e.handled = true;
|
|
2707
|
+
});
|
|
2708
|
+
overlay.onPointerUp((e) => {
|
|
2709
|
+
e.handled = true;
|
|
2710
|
+
});
|
|
2711
|
+
overlay.onPointerDown((e) => {
|
|
2712
|
+
e.handled = true;
|
|
2713
|
+
});
|
|
2682
2714
|
this.addChild(overlay);
|
|
2683
2715
|
const lineHeight = this.fontSize / this.DEFAULT_FONT_SIZE * 50;
|
|
2684
2716
|
const dialogHeight = this.localeOptions.length * lineHeight;
|
|
@@ -2702,6 +2734,18 @@ class LocalePicker extends Composite {
|
|
|
2702
2734
|
localeDialog.onTapDown((e) => {
|
|
2703
2735
|
e.handled = true;
|
|
2704
2736
|
});
|
|
2737
|
+
localeDialog.onTapUp((e) => {
|
|
2738
|
+
e.handled = true;
|
|
2739
|
+
});
|
|
2740
|
+
localeDialog.onTapUpAny((e) => {
|
|
2741
|
+
e.handled = true;
|
|
2742
|
+
});
|
|
2743
|
+
localeDialog.onPointerUp((e) => {
|
|
2744
|
+
e.handled = true;
|
|
2745
|
+
});
|
|
2746
|
+
localeDialog.onPointerDown((e) => {
|
|
2747
|
+
e.handled = true;
|
|
2748
|
+
});
|
|
2705
2749
|
this.addChild(localeDialog);
|
|
2706
2750
|
for (let i = 0; i < this.localeOptions.length; i++) {
|
|
2707
2751
|
const localeOption = this.localeOptions[i];
|
|
@@ -2724,9 +2768,22 @@ class LocalePicker extends Composite {
|
|
|
2724
2768
|
// do not localize the text of each language option
|
|
2725
2769
|
localize: false
|
|
2726
2770
|
});
|
|
2727
|
-
text.
|
|
2771
|
+
text.onTapUp((e) => {
|
|
2772
|
+
e.handled = true;
|
|
2728
2773
|
this.handleLocaleSelection(e, localeOption);
|
|
2729
2774
|
});
|
|
2775
|
+
text.onTapUpAny((e) => {
|
|
2776
|
+
e.handled = true;
|
|
2777
|
+
});
|
|
2778
|
+
text.onTapDown((e) => {
|
|
2779
|
+
e.handled = true;
|
|
2780
|
+
});
|
|
2781
|
+
text.onPointerUp((e) => {
|
|
2782
|
+
e.handled = true;
|
|
2783
|
+
});
|
|
2784
|
+
text.onPointerDown((e) => {
|
|
2785
|
+
e.handled = true;
|
|
2786
|
+
});
|
|
2730
2787
|
this.addChild(text);
|
|
2731
2788
|
} else {
|
|
2732
2789
|
this.game.imageManager.loadImages([
|
|
@@ -2776,15 +2833,27 @@ class LocalePicker extends Composite {
|
|
|
2776
2833
|
});
|
|
2777
2834
|
this.addChild(rightSelectionIndicator);
|
|
2778
2835
|
}
|
|
2779
|
-
localeSprite.
|
|
2836
|
+
localeSprite.onTapUp((e) => {
|
|
2837
|
+
e.handled = true;
|
|
2780
2838
|
this.handleLocaleSelection(e, localeOption);
|
|
2781
2839
|
});
|
|
2840
|
+
localeSprite.onTapUpAny((e) => {
|
|
2841
|
+
e.handled = true;
|
|
2842
|
+
});
|
|
2843
|
+
localeSprite.onTapDown((e) => {
|
|
2844
|
+
e.handled = true;
|
|
2845
|
+
});
|
|
2846
|
+
localeSprite.onPointerUp((e) => {
|
|
2847
|
+
e.handled = true;
|
|
2848
|
+
});
|
|
2849
|
+
localeSprite.onPointerDown((e) => {
|
|
2850
|
+
e.handled = true;
|
|
2851
|
+
});
|
|
2782
2852
|
}
|
|
2783
2853
|
}
|
|
2784
2854
|
this.needsInitialization = false;
|
|
2785
2855
|
}
|
|
2786
2856
|
handleLocaleSelection(e, localeOption) {
|
|
2787
|
-
e.handled = true;
|
|
2788
2857
|
if (this.eventListeners.length > 0) {
|
|
2789
2858
|
this.eventListeners.filter(
|
|
2790
2859
|
(listener) => listener.type === M2EventType.Composite && listener.compositeType === "LocalePickerResult" && listener.nodeUuid == this.uuid
|
|
@@ -3375,7 +3444,7 @@ M2c2KitHelpers.registerM2NodeClass(
|
|
|
3375
3444
|
CountdownTimer
|
|
3376
3445
|
);
|
|
3377
3446
|
|
|
3378
|
-
console.log("\u26AA @m2c2kit/addons version 0.3.
|
|
3447
|
+
console.log("\u26AA @m2c2kit/addons version 0.3.21 (6bd16a4e)");
|
|
3379
3448
|
|
|
3380
3449
|
export { Button, CountdownScene, CountdownTimer, Dialog, DialogResult, DrawPad, DrawPadEventType, DrawPadItemEventType, Grid, Instructions, LocalePicker, VirtualKeyboard };
|
|
3381
3450
|
//# sourceMappingURL=index.js.map
|