@next2d/display 1.14.20

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,49 @@
1
+ import type { BitmapData } from "./BitmapData";
2
+ import { Matrix } from "@next2d/geom";
3
+ /**
4
+ * ビットマップ塗りを定義します。ビットマップは、スムージング、繰り返し、
5
+ * またはタイリング表示して領域を塗りつぶしたり、変換マトリックスを使用して操作できます。
6
+ *
7
+ * Defines a bitmap fill. The bitmap can be smoothed,
8
+ * repeated or tiled to fill the area; or manipulated using a transformation matrix.
9
+ *
10
+ * @class
11
+ * @memberOf next2d.display
12
+ * @private
13
+ */
14
+ export declare class GraphicsBitmapFill {
15
+ private readonly _$bitmapData;
16
+ private readonly _$matrix;
17
+ private readonly _$repeat;
18
+ private readonly _$smooth;
19
+ /**
20
+ * @param {BitmapData} bitmap_data
21
+ * @param {Matrix} [matrix=null]
22
+ * @param {boolean} [repeat=true]
23
+ * @param {boolean} [smooth=false]
24
+ *
25
+ * @constructor
26
+ * @private
27
+ */
28
+ constructor(bitmap_data: BitmapData, matrix?: Matrix | null, repeat?: boolean, smooth?: boolean);
29
+ /**
30
+ * @description 新しいオブジェクトとして、このクラスのクローンを返します。
31
+ * 含まれるオブジェクトはまったく同じコピーになります。
32
+ * Returns a clone of this class as a new object,
33
+ * with an exact copy of the contained object.
34
+ *
35
+ * @return {GraphicsBitmapFill}
36
+ * @method
37
+ * @public
38
+ */
39
+ clone(): GraphicsBitmapFill;
40
+ /**
41
+ * @description このクラスのもつパラメーターをArrayで返却する
42
+ * Return the parameters of this class as an Array.
43
+ *
44
+ * @return {array}
45
+ * @method
46
+ * @public
47
+ */
48
+ toArray(): any[];
49
+ }
@@ -0,0 +1,86 @@
1
+ import { $getArray } from "@next2d/share";
2
+ /**
3
+ * ビットマップ塗りを定義します。ビットマップは、スムージング、繰り返し、
4
+ * またはタイリング表示して領域を塗りつぶしたり、変換マトリックスを使用して操作できます。
5
+ *
6
+ * Defines a bitmap fill. The bitmap can be smoothed,
7
+ * repeated or tiled to fill the area; or manipulated using a transformation matrix.
8
+ *
9
+ * @class
10
+ * @memberOf next2d.display
11
+ * @private
12
+ */
13
+ export class GraphicsBitmapFill {
14
+ /**
15
+ * @param {BitmapData} bitmap_data
16
+ * @param {Matrix} [matrix=null]
17
+ * @param {boolean} [repeat=true]
18
+ * @param {boolean} [smooth=false]
19
+ *
20
+ * @constructor
21
+ * @private
22
+ */
23
+ constructor(bitmap_data, matrix = null, repeat = true, smooth = false) {
24
+ /**
25
+ * @description 透明または不透明なビットマップイメージです。
26
+ * A transparent or opaque bitmap image.
27
+ *
28
+ * @type {BitmapData}
29
+ * @private
30
+ */
31
+ this._$bitmapData = bitmap_data;
32
+ /**
33
+ * @description ビットマップ上の変形を定義する、
34
+ * (next2d.geom.Matrix クラスの)マトリックスオブジェクトです。
35
+ * A matrix object (of the next2d.geom.Matrix class)
36
+ * that defines transformations on the bitmap.
37
+ *
38
+ * @type {Matrix}
39
+ * @default null
40
+ * @private
41
+ */
42
+ this._$matrix = matrix;
43
+ /**
44
+ * @description ビットマップイメージを一定のパターンでタイル状に表示するかどうかを指定します。
45
+ * Specifies whether to repeat the bitmap image in a tiled pattern.
46
+ *
47
+ * @type {boolean}
48
+ * @default true
49
+ * @private
50
+ */
51
+ this._$repeat = repeat;
52
+ /**
53
+ * @description ビットマップイメージにスムージングアルゴリズムを適用するかどうかを指定します。
54
+ * Specifies whether to apply a smoothing algorithm to the bitmap image.
55
+ *
56
+ * @type {boolean}
57
+ * @default false
58
+ * @private
59
+ */
60
+ this._$smooth = smooth;
61
+ }
62
+ /**
63
+ * @description 新しいオブジェクトとして、このクラスのクローンを返します。
64
+ * 含まれるオブジェクトはまったく同じコピーになります。
65
+ * Returns a clone of this class as a new object,
66
+ * with an exact copy of the contained object.
67
+ *
68
+ * @return {GraphicsBitmapFill}
69
+ * @method
70
+ * @public
71
+ */
72
+ clone() {
73
+ return new GraphicsBitmapFill(this._$bitmapData.clone(), this._$matrix ? this._$matrix.clone() : null, this._$repeat, this._$smooth);
74
+ }
75
+ /**
76
+ * @description このクラスのもつパラメーターをArrayで返却する
77
+ * Return the parameters of this class as an Array.
78
+ *
79
+ * @return {array}
80
+ * @method
81
+ * @public
82
+ */
83
+ toArray() {
84
+ return $getArray(this._$bitmapData, this._$matrix, this._$repeat, this._$smooth);
85
+ }
86
+ }
@@ -0,0 +1,65 @@
1
+ import type { Matrix } from "@next2d/geom";
2
+ import { ColorStopImpl, GradientTypeImpl, SpreadMethodImpl, InterpolationMethodImpl } from "@next2d/interface";
3
+ /**
4
+ * グラデーション塗りを定義します。
5
+ * Defines a gradient fill.
6
+ *
7
+ * @class
8
+ * @memberOf next2d.display
9
+ * @private
10
+ */
11
+ export declare class GraphicsGradientFill {
12
+ private readonly _$type;
13
+ private readonly _$colors;
14
+ private readonly _$alphas;
15
+ private readonly _$ratios;
16
+ private readonly _$matrix;
17
+ private readonly _$spreadMethod;
18
+ private readonly _$interpolationMethod;
19
+ private readonly _$focalPointRatio;
20
+ private readonly _$colorStops;
21
+ /**
22
+ * @param {string} [type=GradientType.LINEAR]
23
+ * @param {array} [colors=null]
24
+ * @param {array} [alphas=null]
25
+ * @param {array} [ratios=null]
26
+ * @param {Matrix} [matrix=null]
27
+ * @param {string} [spread_method=SpreadMethod.PAD]
28
+ * @param {string} [interpolation_method=InterpolationMethod.RGB]
29
+ * @param {number} [focal_point_ratio=0]
30
+ *
31
+ * @constructor
32
+ * @private
33
+ */
34
+ constructor(type: GradientTypeImpl, colors: number[] | string[], alphas: number[], ratios: number[], matrix?: Matrix | null, spread_method?: SpreadMethodImpl, interpolation_method?: InterpolationMethodImpl, focal_point_ratio?: number);
35
+ /**
36
+ * @description 分配された色の情報を統合して配列で返却
37
+ * Integrate the distributed color information and return it in an array.
38
+ *
39
+ * @member {array}
40
+ * @default null
41
+ * @readonly
42
+ * @public
43
+ */
44
+ get colorStops(): ColorStopImpl[];
45
+ /**
46
+ * @description このクラスのもつパラメーターをArrayで返却する
47
+ * Return the parameters of this class as an Array.
48
+ *
49
+ * @return {array}
50
+ * @method
51
+ * @public
52
+ */
53
+ toArray(): any[];
54
+ /**
55
+ * @description 新しい GraphicsGradientFill オブジェクトとして、クローンを返します。
56
+ * 含まれるオブジェクトはまったく同じコピーになります。
57
+ * Returns a clone as a new GraphicsGradientFill object.
58
+ * The contained object will be an exact copy.
59
+ *
60
+ * @return {GraphicsGradientFill}
61
+ * @method
62
+ * @public
63
+ */
64
+ clone(): GraphicsGradientFill;
65
+ }
@@ -0,0 +1,157 @@
1
+ import { $colorStringToInt, $getArray, $intToRGBA, $Math, $MATRIX_ARRAY_IDENTITY } from "@next2d/share";
2
+ /**
3
+ * グラデーション塗りを定義します。
4
+ * Defines a gradient fill.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.display
8
+ * @private
9
+ */
10
+ export class GraphicsGradientFill {
11
+ /**
12
+ * @param {string} [type=GradientType.LINEAR]
13
+ * @param {array} [colors=null]
14
+ * @param {array} [alphas=null]
15
+ * @param {array} [ratios=null]
16
+ * @param {Matrix} [matrix=null]
17
+ * @param {string} [spread_method=SpreadMethod.PAD]
18
+ * @param {string} [interpolation_method=InterpolationMethod.RGB]
19
+ * @param {number} [focal_point_ratio=0]
20
+ *
21
+ * @constructor
22
+ * @private
23
+ */
24
+ constructor(type, colors, alphas, ratios, matrix = null, spread_method = "pad", interpolation_method = "rgb", focal_point_ratio = 0) {
25
+ /**
26
+ * @description 使用するグラデーションのタイプを指定する GradientType クラスの値です。
27
+ * A value from the GradientType class that specifies which gradient type to use.
28
+ *
29
+ * @type {string}
30
+ * @default GradientType.LINEAR
31
+ * @private
32
+ */
33
+ this._$type = type;
34
+ /**
35
+ * @description グラデーションで使用する RGB 16 進数カラー値の配列です。
36
+ * An array of RGB hexadecimal color values to use in the gradient.
37
+ *
38
+ * @type {array}
39
+ * @private
40
+ */
41
+ this._$colors = colors;
42
+ /**
43
+ * @description colors 配列内の各色に対応するアルファ値の配列です。
44
+ * An array of alpha values for the corresponding colors in the colors array.
45
+ *
46
+ * @type {array}
47
+ * @private
48
+ */
49
+ this._$alphas = alphas;
50
+ /**
51
+ * @description 色分布の比率の配列です。
52
+ * An array of color distribution ratios.
53
+ *
54
+ * @type {array}
55
+ * @private
56
+ */
57
+ this._$ratios = ratios;
58
+ /**
59
+ * @description Matrix クラスで定義される変換マトリックスです。
60
+ * A transformation matrix as defined by the Matrix class.
61
+ *
62
+ * @type {Matrix}
63
+ * @default null
64
+ * @private
65
+ */
66
+ this._$matrix = matrix;
67
+ /**
68
+ * @description 使用する spread メソッドを指定する SpreadMethod クラスの値です。
69
+ * A value from the SpreadMethod class that specifies which spread method to use.
70
+ *
71
+ * @type {string}
72
+ * @default SpreadMethod.PAD
73
+ * @private
74
+ */
75
+ this._$spreadMethod = spread_method;
76
+ /**
77
+ * @description 使用する値を指定する InterpolationMethod クラスの値です。
78
+ * A value from the InterpolationMethod class that specifies which value to use.
79
+ *
80
+ * @type {string}
81
+ * @default InterpolationMethod.RGB
82
+ * @private
83
+ */
84
+ this._$interpolationMethod = interpolation_method;
85
+ /**
86
+ * @description グラデーションの焦点の位置を制御する数値です。
87
+ * A number that controls the location
88
+ * of the focal point of the gradient.
89
+ *
90
+ * @type {number}
91
+ * @default null
92
+ * @private
93
+ */
94
+ this._$focalPointRatio = focal_point_ratio;
95
+ /**
96
+ * @type {array}
97
+ * @default null
98
+ * @private
99
+ */
100
+ this._$colorStops = $getArray();
101
+ }
102
+ /**
103
+ * @description 分配された色の情報を統合して配列で返却
104
+ * Integrate the distributed color information and return it in an array.
105
+ *
106
+ * @member {array}
107
+ * @default null
108
+ * @readonly
109
+ * @public
110
+ */
111
+ get colorStops() {
112
+ if (!this._$colorStops.length) {
113
+ const length = $Math.min($Math.min(this._$alphas.length, this._$colors.length), this._$ratios.length);
114
+ for (let idx = 0; idx < length; ++idx) {
115
+ const value = this._$colors[idx];
116
+ const color = typeof value === "string"
117
+ ? $colorStringToInt(value)
118
+ : value;
119
+ const object = $intToRGBA(color, this._$alphas[idx]);
120
+ this._$colorStops[idx] = {
121
+ "ratio": this._$ratios[idx] / 255,
122
+ "R": object.R,
123
+ "G": object.G,
124
+ "B": object.B,
125
+ "A": object.A
126
+ };
127
+ }
128
+ }
129
+ return this._$colorStops;
130
+ }
131
+ /**
132
+ * @description このクラスのもつパラメーターをArrayで返却する
133
+ * Return the parameters of this class as an Array.
134
+ *
135
+ * @return {array}
136
+ * @method
137
+ * @public
138
+ */
139
+ toArray() {
140
+ return $getArray(this._$type, this.colorStops, this._$matrix
141
+ ? this._$matrix._$matrix
142
+ : $MATRIX_ARRAY_IDENTITY, this._$spreadMethod, this._$interpolationMethod, this._$focalPointRatio);
143
+ }
144
+ /**
145
+ * @description 新しい GraphicsGradientFill オブジェクトとして、クローンを返します。
146
+ * 含まれるオブジェクトはまったく同じコピーになります。
147
+ * Returns a clone as a new GraphicsGradientFill object.
148
+ * The contained object will be an exact copy.
149
+ *
150
+ * @return {GraphicsGradientFill}
151
+ * @method
152
+ * @public
153
+ */
154
+ clone() {
155
+ return new GraphicsGradientFill(this._$type, this._$colors.slice(), this._$alphas.slice(), this._$ratios.slice(), this._$matrix ? this._$matrix.clone() : null, this._$spreadMethod, this._$interpolationMethod, this._$focalPointRatio);
156
+ }
157
+ }
@@ -0,0 +1,32 @@
1
+ import { DisplayObject } from "./DisplayObject";
2
+ /**
3
+ * InteractiveObject クラスは、マウス、キーボードまたは他のユーザー入力デバイスを使用して
4
+ * ユーザーが操作できるすべての表示オブジェクトの抽象基本クラスです。
5
+ *
6
+ * The InteractiveObject class is the abstract base class for all display objects
7
+ * with which the user can interact, using the mouse, keyboard, or other user input device.
8
+ *
9
+ * @class
10
+ * @memberOf next2d.display
11
+ * @extends DisplayObject
12
+ */
13
+ export declare class InteractiveObject extends DisplayObject {
14
+ protected _$mouseEnabled: boolean;
15
+ /**
16
+ * @constructor
17
+ * @public
18
+ */
19
+ constructor();
20
+ /**
21
+ * @description このオブジェクトでマウスまたはその他のユーザー入力メッセージを
22
+ * 受け取るかどうかを指定します。
23
+ * Specifies whether this object receives mouse,
24
+ * or other user input, messages.
25
+ *
26
+ * @member {boolean}
27
+ * @default true
28
+ * @public
29
+ */
30
+ get mouseEnabled(): boolean;
31
+ set mouseEnabled(mouse_enabled: boolean);
32
+ }
@@ -0,0 +1,43 @@
1
+ import { DisplayObject } from "./DisplayObject";
2
+ /**
3
+ * InteractiveObject クラスは、マウス、キーボードまたは他のユーザー入力デバイスを使用して
4
+ * ユーザーが操作できるすべての表示オブジェクトの抽象基本クラスです。
5
+ *
6
+ * The InteractiveObject class is the abstract base class for all display objects
7
+ * with which the user can interact, using the mouse, keyboard, or other user input device.
8
+ *
9
+ * @class
10
+ * @memberOf next2d.display
11
+ * @extends DisplayObject
12
+ */
13
+ export class InteractiveObject extends DisplayObject {
14
+ /**
15
+ * @constructor
16
+ * @public
17
+ */
18
+ constructor() {
19
+ super();
20
+ /**
21
+ * @type {boolean}
22
+ * @default true
23
+ * @private
24
+ */
25
+ this._$mouseEnabled = true;
26
+ }
27
+ /**
28
+ * @description このオブジェクトでマウスまたはその他のユーザー入力メッセージを
29
+ * 受け取るかどうかを指定します。
30
+ * Specifies whether this object receives mouse,
31
+ * or other user input, messages.
32
+ *
33
+ * @member {boolean}
34
+ * @default true
35
+ * @public
36
+ */
37
+ get mouseEnabled() {
38
+ return this._$mouseEnabled;
39
+ }
40
+ set mouseEnabled(mouse_enabled) {
41
+ this._$mouseEnabled = !!mouse_enabled;
42
+ }
43
+ }
@@ -0,0 +1,130 @@
1
+ import { DisplayObjectContainer } from "./DisplayObjectContainer";
2
+ import { LoaderInfo } from "./LoaderInfo";
3
+ import { URLRequest } from "@next2d/net";
4
+ import { NoCodeDataImpl, ParentImpl } from "@next2d/interface";
5
+ /**
6
+ * Loader クラスは、JSON ファイルまたはイメージ(JPEG、PNG、または GIF)ファイルを読み込むために使用します。
7
+ * 読み込みを開始するには load() メソッドを使用します。
8
+ * 読み込まれた表示オブジェクトは Loader オブジェクトの子として追加されます。
9
+ *
10
+ * The Loader class is used to load JSON files or image (JPEG, PNG, or GIF) files.
11
+ * Use the load() method to initiate loading.
12
+ * The loaded display object is added as a child of the Loader object.
13
+ *
14
+ * @class
15
+ * @memberOf next2d.display
16
+ * @extends DisplayObjectContainer
17
+ */
18
+ export declare class Loader extends DisplayObjectContainer {
19
+ /**
20
+ * @constructor
21
+ * @public
22
+ */
23
+ constructor();
24
+ /**
25
+ * @description 指定されたクラスのストリングを返します。
26
+ * Returns the string representation of the specified class.
27
+ *
28
+ * @return {string}
29
+ * @default [class Loader]
30
+ * @method
31
+ * @static
32
+ */
33
+ static toString(): string;
34
+ /**
35
+ * @description 指定されたクラスの空間名を返します。
36
+ * Returns the space name of the specified class.
37
+ *
38
+ * @return {string}
39
+ * @default next2d.display.Loader
40
+ * @const
41
+ * @static
42
+ */
43
+ static get namespace(): string;
44
+ /**
45
+ * @description 指定されたオブジェクトのストリングを返します。
46
+ * Returns the string representation of the specified object.
47
+ *
48
+ * @return {string}
49
+ * @default [object Loader]
50
+ * @method
51
+ * @public
52
+ */
53
+ toString(): string;
54
+ /**
55
+ * @description 指定されたオブジェクトの空間名を返します。
56
+ * Returns the space name of the specified object.
57
+ *
58
+ * @return {string}
59
+ * @default next2d.display.Loader
60
+ * @const
61
+ * @public
62
+ */
63
+ get namespace(): string;
64
+ /**
65
+ * @description load メソッドを使用して読み込まれた JSON のルート表示オブジェクトが含まれます。
66
+ * It contains a JSON root display object loaded using the load method.
67
+ *
68
+ * @member {MovieClip | Sprite | null}
69
+ * @readonly
70
+ * @public
71
+ */
72
+ get content(): ParentImpl<any> | null;
73
+ /**
74
+ * @description 読み込まれているオブジェクトに対応する LoaderInfo オブジェクトを返します。
75
+ * Returns a LoaderInfo object corresponding to the object being loaded.
76
+ *
77
+ * @member {LoaderInfo}
78
+ * @readonly
79
+ * @public
80
+ */
81
+ get contentLoaderInfo(): LoaderInfo;
82
+ /**
83
+ * @description JSONファイルを、この Loader オブジェクトの子であるcontentプロパティにロードします。
84
+ * JPEG、GIF、PNGなどの画像データは loadImage で同様にcontentプロパティにロードします。
85
+ * Load the JSON file into the content property, which is a child of this Loader object.
86
+ * Image data such as JPEG, GIF, PNG, etc.
87
+ * are loaded into the content property in the same way with loadImage.
88
+ *
89
+ * @param {URLRequest} request
90
+ * @returns {void}
91
+ * @method
92
+ * @public
93
+ */
94
+ load(request: URLRequest): void;
95
+ /**
96
+ * @param {ProgressEvent} event
97
+ * @return {void}
98
+ * @method
99
+ * @private
100
+ */
101
+ _$loadend(event: ProgressEvent): void;
102
+ /**
103
+ * @param {MessageEvent} event
104
+ * @return {void}
105
+ * @method
106
+ * @private
107
+ */
108
+ _$unzipHandler(event: MessageEvent): void;
109
+ /**
110
+ * @param {ProgressEvent} event
111
+ * @return {void}
112
+ * @method
113
+ * @private
114
+ */
115
+ _$loadstart(event: ProgressEvent): void;
116
+ /**
117
+ * @param {ProgressEvent} event
118
+ * @return {void}
119
+ * @method
120
+ * @private
121
+ */
122
+ _$progress(event: ProgressEvent): void;
123
+ /**
124
+ * @param {object} object
125
+ * @return {void}
126
+ * @method
127
+ * @private
128
+ */
129
+ _$build(object: NoCodeDataImpl): void;
130
+ }