@next2d/text 1.16.0 → 1.17.0

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.
@@ -1,637 +0,0 @@
1
- import { TextFormat } from "./TextFormat";
2
- import { InteractiveObject } from "@next2d/display";
3
- import { BoundsImpl, TextFieldTypeImpl, TextFormatVerticalAlignImpl, TextFieldAutoSizeImpl, ParentImpl, TextDataImpl, DictionaryTagImpl, TextCharacterImpl, PlayerHitObjectImpl, Character } from "@next2d/interface";
4
- import { CanvasToWebGLContext } from "@next2d/webgl";
5
- /**
6
- * TextField クラスは、テキストの表示と入力用の表示オブジェクトを作成するために使用されます。
7
- * プロパティインスペクターを使用して、テキストフィールドにインスタンス名を付けることができます。
8
- * また、TextField クラスのメソッドとプロパティを使用して、JavaScript でテキストフィールドを操作できます。
9
- *
10
- * The TextField class is used to create display objects for text display and input.
11
- * You can give a text field an instance name in the Property inspector
12
- * and use the methods and properties of the TextField class to manipulate it with JavaScript.
13
- *
14
- * @class
15
- * @memberOf next2d.text
16
- * @extends InteractiveObject
17
- */
18
- export declare class TextField extends InteractiveObject {
19
- private readonly _$bounds;
20
- private readonly _$originBounds;
21
- private readonly _$textData;
22
- private readonly _$widthTable;
23
- private readonly _$heightTable;
24
- private readonly _$textFormatTable;
25
- private readonly _$objectTable;
26
- private readonly _$imageData;
27
- private readonly _$textHeightTable;
28
- private readonly _$heightCache;
29
- private _$background;
30
- private _$backgroundColor;
31
- private _$border;
32
- private _$borderColor;
33
- private _$htmlText;
34
- private _$multiline;
35
- private _$text;
36
- private _$wordWrap;
37
- private _$scrollH;
38
- private _$scrollV;
39
- private _$maxScrollV;
40
- private _$maxScrollH;
41
- private _$maxChars;
42
- private _$defaultTextFormat;
43
- private _$rawHtmlText;
44
- private _$restrict;
45
- private _$isHTML;
46
- private _$textHeight;
47
- private _$textWidth;
48
- private _$textarea;
49
- private _$autoSize;
50
- private _$autoFontSize;
51
- private _$textAreaActive;
52
- private _$totalWidth;
53
- private _$scrollEnabled;
54
- private _$scrollSprite;
55
- private _$type;
56
- private _$focus;
57
- private _$isComposing;
58
- private _$thickness;
59
- private _$thicknessColor;
60
- private _$verticalAlign;
61
- private _$createdTextData;
62
- private _$cacheKeys;
63
- private _$cacheParams;
64
- /**
65
- * @constructor
66
- * @public
67
- */
68
- constructor();
69
- /**
70
- * @description 指定されたクラスのストリングを返します。
71
- * Returns the string representation of the specified class.
72
- *
73
- * @return {string}
74
- * @default [class TextField]
75
- * @method
76
- * @static
77
- */
78
- static toString(): string;
79
- /**
80
- * @description 指定されたクラスの空間名を返します。
81
- * Returns the space name of the specified class.
82
- *
83
- * @return {string}
84
- * @default next2d.text.TextField
85
- * @const
86
- * @static
87
- */
88
- static get namespace(): string;
89
- /**
90
- * @description 指定されたオブジェクトのストリングを返します。
91
- * Returns the string representation of the specified object.
92
- *
93
- * @return {string}
94
- * @default [object TextField]
95
- * @method
96
- * @public
97
- */
98
- toString(): string;
99
- /**
100
- * @description 指定されたオブジェクトの空間名を返します。
101
- * Returns the space name of the specified object.
102
- *
103
- * @return {string}
104
- * @default next2d.text.TextField
105
- * @const
106
- * @public
107
- */
108
- get namespace(): string;
109
- /**
110
- * @description テキストサイズの自動的な拡大 / 縮小および整列を制御します。
111
- * Controls automatic sizing and alignment of text size.
112
- *
113
- * @member {boolean}
114
- * @default false
115
- * @public
116
- */
117
- get autoFontSize(): boolean;
118
- set autoFontSize(auto_font_size: boolean);
119
- /**
120
- * @description テキストフィールドの自動的な拡大 / 縮小および整列を制御します。
121
- * Controls automatic sizing and alignment of text fields.
122
- *
123
- * @member {string}
124
- * @default TextFieldAutoSize.NONE
125
- * @public
126
- */
127
- get autoSize(): TextFieldAutoSizeImpl;
128
- set autoSize(auto_size: TextFieldAutoSizeImpl);
129
- /**
130
- * @description テキストフィールドに背景の塗りつぶしがあるかどうかを指定します。
131
- * Specifies whether the text field has a background fill.
132
- *
133
- * @member {boolean}
134
- * @default false
135
- * @public
136
- */
137
- get background(): boolean;
138
- set background(background: boolean);
139
- /**
140
- * @description テキストフィールドの背景の色です。
141
- * The color of the text field background.
142
- *
143
- * @member {number}
144
- * @default 0xffffff
145
- * @public
146
- */
147
- get backgroundColor(): number;
148
- set backgroundColor(background_color: string | number);
149
- /**
150
- * @description テキストフィールドに境界線があるかどうかを指定します。
151
- * Specifies whether the text field has a border.
152
- *
153
- * @member {boolean}
154
- * @default false
155
- * @public
156
- */
157
- get border(): boolean;
158
- set border(border: boolean);
159
- /**
160
- * @description テキストフィールドの境界線の色です。
161
- * The color of the text field border.
162
- *
163
- * @member {number}
164
- * @default 0x000000
165
- * @public
166
- */
167
- get borderColor(): number;
168
- set borderColor(border_color: string | number);
169
- /**
170
- * @description テキストに適用するフォーマットを指定します。
171
- * Specifies the formatting to be applied to the text.
172
- *
173
- * @member {TextFormat}
174
- * @public
175
- */
176
- get defaultTextFormat(): TextFormat;
177
- set defaultTextFormat(text_format: TextFormat);
178
- /**
179
- * @description このオブジェクトでマウスまたはその他のユーザー入力メッセージを
180
- *
181
- * @member {boolean}
182
- * @default false
183
- * @public
184
- */
185
- get focus(): boolean;
186
- set focus(focus: boolean);
187
- /**
188
- * @description テキストフィールドの内容を HTML で表します。
189
- * Contains the HTML representation of the text field contents.
190
- *
191
- * @member {string}
192
- * @default ""
193
- * @public
194
- */
195
- get htmlText(): string;
196
- set htmlText(html_text: string);
197
- /**
198
- * @description テキストフィールド内の文字数です。
199
- * The int of characters in a text field.
200
- *
201
- * @member {number}
202
- * @readonly
203
- * @public
204
- */
205
- get length(): number;
206
- /**
207
- * @description ユーザーが入力するときに、テキストフィールドに入力できる最大の文字数です。
208
- * The maximum number of characters that the text field can contain,
209
- * as entered by a user.
210
- *
211
- * @member {number}
212
- * @default 0
213
- * @public
214
- */
215
- get maxChars(): number;
216
- set maxChars(max_chars: number);
217
- /**
218
- * TODO
219
- * @description scrollH の最大値です。
220
- * The maximum value of scrollH.
221
- *
222
- * @member {number}
223
- * @readonly
224
- * @public
225
- */
226
- get maxScrollH(): number;
227
- /**
228
- * @description scrollV の最大値です。
229
- * The maximum value of scrollV.
230
- *
231
- * @member {number}
232
- * @readonly
233
- * @public
234
- */
235
- get maxScrollV(): number;
236
- /**
237
- * @description フィールドが複数行テキストフィールドであるかどうかを示します。
238
- * Indicates whether field is a multiline text field.
239
- *
240
- * @member {boolean}
241
- * @default false
242
- * @public
243
- */
244
- get multiline(): boolean;
245
- set multiline(multiline: boolean);
246
- /**
247
- * @description フィールドが複数行テキストフィールドであるかどうかを示します。
248
- * Indicates whether field is a multiline text field.
249
- *
250
- * @member {number}
251
- * @readonly
252
- * @public
253
- */
254
- get numLines(): number;
255
- /**
256
- * @description ユーザーがテキストフィールドに入力できる文字のセットを指定します。
257
- * Indicates the set of characters that a user can enter into the text field.
258
- *
259
- * @member {string}
260
- * @default null
261
- * @public
262
- */
263
- get restrict(): string;
264
- set restrict(restrict: string);
265
- /**
266
- * @description スクロール機能のON/OFFの制御。
267
- * Control ON/OFF of the scroll function.
268
- *
269
- * @member {boolean}
270
- * @default true
271
- * @public
272
- */
273
- get scrollEnabled(): boolean;
274
- set scrollEnabled(scroll_enabled: boolean);
275
- /**
276
- * TODO
277
- * @description 現在の水平スクロール位置です。
278
- * The current horizontal scrolling position.
279
- *
280
- * @member {number}
281
- * @public
282
- */
283
- get scrollH(): number;
284
- set scrollH(scroll_h: number);
285
- /**
286
- * @description テキストフィールドのテキストの垂直位置です。
287
- * The vertical position of text in a text field.
288
- *
289
- * @member {number}
290
- * @public
291
- */
292
- get scrollV(): number;
293
- set scrollV(scroll_v: number);
294
- /**
295
- * @description テキストフィールド内の現在のテキストであるストリングです。
296
- * A string that is the current text in the text field.
297
- *
298
- * @member {string}
299
- * @default ""
300
- * @public
301
- */
302
- get text(): string;
303
- set text(text: string | null);
304
- /**
305
- * @description テキストフィールドのテキストの色です(16 進数形式)。
306
- * The color of the text in a text field, in hexadecimal format.
307
- *
308
- * @member {number}
309
- * @public
310
- */
311
- get textColor(): number;
312
- set textColor(text_color: number);
313
- /**
314
- * @description テキストの高さです(ピクセル単位)。
315
- * The height of the text in pixels.
316
- *
317
- * @member {number}
318
- * @readonly
319
- * @public
320
- */
321
- get textHeight(): number;
322
- /**
323
- * @description テキストの幅です(ピクセル単位)。
324
- * The width of the text in pixels.
325
- *
326
- * @member {number}
327
- * @readonly
328
- * @public
329
- */
330
- get textWidth(): number;
331
- /**
332
- * @description 輪郭のテキスト幅です。0(デフォルト値)で無効にできます。
333
- * The text width of the outline, which can be disabled with 0 (the default value).
334
- *
335
- * @member {number}
336
- * @default 0
337
- * @public
338
- */
339
- get thickness(): number;
340
- set thickness(thickness: number);
341
- /**
342
- * @description 輪郭のテキストの色です(16 進数形式)。
343
- * The color of the outline text. (Hexadecimal format)
344
- *
345
- * @member {number}
346
- * @default 0
347
- * @public
348
- */
349
- get thicknessColor(): number;
350
- set thicknessColor(thickness_color: number);
351
- /**
352
- * @description テキストフィールドのタイプです。
353
- * The type of the text field.
354
- *
355
- * @member {string}
356
- * @default TextFieldType.STATIC
357
- * @public
358
- */
359
- get type(): TextFieldTypeImpl;
360
- set type(type: TextFieldTypeImpl);
361
- /**
362
- * @description 縦方向の揃え位置を指定するプロパティです。
363
- * This property specifies the vertical alignment position.
364
- *
365
- * @member {string}
366
- * @default TextFormatVerticalAlign.TOP
367
- * @public
368
- */
369
- get verticalAlign(): TextFormatVerticalAlignImpl;
370
- set verticalAlign(vertical_align: TextFormatVerticalAlignImpl);
371
- /**
372
- * @description テキストフィールドのテキストを折り返すかどうかを示すブール値です。
373
- * A Boolean value that indicates whether the text field has word wrap.
374
- *
375
- * @member {boolean}
376
- * @default false
377
- * @public
378
- */
379
- get wordWrap(): boolean;
380
- set wordWrap(word_wrap: boolean);
381
- /**
382
- * @description 表示オブジェクトの幅を示します(ピクセル単位)。
383
- * Indicates the width of the display object, in pixels.
384
- *
385
- * @member {number}
386
- * @public
387
- */
388
- get width(): number;
389
- set width(width: number);
390
- /**
391
- * @description 表示オブジェクトの高さを示します(ピクセル単位)。
392
- * Indicates the height of the display object, in pixels.
393
- *
394
- * @member {number}
395
- * @public
396
- */
397
- get height(): number;
398
- set height(height: number);
399
- /**
400
- * @description 親 DisplayObjectContainer のローカル座標を基準にした
401
- * DisplayObject インスタンスの x 座標を示します。
402
- * Indicates the x coordinate
403
- * of the DisplayObject instance relative to the local coordinates
404
- * of the parent DisplayObjectContainer.
405
- *
406
- * @member {number}
407
- * @public
408
- */
409
- get x(): number;
410
- set x(x: number);
411
- /**
412
- * @description 親 DisplayObjectContainer のローカル座標を基準にした
413
- * DisplayObject インスタンスの y 座標を示します。
414
- * Indicates the y coordinate
415
- * of the DisplayObject instance relative to the local coordinates
416
- * of the parent DisplayObjectContainer.
417
- *
418
- * @member {number}
419
- * @public
420
- */
421
- get y(): number;
422
- set y(y: number);
423
- /**
424
- * @description newText パラメーターで指定されたストリングを、
425
- * テキストフィールドのテキストの最後に付加します。
426
- * Appends the string specified by the newText parameter
427
- * to the end of the text of the text field.
428
- *
429
- * @param {string} new_text
430
- * @return void
431
- * @method
432
- * @public
433
- */
434
- appendText(new_text: string): void;
435
- /**
436
- * @description beginIndex パラメーターと endIndex パラメーターで指定された範囲の
437
- * テキストのフォーマット情報を含む TextFormat オブジェクトを返します。
438
- * Returns a TextFormat object that contains formatting information
439
- * for the range of text that the beginIndex and endIndex parameters specify.
440
- *
441
- * @param {int} [begin_index=-1]
442
- * @param {int} [end_index=-1]
443
- * @return {TextFormat}
444
- * @method
445
- * @public
446
- */
447
- getTextFormat(begin_index?: number, end_index?: number): TextFormat;
448
- /**
449
- * @description lineIndex パラメーターで指定された行のテキストを返します。
450
- * Returns the text of the line specified by the lineIndex parameter.
451
- *
452
- * @param {number} line_index
453
- * @return {string}
454
- * @public
455
- */
456
- getLineText(line_index: number): string;
457
- /**
458
- * @description beginIndex パラメーターと endIndex パラメーターで指定された文字範囲を、
459
- * newText パラメーターの内容に置き換えます。
460
- * Replaces the range of characters that the beginIndex
461
- * and endIndex parameters specify with the contents of the newText parameter.
462
- *
463
- * @param {number} begin_index
464
- * @param {number} end_index
465
- * @param {string} new_text
466
- * @return {void}
467
- * @method
468
- * @public
469
- */
470
- replaceText(begin_index: number, end_index: number, new_text: string): void;
471
- /**
472
- * @description format パラメーターで指定したテキストフォーマットを、
473
- * テキストフィールド内の指定されたテキストに適用します。
474
- * Applies the text formatting that the format parameter specifies
475
- * to the specified text in a text field.
476
- *
477
- * @param {TextFormat} text_format
478
- * @param {number} [begin_index=-1]
479
- * @param {number} [end_index=-1]
480
- * @return {void}
481
- * @method
482
- * @public
483
- */
484
- setTextFormat(text_format: TextFormat, begin_index?: number, end_index?: number): void;
485
- /**
486
- * @return {array}
487
- * @method
488
- * @private
489
- */
490
- _$getTextData(): TextDataImpl<any>[];
491
- /**
492
- * @param {Element} tag
493
- * @param {TextFormat} text_format
494
- * @param {number} tf_copy_offset
495
- * @return {void}
496
- * @private
497
- */
498
- _$parseTag(tag: HTMLElement, text_format: TextFormat, tf_copy_offset: number): void;
499
- /**
500
- * @param {string} text
501
- * @param {TextFormat} text_format
502
- * @param {number} tf_copy_offset
503
- * @returns {number}
504
- * @method
505
- * @private
506
- */
507
- _$parseText(text: string, text_format: TextFormat, tf_copy_offset: number): number;
508
- /**
509
- * @param {TextFormat} text_format
510
- * @return {number}
511
- * @private
512
- */
513
- _$getTextHeight(text_format: TextFormat): number;
514
- /**
515
- * @return {number}
516
- * @private
517
- */
518
- _$getImageOffsetX(): number;
519
- /**
520
- * @return {void}
521
- * @method
522
- * @private
523
- */
524
- _$reset(): void;
525
- /**
526
- * @return {void}
527
- * @method
528
- * @private
529
- */
530
- _$reload(): void;
531
- /**
532
- * @return {void}
533
- * @method
534
- * @private
535
- */
536
- _$resize(): void;
537
- /**
538
- * @param {object} obj
539
- * @param {number} width
540
- * @return {number}
541
- * @private
542
- */
543
- _$getAlignOffset(obj: TextDataImpl<any>, width: number): number;
544
- /**
545
- * @param {Float32Array} [matrix=null]
546
- * @returns {object}
547
- * @method
548
- * @private
549
- */
550
- _$getBounds(matrix?: Float32Array | null): BoundsImpl;
551
- /**
552
- * @param {object} character
553
- * @return {void}
554
- * @method
555
- * @private
556
- */
557
- _$buildCharacter(character: Character<TextCharacterImpl>): void;
558
- /**
559
- * @param {object} character
560
- * @return {void}
561
- * @method
562
- * @private
563
- */
564
- _$sync(character: TextCharacterImpl): void;
565
- /**
566
- * @param {object} tag
567
- * @param {DisplayObjectContainer} parent
568
- * @return {object}
569
- * @method
570
- * @private
571
- */
572
- _$build(tag: DictionaryTagImpl, parent: ParentImpl<any>): TextCharacterImpl;
573
- /**
574
- * @param {CanvasToWebGLContext} context
575
- * @param {Float32Array} matrix
576
- * @returns {void}
577
- * @method
578
- * @private
579
- */
580
- _$clip(context: CanvasToWebGLContext, matrix: Float32Array): void;
581
- /**
582
- * @param {CanvasToWebGLContext} context
583
- * @param {Float32Array} matrix
584
- * @param {Float32Array} color_transform
585
- * @return {void}
586
- * @method
587
- * @private
588
- */
589
- _$draw(context: CanvasToWebGLContext, matrix: Float32Array, color_transform: Float32Array): void;
590
- /**
591
- * @param {CanvasRenderingContext2D} context
592
- * @param {Float32Array} matrix
593
- * @param {Float32Array} color_transform
594
- * @param {number} width
595
- * @return {void}
596
- * @method
597
- * @private
598
- */
599
- _$doDraw(context: CanvasRenderingContext2D, matrix: Float32Array, color_transform: Float32Array, width: number): void;
600
- /**
601
- * @param {CanvasRenderingContext2D} context
602
- * @param {Float32Array} matrix
603
- * @param {object} options
604
- * @return {boolean}
605
- * @method
606
- * @private
607
- */
608
- _$mouseHit(context: CanvasRenderingContext2D, matrix: Float32Array, options: PlayerHitObjectImpl): boolean;
609
- /**
610
- * @param {CanvasRenderingContext2D} context
611
- * @param {Float32Array} matrix
612
- * @param {object} options
613
- * @return {boolean}
614
- * @method
615
- * @private
616
- */
617
- _$hit(context: CanvasRenderingContext2D, matrix: Float32Array, options: PlayerHitObjectImpl): boolean;
618
- /**
619
- * @param {number} scale
620
- * @return {void}
621
- * @method
622
- * @private
623
- */
624
- _$createTextAreaElement(scale: number): void;
625
- /**
626
- * @return {void}
627
- * @method
628
- * @private
629
- */
630
- _$createWorkerInstance(): void;
631
- /**
632
- * @return {void}
633
- * @method
634
- * @private
635
- */
636
- _$postProperty(): void;
637
- }