@flashist/flibs 0.0.248 → 0.0.249
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/TestLibClass.js +3 -5
- package/TestLibClass.js.map +1 -1
- package/base/data/BaseDataVO.js +57 -100
- package/base/data/BaseDataVO.js.map +1 -1
- package/base/data/BaseDataVOEvent.js +1 -1
- package/base/data/BaseDataVOEvent.js.map +1 -1
- package/device/tools/DeviceFullscreenTools.js +106 -125
- package/device/tools/DeviceFullscreenTools.js.map +1 -1
- package/device/tools/DeviceTools.js +12 -16
- package/device/tools/DeviceTools.js.map +1 -1
- package/display/pixijs/custom/FApp.js +24 -47
- package/display/pixijs/custom/FApp.js.map +1 -1
- package/display/pixijs/custom/display/FContainer.js +89 -125
- package/display/pixijs/custom/display/FContainer.js.map +1 -1
- package/display/pixijs/custom/display/FStage.js +7 -26
- package/display/pixijs/custom/display/FStage.js.map +1 -1
- package/display/pixijs/custom/display/events/FDisplayEvent.js +1 -1
- package/display/pixijs/custom/display/events/FDisplayEvent.js.map +1 -1
- package/display/pixijs/custom/display/text/FLabel.js +331 -465
- package/display/pixijs/custom/display/text/FLabel.js.map +1 -1
- package/display/pixijs/custom/display/text/FLabelDefaultConfig.js +3 -5
- package/display/pixijs/custom/display/text/FLabelDefaultConfig.js.map +1 -1
- package/display/pixijs/custom/display/text/FLabelEvent.js +1 -1
- package/display/pixijs/custom/display/text/FLabelEvent.js.map +1 -1
- package/display/pixijs/custom/display/tools/FDisplayTools.js +18 -23
- package/display/pixijs/custom/display/tools/FDisplayTools.js.map +1 -1
- package/display/pixijs/display/events/DisplayEvent.js +1 -1
- package/display/pixijs/display/events/DisplayEvent.js.map +1 -1
- package/display/pixijs/display/events/InteractiveEvent.js +1 -1
- package/display/pixijs/display/events/InteractiveEvent.js.map +1 -1
- package/display/pixijs/display/tools/DisplayResizeTools.js +10 -14
- package/display/pixijs/display/tools/DisplayResizeTools.js.map +1 -1
- package/display/pixijs/display/tools/DisplayTools.js +14 -19
- package/display/pixijs/display/tools/DisplayTools.js.map +1 -1
- package/display/pixijs/display/tools/FLabelTools.js +9 -15
- package/display/pixijs/display/tools/FLabelTools.js.map +1 -1
- package/display/pixijs/display/tools/GraphicsTools.js +5 -13
- package/display/pixijs/display/tools/GraphicsTools.js.map +1 -1
- package/html/tools/HtmlTools.js +6 -10
- package/html/tools/HtmlTools.js.map +1 -1
- package/input/pixijs/InputManager.js +58 -88
- package/input/pixijs/InputManager.js.map +1 -1
- package/input/pixijs/InputManagerEvent.js +1 -1
- package/input/pixijs/InputManagerEvent.js.map +1 -1
- package/input/pixijs/InputManagerEventData.js +3 -5
- package/input/pixijs/InputManagerEventData.js.map +1 -1
- package/load/abstract/AbstractLoadFactory.js +12 -14
- package/load/abstract/AbstractLoadFactory.js.map +1 -1
- package/load/abstract/AbstractLoadManager.js +41 -70
- package/load/abstract/AbstractLoadManager.js.map +1 -1
- package/load/abstract/LoadEvent.js +1 -1
- package/load/abstract/LoadEvent.js.map +1 -1
- package/load/abstract/LoadResourcesCache.js +11 -15
- package/load/abstract/LoadResourcesCache.js.map +1 -1
- package/load/abstract/Loader.js +51 -79
- package/load/abstract/Loader.js.map +1 -1
- package/load/abstract/LoaderQueue.js +16 -18
- package/load/abstract/LoaderQueue.js.map +1 -1
- package/load/abstract/commands/LoadItemCommand.js +16 -36
- package/load/abstract/commands/LoadItemCommand.js.map +1 -1
- package/load/abstract/commands/LoadItemsListCommand.js +16 -37
- package/load/abstract/commands/LoadItemsListCommand.js.map +1 -1
- package/load/abstract/commands/WaitGroupLoadingCompleteCommand.js +11 -31
- package/load/abstract/commands/WaitGroupLoadingCompleteCommand.js.map +1 -1
- package/load/abstract/data/FileType.js +1 -1
- package/load/abstract/data/FileType.js.map +1 -1
- package/load/abstract/group/LoadGroup.js +38 -67
- package/load/abstract/group/LoadGroup.js.map +1 -1
- package/load/abstract/item/AbstractLoadItem.js +51 -76
- package/load/abstract/item/AbstractLoadItem.js.map +1 -1
- package/load/abstract/item/AbstractSoundLoadItem.js +2 -23
- package/load/abstract/item/AbstractSoundLoadItem.js.map +1 -1
- package/load/abstract/item/DefaultLoadItemConfig.js +9 -11
- package/load/abstract/item/DefaultLoadItemConfig.js.map +1 -1
- package/load/abstract/loadstatus/LoadStatusEvent.js +1 -1
- package/load/abstract/loadstatus/LoadStatusEvent.js.map +1 -1
- package/load/abstract/loadstatus/LoadStatusPriority.js +2 -2
- package/load/abstract/loadstatus/LoadStatusPriority.js.map +1 -1
- package/load/abstract/loadstatus/LoadStatusPriorityTools.js +8 -13
- package/load/abstract/loadstatus/LoadStatusPriorityTools.js.map +1 -1
- package/load/abstract/progress/LoadProgressTool.js +10 -15
- package/load/abstract/progress/LoadProgressTool.js.map +1 -1
- package/load/preloadjspixihowler/PreloadjsPixiLoadFactory.js +12 -37
- package/load/preloadjspixihowler/PreloadjsPixiLoadFactory.js.map +1 -1
- package/load/preloadjspixihowler/PreloadjsPixiLoadManager.js +6 -31
- package/load/preloadjspixihowler/PreloadjsPixiLoadManager.js.map +1 -1
- package/load/preloadjspixihowler/item/FileLoadItem.js +30 -52
- package/load/preloadjspixihowler/item/FileLoadItem.js.map +1 -1
- package/load/preloadjspixihowler/item/FontLoadItem.js +40 -56
- package/load/preloadjspixihowler/item/FontLoadItem.js.map +1 -1
- package/load/preloadjspixihowler/item/HowlerSoundLoadItem.js +30 -50
- package/load/preloadjspixihowler/item/HowlerSoundLoadItem.js.map +1 -1
- package/load/preloadjspixihowler/item/PixiImageLoadItem.js +4 -25
- package/load/preloadjspixihowler/item/PixiImageLoadItem.js.map +1 -1
- package/load/preloadjspixihowler/item/PixiSpineLoadItem.js +4 -25
- package/load/preloadjspixihowler/item/PixiSpineLoadItem.js.map +1 -1
- package/load/preloadjspixihowler/item/PreloadjsLoadQueueEventType.js +1 -1
- package/load/preloadjspixihowler/item/PreloadjsLoadQueueEventType.js.map +1 -1
- package/load/tools/LoadTools.js +4 -8
- package/load/tools/LoadTools.js.map +1 -1
- package/locale/ILocaleConfig.js +2 -6
- package/locale/ILocaleConfig.js.map +1 -1
- package/locale/LanguageId.js +4 -8
- package/locale/LanguageId.js.map +1 -1
- package/locale/LocaleManager.js +37 -48
- package/locale/LocaleManager.js.map +1 -1
- package/model/generic/GenericObjectsByTypeModel.js +21 -25
- package/model/generic/GenericObjectsByTypeModel.js.map +1 -1
- package/model/generic/GenericObjectsModel.js +27 -58
- package/model/generic/GenericObjectsModel.js.map +1 -1
- package/model/generic/GenericObjectsModelEvent.js +1 -1
- package/model/generic/GenericObjectsModelEvent.js.map +1 -1
- package/other/KeyCodes.js +1 -1
- package/other/KeyCodes.js.map +1 -1
- package/other/cursor/CSSCursor.js +1 -1
- package/other/cursor/CSSCursor.js.map +1 -1
- package/other/dragHelper/DragHelper.js +97 -156
- package/other/dragHelper/DragHelper.js.map +1 -1
- package/other/dragHelper/DragHelperEvent.js +5 -9
- package/other/dragHelper/DragHelperEvent.js.map +1 -1
- package/package.json +1 -1
- package/pool/ServiceLocatorObjectsPool.js +4 -38
- package/pool/ServiceLocatorObjectsPool.js.map +1 -1
- package/servicelocator/ServiceLocator.js +50 -71
- package/servicelocator/ServiceLocator.js.map +1 -1
- package/servicelocator/ServiceLocatorShortcuts.js +4 -4
- package/servicelocator/ServiceLocatorShortcuts.js.map +1 -1
- package/sounds/abstract/AbstractSound.js +22 -44
- package/sounds/abstract/AbstractSound.js.map +1 -1
- package/sounds/abstract/AbstractSoundsManager.js +70 -109
- package/sounds/abstract/AbstractSoundsManager.js.map +1 -1
- package/sounds/abstract/SoundsManagerEvent.js +1 -1
- package/sounds/abstract/SoundsManagerEvent.js.map +1 -1
- package/sounds/howler/HowlerSound.js +20 -44
- package/sounds/howler/HowlerSound.js.map +1 -1
- package/sounds/howler/HowlerSoundEvent.js +1 -1
- package/sounds/howler/HowlerSoundEvent.js.map +1 -1
- package/sounds/howler/HowlerSoundsManager.js +6 -33
- package/sounds/howler/HowlerSoundsManager.js.map +1 -1
- package/timeout/tools/TimeoutTools.js +9 -42
- package/timeout/tools/TimeoutTools.js.map +1 -1
|
@@ -1,39 +1,23 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
1
|
import { ObjectTools } from "@flashist/fcore";
|
|
17
2
|
import { Rectangle } from "pixi.js";
|
|
18
3
|
import { Text, BitmapText, Graphics, Align, VAlign, FLabelEvent, AutosizeType, DisplayResizeTools, FLabelTools } from "../../../../../index";
|
|
19
4
|
import { FLabelDefaultConfig } from "./FLabelDefaultConfig";
|
|
20
5
|
import { FContainer } from "../FContainer";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _super.call(this, config) || this;
|
|
6
|
+
export class FLabel extends FContainer {
|
|
7
|
+
constructor(config) {
|
|
8
|
+
super(config);
|
|
25
9
|
}
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
construction(config) {
|
|
11
|
+
super.construction();
|
|
28
12
|
this.fieldLocalBounds = new Rectangle();
|
|
29
13
|
// Properties overriding
|
|
30
14
|
//
|
|
31
15
|
// width
|
|
32
16
|
Object.defineProperty(this, "width", {
|
|
33
|
-
get
|
|
17
|
+
get() {
|
|
34
18
|
return this._width;
|
|
35
19
|
},
|
|
36
|
-
set
|
|
20
|
+
set(value) {
|
|
37
21
|
if (value === this._width) {
|
|
38
22
|
return;
|
|
39
23
|
}
|
|
@@ -43,10 +27,10 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
43
27
|
});
|
|
44
28
|
// height
|
|
45
29
|
Object.defineProperty(this, "height", {
|
|
46
|
-
get
|
|
30
|
+
get() {
|
|
47
31
|
return this._height;
|
|
48
32
|
},
|
|
49
|
-
set
|
|
33
|
+
set(value) {
|
|
50
34
|
if (value === this._height) {
|
|
51
35
|
return;
|
|
52
36
|
}
|
|
@@ -70,20 +54,20 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
70
54
|
this._width = this.field.width;
|
|
71
55
|
this._height = this.field.height;
|
|
72
56
|
this.updateBg();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
57
|
+
}
|
|
58
|
+
destruction() {
|
|
59
|
+
super.destruction();
|
|
76
60
|
if (this.field) {
|
|
77
61
|
this.field.destroy();
|
|
78
62
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
63
|
+
}
|
|
64
|
+
createField() {
|
|
81
65
|
if (this.field) {
|
|
82
66
|
this.field.parent.removeChild(this.field);
|
|
83
67
|
this.field = null;
|
|
84
68
|
}
|
|
85
69
|
if (this.config.isBitmap) {
|
|
86
|
-
|
|
70
|
+
let bitmapConfig = {
|
|
87
71
|
fontName: this.config.fontFamily
|
|
88
72
|
};
|
|
89
73
|
if (this.config.size) {
|
|
@@ -100,11 +84,11 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
100
84
|
this.applyStyle();
|
|
101
85
|
this.addChild(this.field);
|
|
102
86
|
this.field.mask = this.fieldMask;
|
|
103
|
-
}
|
|
104
|
-
|
|
87
|
+
}
|
|
88
|
+
applyStyle() {
|
|
105
89
|
if (this.config.isBitmap) {
|
|
106
90
|
// ToDo: implement configuring bitmap fields
|
|
107
|
-
|
|
91
|
+
const bitmapField = this.field;
|
|
108
92
|
if (this.config.fontFamily) {
|
|
109
93
|
bitmapField.fontName = this.config.fontFamily;
|
|
110
94
|
}
|
|
@@ -119,7 +103,7 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
119
103
|
}
|
|
120
104
|
}
|
|
121
105
|
else {
|
|
122
|
-
|
|
106
|
+
const textField = this.field;
|
|
123
107
|
if (this.config.fontFamily) {
|
|
124
108
|
textField.style.fontFamily = this.config.fontFamily;
|
|
125
109
|
}
|
|
@@ -196,13 +180,13 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
196
180
|
}
|
|
197
181
|
}
|
|
198
182
|
this.arrange();
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
183
|
+
}
|
|
184
|
+
commitData() {
|
|
185
|
+
super.commitData();
|
|
202
186
|
this.arrange();
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
187
|
+
}
|
|
188
|
+
arrange() {
|
|
189
|
+
super.arrange();
|
|
206
190
|
// Reset Field Scale
|
|
207
191
|
this.field.scale.set(1);
|
|
208
192
|
//
|
|
@@ -223,7 +207,7 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
223
207
|
}
|
|
224
208
|
}
|
|
225
209
|
}
|
|
226
|
-
|
|
210
|
+
let tempFieldScale = 1;
|
|
227
211
|
if (this.fitToSize) {
|
|
228
212
|
// IMPORTANT: this is a performance-requiring task!
|
|
229
213
|
if (this.changeFontSizeToFit) {
|
|
@@ -238,7 +222,7 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
238
222
|
this.fieldLocalBounds = this.field.getLocalBounds();
|
|
239
223
|
this.bg.width = this._width;
|
|
240
224
|
this.bg.height = this._height;
|
|
241
|
-
|
|
225
|
+
let newX = this.fieldPaddingX;
|
|
242
226
|
switch (this.align) {
|
|
243
227
|
case Align.CENTER:
|
|
244
228
|
newX = Math.floor((this._width - (this.textWidth * this.field.scale.x)) * 0.5);
|
|
@@ -248,7 +232,7 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
248
232
|
break;
|
|
249
233
|
}
|
|
250
234
|
this.field.x = newX;
|
|
251
|
-
|
|
235
|
+
let newY = this.fieldPaddingY;
|
|
252
236
|
switch (this.valign) {
|
|
253
237
|
case VAlign.MIDDLE:
|
|
254
238
|
newY = Math.floor((this._height - (this.textHeight * this.field.scale.y)) * 0.5);
|
|
@@ -262,164 +246,128 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
262
246
|
this.fieldMask.y = this.fieldPaddingY;
|
|
263
247
|
this.fieldMask.width = this._width - (this.fieldPaddingX * 2);
|
|
264
248
|
this.fieldMask.height = this._height - (this.fieldPaddingY * 2);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
return
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
enumerable: false,
|
|
388
|
-
configurable: true
|
|
389
|
-
});
|
|
390
|
-
Object.defineProperty(FLabel.prototype, "bgAlpha", {
|
|
391
|
-
get: function () {
|
|
392
|
-
return this.config.bgAlpha;
|
|
393
|
-
},
|
|
394
|
-
set: function (value) {
|
|
395
|
-
if (value === this.config.bgAlpha) {
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
this.config.bgAlpha = value;
|
|
399
|
-
this.updateBg();
|
|
400
|
-
this.arrange();
|
|
401
|
-
},
|
|
402
|
-
enumerable: false,
|
|
403
|
-
configurable: true
|
|
404
|
-
});
|
|
405
|
-
Object.defineProperty(FLabel.prototype, "bgColor", {
|
|
406
|
-
get: function () {
|
|
407
|
-
return this.config.bgColor;
|
|
408
|
-
},
|
|
409
|
-
set: function (value) {
|
|
410
|
-
if (value === this.config.bgColor) {
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
this.config.bgColor = value;
|
|
414
|
-
this.updateBg();
|
|
415
|
-
this.arrange();
|
|
416
|
-
},
|
|
417
|
-
enumerable: false,
|
|
418
|
-
configurable: true
|
|
419
|
-
});
|
|
420
|
-
FLabel.prototype.updateBg = function () {
|
|
421
|
-
var bgColor = this.config.bgColor ? this.config.bgColor : 0;
|
|
422
|
-
var bgAlpha = this.config.bgAlpha ? this.config.bgAlpha : 0;
|
|
249
|
+
}
|
|
250
|
+
get isBitmap() {
|
|
251
|
+
return this.config.isBitmap;
|
|
252
|
+
}
|
|
253
|
+
set isBitmap(value) {
|
|
254
|
+
if (value === this.config.isBitmap) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
this.config.isBitmap = value;
|
|
258
|
+
this.createField();
|
|
259
|
+
this.updateBg();
|
|
260
|
+
this.commitData();
|
|
261
|
+
}
|
|
262
|
+
get fontFamily() {
|
|
263
|
+
return this.config.fontFamily;
|
|
264
|
+
}
|
|
265
|
+
set fontFamily(value) {
|
|
266
|
+
if (value === this.config.fontFamily) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
this.config.fontFamily = value;
|
|
270
|
+
this.applyStyle();
|
|
271
|
+
}
|
|
272
|
+
get color() {
|
|
273
|
+
return this.config.color;
|
|
274
|
+
}
|
|
275
|
+
set color(value) {
|
|
276
|
+
if (value === this.config.color) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
this.config.color = value;
|
|
280
|
+
this.applyStyle();
|
|
281
|
+
}
|
|
282
|
+
get gradientColor() {
|
|
283
|
+
return this.config.gradientColor;
|
|
284
|
+
}
|
|
285
|
+
set gradientColor(value) {
|
|
286
|
+
this.config.gradientColor = value;
|
|
287
|
+
this.applyStyle();
|
|
288
|
+
}
|
|
289
|
+
get size() {
|
|
290
|
+
return this.config.size;
|
|
291
|
+
}
|
|
292
|
+
set size(value) {
|
|
293
|
+
if (value === this.config.size) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
this.config.size = value;
|
|
297
|
+
this.applyStyle();
|
|
298
|
+
}
|
|
299
|
+
/*public get width(): number {
|
|
300
|
+
return this._width;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
public set width(value: number) {
|
|
304
|
+
if (value === this._width) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
this._width = value;
|
|
309
|
+
|
|
310
|
+
this.commitData();
|
|
311
|
+
}*/
|
|
312
|
+
/*public get height(): number {
|
|
313
|
+
return this._height;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
public set height(value: number) {
|
|
317
|
+
if (value === this._height) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
this._height = value;
|
|
322
|
+
|
|
323
|
+
this.commitData();
|
|
324
|
+
}*/
|
|
325
|
+
get align() {
|
|
326
|
+
return this.config.align;
|
|
327
|
+
}
|
|
328
|
+
set align(value) {
|
|
329
|
+
if (value === this.config.align) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
this.config.align = value;
|
|
333
|
+
// this.arrange();
|
|
334
|
+
this.applyStyle();
|
|
335
|
+
}
|
|
336
|
+
get valign() {
|
|
337
|
+
return this.config.valign;
|
|
338
|
+
}
|
|
339
|
+
set valign(value) {
|
|
340
|
+
if (value === this.config.valign) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
this.config.valign = value;
|
|
344
|
+
this.arrange();
|
|
345
|
+
}
|
|
346
|
+
get bgAlpha() {
|
|
347
|
+
return this.config.bgAlpha;
|
|
348
|
+
}
|
|
349
|
+
set bgAlpha(value) {
|
|
350
|
+
if (value === this.config.bgAlpha) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
this.config.bgAlpha = value;
|
|
354
|
+
this.updateBg();
|
|
355
|
+
this.arrange();
|
|
356
|
+
}
|
|
357
|
+
get bgColor() {
|
|
358
|
+
return this.config.bgColor;
|
|
359
|
+
}
|
|
360
|
+
set bgColor(value) {
|
|
361
|
+
if (value === this.config.bgColor) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
this.config.bgColor = value;
|
|
365
|
+
this.updateBg();
|
|
366
|
+
this.arrange();
|
|
367
|
+
}
|
|
368
|
+
updateBg() {
|
|
369
|
+
const bgColor = this.config.bgColor ? this.config.bgColor : 0;
|
|
370
|
+
const bgAlpha = this.config.bgAlpha ? this.config.bgAlpha : 0;
|
|
423
371
|
this.bg.clear();
|
|
424
372
|
this.bg.beginFill(bgColor, 1);
|
|
425
373
|
this.bg.drawRect(0, 0, 10, 10);
|
|
@@ -429,267 +377,185 @@ var FLabel = /** @class */ (function (_super) {
|
|
|
429
377
|
this.fieldMask.beginFill(0x00FF00, 1);
|
|
430
378
|
this.fieldMask.drawRect(0, 0, 10, 10);
|
|
431
379
|
this.fieldMask.endFill();
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
return this.
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
});
|
|
614
|
-
Object.defineProperty(FLabel.prototype, "strokeThickness", {
|
|
615
|
-
get: function () {
|
|
616
|
-
return this.config.strokeThickness;
|
|
617
|
-
},
|
|
618
|
-
set: function (value) {
|
|
619
|
-
if (this.config.strokeThickness === value) {
|
|
620
|
-
return;
|
|
621
|
-
}
|
|
622
|
-
this.config.strokeThickness = value;
|
|
623
|
-
this.applyStyle();
|
|
624
|
-
},
|
|
625
|
-
enumerable: false,
|
|
626
|
-
configurable: true
|
|
627
|
-
});
|
|
628
|
-
Object.defineProperty(FLabel.prototype, "fieldPaddingX", {
|
|
629
|
-
get: function () {
|
|
630
|
-
return this.config.fieldPaddingX || 0;
|
|
631
|
-
},
|
|
632
|
-
set: function (value) {
|
|
633
|
-
if (this.config.fieldPaddingX === value) {
|
|
634
|
-
return;
|
|
635
|
-
}
|
|
636
|
-
this.config.fieldPaddingX = value;
|
|
637
|
-
this.arrange();
|
|
638
|
-
},
|
|
639
|
-
enumerable: false,
|
|
640
|
-
configurable: true
|
|
641
|
-
});
|
|
642
|
-
Object.defineProperty(FLabel.prototype, "fieldPaddingY", {
|
|
643
|
-
get: function () {
|
|
644
|
-
return this.config.fieldPaddingY || 0;
|
|
645
|
-
},
|
|
646
|
-
set: function (value) {
|
|
647
|
-
if (this.config.fieldPaddingY === value) {
|
|
648
|
-
return;
|
|
649
|
-
}
|
|
650
|
-
this.config.fieldPaddingY = value;
|
|
651
|
-
this.arrange();
|
|
652
|
-
},
|
|
653
|
-
enumerable: false,
|
|
654
|
-
configurable: true
|
|
655
|
-
});
|
|
656
|
-
Object.defineProperty(FLabel.prototype, "wordWrap", {
|
|
657
|
-
get: function () {
|
|
658
|
-
return this.config.wordWrap;
|
|
659
|
-
},
|
|
660
|
-
set: function (value) {
|
|
661
|
-
if (this.config.wordWrap === value) {
|
|
662
|
-
return;
|
|
663
|
-
}
|
|
664
|
-
this.config.wordWrap = value;
|
|
665
|
-
this.applyStyle();
|
|
666
|
-
},
|
|
667
|
-
enumerable: false,
|
|
668
|
-
configurable: true
|
|
669
|
-
});
|
|
670
|
-
Object.defineProperty(FLabel.prototype, "wordWrapWidth", {
|
|
671
|
-
get: function () {
|
|
672
|
-
return this.config.wordWrapWidth;
|
|
673
|
-
},
|
|
674
|
-
set: function (value) {
|
|
675
|
-
if (this.config.wordWrapWidth === value) {
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
this.config.wordWrapWidth = value;
|
|
679
|
-
this.applyStyle();
|
|
680
|
-
},
|
|
681
|
-
enumerable: false,
|
|
682
|
-
configurable: true
|
|
683
|
-
});
|
|
684
|
-
Object.defineProperty(FLabel.prototype, "engineField", {
|
|
685
|
-
get: function () {
|
|
686
|
-
return this.field;
|
|
687
|
-
},
|
|
688
|
-
enumerable: false,
|
|
689
|
-
configurable: true
|
|
690
|
-
});
|
|
691
|
-
FLabel.DEFAULT_CONFIG = new FLabelDefaultConfig();
|
|
692
|
-
return FLabel;
|
|
693
|
-
}(FContainer));
|
|
694
|
-
export { FLabel };
|
|
380
|
+
}
|
|
381
|
+
get text() {
|
|
382
|
+
return this.field.text;
|
|
383
|
+
}
|
|
384
|
+
set text(value) {
|
|
385
|
+
if (value === this.field.text) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
this.field.text = value;
|
|
389
|
+
this.dispatchEvent(new Event(FLabelEvent.TEXT_CHANGE));
|
|
390
|
+
this.commitData();
|
|
391
|
+
}
|
|
392
|
+
get autosize() {
|
|
393
|
+
return this.config.autosize;
|
|
394
|
+
}
|
|
395
|
+
set autosize(value) {
|
|
396
|
+
if (value === this.config.autosize) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
this.config.autosize = value;
|
|
400
|
+
this.arrange();
|
|
401
|
+
}
|
|
402
|
+
get autosizeType() {
|
|
403
|
+
return this.config.autosizeType;
|
|
404
|
+
}
|
|
405
|
+
set autosizeType(value) {
|
|
406
|
+
if (value === this.config.autosizeType) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
this.config.autosizeType = value;
|
|
410
|
+
this.arrange();
|
|
411
|
+
}
|
|
412
|
+
get maxAutosizeWidth() {
|
|
413
|
+
return this.config.maxAutosizeWidth || 0;
|
|
414
|
+
}
|
|
415
|
+
set maxAutosizeWidth(value) {
|
|
416
|
+
if (value === this.config.maxAutosizeWidth) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
this.config.maxAutosizeWidth = value;
|
|
420
|
+
this.arrange();
|
|
421
|
+
}
|
|
422
|
+
get maxAutosizeHeight() {
|
|
423
|
+
return this.config.maxAutosizeHeight || 0;
|
|
424
|
+
}
|
|
425
|
+
set maxAutosizeHeight(value) {
|
|
426
|
+
if (value === this.config.maxAutosizeHeight) {
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
this.config.maxAutosizeHeight = value;
|
|
430
|
+
this.arrange();
|
|
431
|
+
}
|
|
432
|
+
get fitToSize() {
|
|
433
|
+
return this.config.fitToSize;
|
|
434
|
+
}
|
|
435
|
+
set fitToSize(value) {
|
|
436
|
+
if (value === this.config.fitToSize) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
this.config.fitToSize = value;
|
|
440
|
+
this.arrange();
|
|
441
|
+
}
|
|
442
|
+
get changeFontSizeToFit() {
|
|
443
|
+
return this.config.changeFontSizeToFit;
|
|
444
|
+
}
|
|
445
|
+
set changeFontSizeToFit(value) {
|
|
446
|
+
if (value === this.config.changeFontSizeToFit) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
this.config.changeFontSizeToFit = value;
|
|
450
|
+
this.arrange();
|
|
451
|
+
}
|
|
452
|
+
get textWidth() {
|
|
453
|
+
if (this.isBitmap) {
|
|
454
|
+
// return (this.field as BitmapText).textWidth;
|
|
455
|
+
return this.fieldLocalBounds.x + this.fieldLocalBounds.width;
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
return this.field.width / this.field.scale.x;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
get textHeight() {
|
|
462
|
+
if (this.isBitmap) {
|
|
463
|
+
// return (this.field as BitmapText).textHeight;
|
|
464
|
+
return this.fieldLocalBounds.y + this.fieldLocalBounds.height;
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
return this.field.height / this.field.scale.y;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
get textAvailableWidth() {
|
|
471
|
+
return this.width - (this.fieldPaddingX * 2);
|
|
472
|
+
}
|
|
473
|
+
get textAvailableHeight() {
|
|
474
|
+
return this.height - (this.fieldPaddingY * 2);
|
|
475
|
+
}
|
|
476
|
+
get bold() {
|
|
477
|
+
return this.config.bold;
|
|
478
|
+
}
|
|
479
|
+
set bold(value) {
|
|
480
|
+
if (this.config.bold === value) {
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
this.config.bold = value;
|
|
484
|
+
this.applyStyle();
|
|
485
|
+
}
|
|
486
|
+
get dropShadow() {
|
|
487
|
+
return this.config.dropShadow;
|
|
488
|
+
}
|
|
489
|
+
set dropShadow(value) {
|
|
490
|
+
if (this.config.dropShadow === value) {
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
this.config.dropShadow = value;
|
|
494
|
+
this.applyStyle();
|
|
495
|
+
}
|
|
496
|
+
get stroke() {
|
|
497
|
+
return this.config.stroke;
|
|
498
|
+
}
|
|
499
|
+
set stroke(value) {
|
|
500
|
+
if (this.config.stroke === value) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
this.config.stroke = value;
|
|
504
|
+
this.applyStyle();
|
|
505
|
+
}
|
|
506
|
+
get strokeThickness() {
|
|
507
|
+
return this.config.strokeThickness;
|
|
508
|
+
}
|
|
509
|
+
set strokeThickness(value) {
|
|
510
|
+
if (this.config.strokeThickness === value) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
this.config.strokeThickness = value;
|
|
514
|
+
this.applyStyle();
|
|
515
|
+
}
|
|
516
|
+
get fieldPaddingX() {
|
|
517
|
+
return this.config.fieldPaddingX || 0;
|
|
518
|
+
}
|
|
519
|
+
set fieldPaddingX(value) {
|
|
520
|
+
if (this.config.fieldPaddingX === value) {
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
this.config.fieldPaddingX = value;
|
|
524
|
+
this.arrange();
|
|
525
|
+
}
|
|
526
|
+
get fieldPaddingY() {
|
|
527
|
+
return this.config.fieldPaddingY || 0;
|
|
528
|
+
}
|
|
529
|
+
set fieldPaddingY(value) {
|
|
530
|
+
if (this.config.fieldPaddingY === value) {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
this.config.fieldPaddingY = value;
|
|
534
|
+
this.arrange();
|
|
535
|
+
}
|
|
536
|
+
get wordWrap() {
|
|
537
|
+
return this.config.wordWrap;
|
|
538
|
+
}
|
|
539
|
+
set wordWrap(value) {
|
|
540
|
+
if (this.config.wordWrap === value) {
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
this.config.wordWrap = value;
|
|
544
|
+
this.applyStyle();
|
|
545
|
+
}
|
|
546
|
+
get wordWrapWidth() {
|
|
547
|
+
return this.config.wordWrapWidth;
|
|
548
|
+
}
|
|
549
|
+
set wordWrapWidth(value) {
|
|
550
|
+
if (this.config.wordWrapWidth === value) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
this.config.wordWrapWidth = value;
|
|
554
|
+
this.applyStyle();
|
|
555
|
+
}
|
|
556
|
+
get engineField() {
|
|
557
|
+
return this.field;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
FLabel.DEFAULT_CONFIG = new FLabelDefaultConfig();
|
|
695
561
|
//# sourceMappingURL=FLabel.js.map
|