@m2c2kit/addons 0.3.16 → 0.3.17

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 CHANGED
@@ -869,6 +869,172 @@ declare class Instructions extends Story {
869
869
  static Create(options: InstructionsOptions): Array<Scene>;
870
870
  }
871
871
 
872
+ interface CountdownTimerOptions extends CompositeOptions {
873
+ /** Duration of the countdown, in milliseconds. Must be multiple of 1000. Default is 3000. */
874
+ milliseconds?: number;
875
+ /** Duration of each tick interval, in milliseconds. Default is 1000. */
876
+ tickIntervalMilliseconds?: number;
877
+ /** Font name for timer text (numbers). */
878
+ fontName?: string;
879
+ /** Font size for timer text (numbers). Default is 50. */
880
+ fontSize?: number;
881
+ /** Font size for timer text (numbers). Default is white. */
882
+ fontColor?: RgbaColor;
883
+ /** String to show when the timer reaches zero. Default is "0". This could be changed to another value, such as "GO!" */
884
+ zeroString?: string;
885
+ /** Shape of the timer. Default is a Royal Blue circle with a radius of 100. */
886
+ timerShape?: TimerShape;
887
+ /** Default is to center the timer text (numbers) vertically within the timer shape (verticalBias = .5). Setting verticalBias less than .5 will pull the text towards the top of the timer shape. Setting verticalBias greater than .5 will pull the text towards the bottom of the timer shape. */
888
+ textVerticalBias?: number;
889
+ }
890
+ interface TimerShape {
891
+ circle?: {
892
+ /** Radius of the circle timer shape. */
893
+ radius: number;
894
+ };
895
+ rectangle?: {
896
+ /** Width of the rectangle timer shape. */
897
+ width: number;
898
+ /** Height of the rectangle timer shape. */
899
+ height: number;
900
+ /** Corner radius of the rectangle timer shape. Default is 0. */
901
+ cornerRadius?: number;
902
+ };
903
+ /** Color of the timer shape. Default is Royal Blue. */
904
+ fillColor?: RgbaColor;
905
+ }
906
+ interface CountdownTimerEvent extends CompositeEvent {
907
+ type: "Composite";
908
+ compositeType: "CountdownTimer";
909
+ compositeEventType: "CountdownTimerTick" | "CountdownTimerComplete";
910
+ millisecondsRemaining: number;
911
+ target: CountdownTimer | string;
912
+ }
913
+ declare class CountdownTimer extends Composite implements CountdownTimerOptions {
914
+ readonly compositeType = "CountdownTimer";
915
+ private originalOptions;
916
+ private _milliseconds;
917
+ private _tickIntervalMilliseconds;
918
+ private _fontName;
919
+ private _fontSize;
920
+ private _fontColor;
921
+ private _zeroString;
922
+ private _timerShape;
923
+ private _textVerticalBias;
924
+ private countdownSequence;
925
+ private timerShapeNode?;
926
+ private timerNumberLabel?;
927
+ private _isRunning;
928
+ private hasStopped;
929
+ /**
930
+ * A countdown timer displays a number that counts down to zero.
931
+ *
932
+ * @param options
933
+ */
934
+ constructor(options: CountdownTimerOptions);
935
+ get completeNodeOptions(): {
936
+ /** Duration of the countdown, in milliseconds. Must be multiple of 1000. Default is 3000. */
937
+ milliseconds?: number;
938
+ /** Duration of each tick interval, in milliseconds. Default is 1000. */
939
+ tickIntervalMilliseconds?: number;
940
+ /** Font name for timer text (numbers). */
941
+ fontName?: string;
942
+ /** Font size for timer text (numbers). Default is 50. */
943
+ fontSize?: number;
944
+ /** Font size for timer text (numbers). Default is white. */
945
+ fontColor?: RgbaColor;
946
+ /** String to show when the timer reaches zero. Default is "0". This could be changed to another value, such as "GO!" */
947
+ zeroString?: string;
948
+ /** Shape of the timer. Default is a Royal Blue circle with a radius of 100. */
949
+ timerShape?: TimerShape;
950
+ /** Default is to center the timer text (numbers) vertically within the timer shape (verticalBias = .5). Setting verticalBias less than .5 will pull the text towards the top of the timer shape. Setting verticalBias greater than .5 will pull the text towards the bottom of the timer shape. */
951
+ textVerticalBias?: number;
952
+ name?: string;
953
+ position?: _m2c2kit_core.Point;
954
+ scale?: number;
955
+ alpha?: number;
956
+ zRotation?: number;
957
+ isUserInteractionEnabled?: boolean;
958
+ draggable?: boolean;
959
+ hidden?: boolean;
960
+ layout?: _m2c2kit_core.Layout;
961
+ uuid?: string;
962
+ suppressEvents?: boolean;
963
+ anchorPoint?: _m2c2kit_core.Point;
964
+ zPosition?: number;
965
+ };
966
+ initialize(): void;
967
+ private tick;
968
+ /**
969
+ * Starts the countdown timer.
970
+ *
971
+ * @remarks Calling start on a running timer or a stopped timer will raise
972
+ * an error.
973
+ */
974
+ start(): void;
975
+ /**
976
+ * Stops the countdown timer.
977
+ *
978
+ * @remarks This method is idempotent. Calling stop() on a stopped timer has
979
+ * no effect and will not raise an error.
980
+ */
981
+ stop(): void;
982
+ /**
983
+ * Returns true if the countdown timer is running.
984
+ */
985
+ get isRunning(): boolean;
986
+ handleCompositeEvent(event: CountdownTimerEvent): void;
987
+ /**
988
+ * Executes a callback when the timer ticks.
989
+ *
990
+ * @remarks The callback is also executed when the timer completes.
991
+ *
992
+ * @param callback - function to execute
993
+ * @param options
994
+ */
995
+ onTick(callback: (countdownTimerEvent: CountdownTimerEvent) => void, options?: CallbackOptions): void;
996
+ /**
997
+ * Executes a callback when the timer completes.
998
+ *
999
+ * @remarks This is the last tick of the timer.
1000
+ *
1001
+ * @param callback - function to execute.
1002
+ * @param options
1003
+ */
1004
+ onComplete(callback: (countdownTimerEvent: CountdownTimerEvent) => void, options?: CallbackOptions): void;
1005
+ private addCountdownTimerEventListener;
1006
+ get milliseconds(): number;
1007
+ set milliseconds(milliseconds: number);
1008
+ get tickIntervalMilliseconds(): number;
1009
+ set tickIntervalMilliseconds(tickIntervalMilliseconds: number);
1010
+ get fontColor(): RgbaColor;
1011
+ set fontColor(fontColor: RgbaColor);
1012
+ get fontName(): string | undefined;
1013
+ set fontName(fontName: string | undefined);
1014
+ get fontSize(): number;
1015
+ set fontSize(fontSize: number);
1016
+ get zeroString(): string;
1017
+ set zeroString(zeroString: string);
1018
+ get timerShape(): TimerShape;
1019
+ set timerShape(shape: TimerShape);
1020
+ get textVerticalBias(): number;
1021
+ set textVerticalBias(textVerticalBias: number);
1022
+ /**
1023
+ * Duplicates a node using deep copy.
1024
+ *
1025
+ * @remarks This is a deep recursive clone (node and children).
1026
+ * The uuid property of all duplicated nodes will be newly created,
1027
+ * because uuid must be unique.
1028
+ *
1029
+ * @param newName - optional name of the new, duplicated node. If not
1030
+ * provided, name will be the new uuid
1031
+ */
1032
+ duplicate(newName?: string | undefined): CountdownTimer;
1033
+ update(): void;
1034
+ draw(canvas: Canvas): void;
1035
+ warmup(canvas: Canvas): void;
1036
+ }
1037
+
872
1038
  interface CountdownSceneOptions extends SceneOptions {
873
1039
  /** Duration of the countdown, in milliseconds. */
874
1040
  milliseconds: number;
@@ -895,27 +1061,11 @@ interface CountdownSceneOptions extends SceneOptions {
895
1061
  /** Font size for timer numbers. Default is white. */
896
1062
  timerNumbersFontColor?: RgbaColor;
897
1063
  /** String to show when the timer reaches zero. Default is "0". This could be changed to another value, such as "GO!" */
898
- timerZeroString?: string;
1064
+ zeroString?: string;
899
1065
  /** Shape of the timer. Default is a Royal Blue circle with a radius of 100 centered vertically. */
900
1066
  timerShape?: TimerShape;
901
- }
902
- interface TimerShape {
903
- circle?: {
904
- /** Radius of the circle timer shape. */
905
- radius: number;
906
- };
907
- rectangle?: {
908
- /** Width of the rectangle timer shape. */
909
- width: number;
910
- /** Height of the rectangle timer shape. */
911
- height: number;
912
- /** Corner radius of the rectangle timer shape. Default is 0. */
913
- cornerRadius?: number;
914
- };
915
- /** Color of the timer shape. Default is Royal Blue. */
916
- fillColor?: RgbaColor;
917
1067
  /** Default is to center the timer shape vertically within the scene (verticalBias = .5). Setting verticalBias less than .5 will pull the shape towards the top. Setting verticalBias greater than .5 will pull the shape towards the bottom. */
918
- verticalBias?: number;
1068
+ shapeVerticalBias?: number;
919
1069
  }
920
1070
  declare class CountdownScene extends Scene {
921
1071
  /**
@@ -1081,4 +1231,4 @@ declare class LocalePicker extends Composite {
1081
1231
  duplicate(newName?: string): LocalePicker;
1082
1232
  }
1083
1233
 
1084
- export { Button, type ButtonOptions, CountdownScene, type CountdownSceneOptions, Dialog, type DialogEvent, type DialogOptions, DialogResult, DrawPad, type DrawPadEvent, DrawPadEventType, type DrawPadItem, type DrawPadItemEvent, DrawPadItemEventType, type DrawPadOptions, type DrawPadStroke, Grid, type GridChild, type GridOptions, type InstructionScene, Instructions, type InstructionsOptions, type KeyConfiguration, type KeyTapMetadata, type LocaleOption, LocalePicker, type LocalePickerEvent, type LocalePickerIcon, type LocalePickerOptions, type LocalePickerResult, type StrokeInteraction, type TimerShape, VirtualKeyboard, type VirtualKeyboardEvent, type VirtualKeyboardOptions, type VirtualKeyboardRow };
1234
+ export { Button, type ButtonOptions, CountdownScene, type CountdownSceneOptions, CountdownTimer, type CountdownTimerEvent, type CountdownTimerOptions, Dialog, type DialogEvent, type DialogOptions, DialogResult, DrawPad, type DrawPadEvent, DrawPadEventType, type DrawPadItem, type DrawPadItemEvent, DrawPadItemEventType, type DrawPadOptions, type DrawPadStroke, Grid, type GridChild, type GridOptions, type InstructionScene, Instructions, type InstructionsOptions, type KeyConfiguration, type KeyTapMetadata, type LocaleOption, LocalePicker, type LocalePickerEvent, type LocalePickerIcon, type LocalePickerOptions, type LocalePickerResult, type StrokeInteraction, type TimerShape, VirtualKeyboard, type VirtualKeyboardEvent, type VirtualKeyboardOptions, type VirtualKeyboardRow };
package/dist/index.js CHANGED
@@ -293,18 +293,16 @@ class Grid extends Composite {
293
293
  set gridChildren(gridChildren) {
294
294
  this._gridChildren = gridChildren;
295
295
  this.needsInitialization = true;
296
- if (this.game.eventStore.mode === EventStoreMode.Record) {
297
- this.savePropertyChangeEvent(
298
- "gridChildren",
299
- this.gridChildren.map(
300
- (gridChild) => ({
301
- node: gridChild.node.uuid,
302
- row: gridChild.row,
303
- column: gridChild.column
304
- })
305
- )
306
- );
307
- }
296
+ this.savePropertyChangeEvent(
297
+ "gridChildren",
298
+ this.gridChildren.map(
299
+ (gridChild) => ({
300
+ node: gridChild.node.uuid,
301
+ row: gridChild.row,
302
+ column: gridChild.column
303
+ })
304
+ )
305
+ );
308
306
  }
309
307
  /**
310
308
  * Removes all grid children from the grid.
@@ -2398,7 +2396,7 @@ class CountdownScene extends Scene {
2398
2396
  bottomToBottomOf: this,
2399
2397
  startToStartOf: this,
2400
2398
  endToEndOf: this,
2401
- verticalBias: options?.timerShape?.verticalBias ?? 0.5
2399
+ verticalBias: options?.shapeVerticalBias ?? 0.5
2402
2400
  }
2403
2401
  },
2404
2402
  fillColor: options?.timerShape?.fillColor ?? WebColors.RoyalBlue
@@ -2417,7 +2415,7 @@ class CountdownScene extends Scene {
2417
2415
  bottomToBottomOf: this,
2418
2416
  startToStartOf: this,
2419
2417
  endToEndOf: this,
2420
- verticalBias: options?.timerShape?.verticalBias ?? 0.5
2418
+ verticalBias: options.shapeVerticalBias ?? 0.5
2421
2419
  }
2422
2420
  },
2423
2421
  fillColor: options?.timerShape?.fillColor ?? WebColors.RoyalBlue
@@ -2465,7 +2463,7 @@ class CountdownScene extends Scene {
2465
2463
  countdownSequence.push(
2466
2464
  Action.custom({
2467
2465
  callback: () => {
2468
- timerNumberLabel.text = options?.timerZeroString ?? "0";
2466
+ timerNumberLabel.text = options?.zeroString ?? "0";
2469
2467
  }
2470
2468
  })
2471
2469
  );
@@ -2965,7 +2963,394 @@ class LocalePicker extends Composite {
2965
2963
  }
2966
2964
  }
2967
2965
 
2968
- console.log("\u26AA @m2c2kit/addons version 0.3.16 (0679492d)");
2966
+ class CountdownTimer extends Composite {
2967
+ /**
2968
+ * A countdown timer displays a number that counts down to zero.
2969
+ *
2970
+ * @param options
2971
+ */
2972
+ constructor(options) {
2973
+ super(options);
2974
+ this.compositeType = "CountdownTimer";
2975
+ this._milliseconds = 3e3;
2976
+ this._tickIntervalMilliseconds = 1e3;
2977
+ this._fontSize = 50;
2978
+ this._fontColor = WebColors.White;
2979
+ this._zeroString = "0";
2980
+ this._timerShape = {
2981
+ circle: {
2982
+ radius: 100
2983
+ },
2984
+ fillColor: WebColors.RoyalBlue
2985
+ };
2986
+ this._textVerticalBias = 0.5;
2987
+ this.countdownSequence = new Array();
2988
+ this._isRunning = false;
2989
+ this.hasStopped = false;
2990
+ this.originalOptions = JSON.parse(JSON.stringify(options));
2991
+ if (options.milliseconds) {
2992
+ this.milliseconds = options.milliseconds;
2993
+ }
2994
+ if (options.tickIntervalMilliseconds) {
2995
+ this.tickIntervalMilliseconds = options.tickIntervalMilliseconds;
2996
+ }
2997
+ if (options.fontName) {
2998
+ this.fontName = options.fontName;
2999
+ }
3000
+ if (options.fontSize !== void 0) {
3001
+ this.fontSize = options.fontSize;
3002
+ }
3003
+ if (options.fontColor) {
3004
+ this.fontColor = options.fontColor;
3005
+ }
3006
+ if (options.zeroString !== void 0) {
3007
+ this.zeroString = options.zeroString;
3008
+ }
3009
+ if (options.timerShape) {
3010
+ this.timerShape = options.timerShape;
3011
+ }
3012
+ if (options.textVerticalBias !== void 0) {
3013
+ this.textVerticalBias = options.textVerticalBias;
3014
+ }
3015
+ this.saveNodeNewEvent();
3016
+ }
3017
+ get completeNodeOptions() {
3018
+ return {
3019
+ ...this.options,
3020
+ ...this.getNodeOptions(),
3021
+ ...this.getDrawableOptions(),
3022
+ ...this.originalOptions
3023
+ };
3024
+ }
3025
+ initialize() {
3026
+ this.removeAllChildren();
3027
+ if (this.timerShape?.circle === void 0 && this.timerShape?.rectangle === void 0 || this.timerShape?.circle !== void 0) {
3028
+ this.timerShapeNode = new Shape({
3029
+ circleOfRadius: this.timerShape.circle?.radius ?? 100,
3030
+ fillColor: this.timerShape?.fillColor ?? WebColors.RoyalBlue
3031
+ });
3032
+ this.addChild(this.timerShapeNode);
3033
+ } else if (this.timerShape?.rectangle !== void 0) {
3034
+ this.timerShapeNode = new Shape({
3035
+ rect: {
3036
+ width: this.timerShape?.rectangle?.width ?? 200,
3037
+ height: this.timerShape?.rectangle?.height ?? 200
3038
+ },
3039
+ cornerRadius: this.timerShape?.rectangle?.cornerRadius,
3040
+ fillColor: this.timerShape?.fillColor ?? WebColors.RoyalBlue
3041
+ });
3042
+ this.addChild(this.timerShapeNode);
3043
+ } else {
3044
+ throw new Error("Invalid timer shape options.");
3045
+ }
3046
+ this.size = this.timerShapeNode.size;
3047
+ if (this.milliseconds % 1e3 !== 0) {
3048
+ throw new Error(
3049
+ "CountdownTimer milliseconds must be a multiple of 1000."
3050
+ );
3051
+ }
3052
+ const timerInitialNumber = Math.floor(this.milliseconds / 1e3);
3053
+ this.timerNumberLabel = new Label({
3054
+ text: timerInitialNumber.toString(),
3055
+ fontSize: this.fontSize,
3056
+ fontName: this._fontName,
3057
+ fontColor: this.fontColor,
3058
+ layout: {
3059
+ constraints: {
3060
+ topToTopOf: this.timerShapeNode,
3061
+ bottomToBottomOf: this.timerShapeNode,
3062
+ startToStartOf: this.timerShapeNode,
3063
+ endToEndOf: this.timerShapeNode,
3064
+ verticalBias: this.textVerticalBias
3065
+ }
3066
+ }
3067
+ });
3068
+ this.timerShapeNode.addChild(this.timerNumberLabel);
3069
+ this.countdownSequence = new Array();
3070
+ for (let i = this.milliseconds; i > this.tickIntervalMilliseconds; i = i - this.tickIntervalMilliseconds) {
3071
+ this.countdownSequence.push(
3072
+ Action.wait({ duration: this.tickIntervalMilliseconds })
3073
+ );
3074
+ this.countdownSequence.push(
3075
+ Action.custom({
3076
+ callback: () => {
3077
+ this.tick(i - this.tickIntervalMilliseconds);
3078
+ }
3079
+ })
3080
+ );
3081
+ }
3082
+ this.countdownSequence.push(
3083
+ Action.wait({ duration: this.tickIntervalMilliseconds })
3084
+ );
3085
+ this.countdownSequence.push(
3086
+ Action.custom({
3087
+ callback: () => {
3088
+ this.tick(0);
3089
+ const countdownTimerEvent = {
3090
+ type: M2EventType.Composite,
3091
+ compositeType: this.compositeType,
3092
+ compositeEventType: "CountdownTimerComplete",
3093
+ target: this,
3094
+ handled: false,
3095
+ millisecondsRemaining: 0,
3096
+ ...M2c2KitHelpers.createTimestamps()
3097
+ };
3098
+ this.handleCompositeEvent(countdownTimerEvent);
3099
+ this.saveEvent(countdownTimerEvent);
3100
+ if (this.eventListeners.length > 0) {
3101
+ this.eventListeners.filter(
3102
+ (listener) => listener.type === M2EventType.Composite && listener.compositeType === "CountdownTimer" && listener.compositeEventType === "CountdownTimerComplete"
3103
+ ).forEach((listener) => {
3104
+ listener.callback(countdownTimerEvent);
3105
+ });
3106
+ }
3107
+ }
3108
+ })
3109
+ );
3110
+ this.needsInitialization = false;
3111
+ }
3112
+ tick(millisecondsRemaining) {
3113
+ const countdownTimerEvent = {
3114
+ type: M2EventType.Composite,
3115
+ compositeType: this.compositeType,
3116
+ compositeEventType: "CountdownTimerTick",
3117
+ target: this,
3118
+ handled: false,
3119
+ millisecondsRemaining,
3120
+ ...M2c2KitHelpers.createTimestamps()
3121
+ };
3122
+ this.handleCompositeEvent(countdownTimerEvent);
3123
+ this.saveEvent(countdownTimerEvent);
3124
+ if (this.eventListeners.length > 0) {
3125
+ this.eventListeners.filter(
3126
+ (listener) => listener.type === M2EventType.Composite && listener.compositeType === "CountdownTimer" && listener.compositeEventType === "CountdownTimerTick"
3127
+ ).forEach((listener) => {
3128
+ listener.callback(countdownTimerEvent);
3129
+ });
3130
+ }
3131
+ }
3132
+ /**
3133
+ * Starts the countdown timer.
3134
+ *
3135
+ * @remarks Calling start on a running timer or a stopped timer will raise
3136
+ * an error.
3137
+ */
3138
+ start() {
3139
+ if (this.isRunning) {
3140
+ throw new Error("CountdownTimer: cannot start. It is already running.");
3141
+ }
3142
+ if (this.hasStopped) {
3143
+ throw new Error(
3144
+ "CountdownTimer: It has stopped. You cannot start a stopped CountdownTimer. Instead, create a new CountdownTimer."
3145
+ );
3146
+ }
3147
+ this.run(
3148
+ Action.sequence(this.countdownSequence),
3149
+ "__countdownSequenceAction"
3150
+ );
3151
+ this._isRunning = true;
3152
+ }
3153
+ /**
3154
+ * Stops the countdown timer.
3155
+ *
3156
+ * @remarks This method is idempotent. Calling stop() on a stopped timer has
3157
+ * no effect and will not raise an error.
3158
+ */
3159
+ stop() {
3160
+ if (this.isRunning) {
3161
+ this.removeAction("__countdownSequenceAction");
3162
+ this._isRunning = false;
3163
+ this.hasStopped = true;
3164
+ }
3165
+ }
3166
+ /**
3167
+ * Returns true if the countdown timer is running.
3168
+ */
3169
+ get isRunning() {
3170
+ return this._isRunning;
3171
+ }
3172
+ handleCompositeEvent(event) {
3173
+ if (!this.timerNumberLabel) {
3174
+ throw new Error("Timer number label not found.");
3175
+ }
3176
+ switch (event.compositeEventType) {
3177
+ case "CountdownTimerTick": {
3178
+ this.timerNumberLabel.text = Math.ceil(
3179
+ event.millisecondsRemaining / 1e3
3180
+ ).toString();
3181
+ break;
3182
+ }
3183
+ case "CountdownTimerComplete": {
3184
+ this.timerNumberLabel.text = this.zeroString;
3185
+ break;
3186
+ }
3187
+ default:
3188
+ throw new Error(
3189
+ `Invalid TimerCountdown event type: ${event.compositeEventType}`
3190
+ );
3191
+ }
3192
+ }
3193
+ /**
3194
+ * Executes a callback when the timer ticks.
3195
+ *
3196
+ * @remarks The callback is also executed when the timer completes.
3197
+ *
3198
+ * @param callback - function to execute
3199
+ * @param options
3200
+ */
3201
+ onTick(callback, options) {
3202
+ const eventListener = {
3203
+ type: M2EventType.Composite,
3204
+ compositeEventType: "CountdownTimerTick",
3205
+ compositeType: this.compositeType,
3206
+ nodeUuid: this.uuid,
3207
+ callback
3208
+ };
3209
+ this.addCountdownTimerEventListener(eventListener, options);
3210
+ }
3211
+ /**
3212
+ * Executes a callback when the timer completes.
3213
+ *
3214
+ * @remarks This is the last tick of the timer.
3215
+ *
3216
+ * @param callback - function to execute.
3217
+ * @param options
3218
+ */
3219
+ onComplete(callback, options) {
3220
+ const eventListener = {
3221
+ type: M2EventType.Composite,
3222
+ compositeEventType: "CountdownTimerComplete",
3223
+ compositeType: this.compositeType,
3224
+ nodeUuid: this.uuid,
3225
+ callback
3226
+ };
3227
+ this.addCountdownTimerEventListener(eventListener, options);
3228
+ }
3229
+ addCountdownTimerEventListener(eventListener, options) {
3230
+ if (options?.replaceExisting) {
3231
+ this.eventListeners = this.eventListeners.filter(
3232
+ (listener) => !(listener.nodeUuid === eventListener.nodeUuid && listener.type === eventListener.type && listener.compositeType === eventListener.compositeType)
3233
+ );
3234
+ }
3235
+ this.eventListeners.push(eventListener);
3236
+ }
3237
+ get milliseconds() {
3238
+ return this._milliseconds;
3239
+ }
3240
+ set milliseconds(milliseconds) {
3241
+ if (Equal.value(this._milliseconds, milliseconds)) {
3242
+ return;
3243
+ }
3244
+ this._milliseconds = milliseconds;
3245
+ this.savePropertyChangeEvent("milliseconds", milliseconds);
3246
+ }
3247
+ get tickIntervalMilliseconds() {
3248
+ return this._tickIntervalMilliseconds;
3249
+ }
3250
+ set tickIntervalMilliseconds(tickIntervalMilliseconds) {
3251
+ if (Equal.value(this._tickIntervalMilliseconds, tickIntervalMilliseconds)) {
3252
+ return;
3253
+ }
3254
+ this._tickIntervalMilliseconds = tickIntervalMilliseconds;
3255
+ this.savePropertyChangeEvent(
3256
+ "tickIntervalMilliseconds",
3257
+ tickIntervalMilliseconds
3258
+ );
3259
+ }
3260
+ get fontColor() {
3261
+ return this._fontColor;
3262
+ }
3263
+ set fontColor(fontColor) {
3264
+ if (Equal.value(this._fontColor, fontColor)) {
3265
+ return;
3266
+ }
3267
+ this._fontColor = fontColor;
3268
+ this.needsInitialization = true;
3269
+ this.savePropertyChangeEvent("fontColor", fontColor);
3270
+ }
3271
+ get fontName() {
3272
+ return this._fontName;
3273
+ }
3274
+ set fontName(fontName) {
3275
+ if (this._fontName === fontName) {
3276
+ return;
3277
+ }
3278
+ this._fontName = fontName;
3279
+ this.needsInitialization = true;
3280
+ this.savePropertyChangeEvent("fontName", fontName);
3281
+ }
3282
+ get fontSize() {
3283
+ return this._fontSize;
3284
+ }
3285
+ set fontSize(fontSize) {
3286
+ if (Equal.value(this._fontSize, fontSize)) {
3287
+ return;
3288
+ }
3289
+ this._fontSize = fontSize;
3290
+ this.needsInitialization = true;
3291
+ this.savePropertyChangeEvent("fontSize", fontSize);
3292
+ }
3293
+ get zeroString() {
3294
+ return this._zeroString;
3295
+ }
3296
+ set zeroString(zeroString) {
3297
+ if (this._zeroString === zeroString) {
3298
+ return;
3299
+ }
3300
+ this._zeroString = zeroString;
3301
+ this.savePropertyChangeEvent("zeroString", zeroString);
3302
+ }
3303
+ get timerShape() {
3304
+ return this._timerShape;
3305
+ }
3306
+ set timerShape(shape) {
3307
+ if (Equal.value(this._timerShape, shape)) {
3308
+ return;
3309
+ }
3310
+ this._timerShape = shape;
3311
+ this.savePropertyChangeEvent("timerShape", shape);
3312
+ }
3313
+ get textVerticalBias() {
3314
+ return this._textVerticalBias;
3315
+ }
3316
+ set textVerticalBias(textVerticalBias) {
3317
+ if (Equal.value(this._textVerticalBias, textVerticalBias)) {
3318
+ return;
3319
+ }
3320
+ this._textVerticalBias = textVerticalBias;
3321
+ this.savePropertyChangeEvent("textVerticalBias", textVerticalBias);
3322
+ }
3323
+ /**
3324
+ * Duplicates a node using deep copy.
3325
+ *
3326
+ * @remarks This is a deep recursive clone (node and children).
3327
+ * The uuid property of all duplicated nodes will be newly created,
3328
+ * because uuid must be unique.
3329
+ *
3330
+ * @param newName - optional name of the new, duplicated node. If not
3331
+ * provided, name will be the new uuid
3332
+ */
3333
+ duplicate(newName) {
3334
+ throw new Error(`Method not implemented. ${newName}`);
3335
+ }
3336
+ update() {
3337
+ super.update();
3338
+ }
3339
+ draw(canvas) {
3340
+ super.drawChildren(canvas);
3341
+ }
3342
+ warmup(canvas) {
3343
+ this.initialize();
3344
+ this.children.filter((child) => child.isDrawable).forEach((child) => {
3345
+ child.warmup(canvas);
3346
+ });
3347
+ }
3348
+ }
3349
+ M2c2KitHelpers.registerM2NodeClass(
3350
+ CountdownTimer
3351
+ );
3352
+
3353
+ console.log("\u26AA @m2c2kit/addons version 0.3.17 (faa531ea)");
2969
3354
 
2970
- export { Button, CountdownScene, Dialog, DialogResult, DrawPad, DrawPadEventType, DrawPadItemEventType, Grid, Instructions, LocalePicker, VirtualKeyboard };
3355
+ export { Button, CountdownScene, CountdownTimer, Dialog, DialogResult, DrawPad, DrawPadEventType, DrawPadItemEventType, Grid, Instructions, LocalePicker, VirtualKeyboard };
2971
3356
  //# sourceMappingURL=index.js.map