@next2d/display 1.16.0 → 1.17.1

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