@next2d/display 3.15.1 → 3.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.
@@ -21,60 +21,6 @@ export class GraphicsGradientFill {
21
21
  * @private
22
22
  */
23
23
  constructor(type, colors, alphas, ratios, matrix = null, spread_method = "pad", interpolation_method = "rgb", focal_point_ratio = 0) {
24
- Object.defineProperty(this, "_$type", {
25
- enumerable: true,
26
- configurable: true,
27
- writable: true,
28
- value: void 0
29
- });
30
- Object.defineProperty(this, "_$colors", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: void 0
35
- });
36
- Object.defineProperty(this, "_$alphas", {
37
- enumerable: true,
38
- configurable: true,
39
- writable: true,
40
- value: void 0
41
- });
42
- Object.defineProperty(this, "_$ratios", {
43
- enumerable: true,
44
- configurable: true,
45
- writable: true,
46
- value: void 0
47
- });
48
- Object.defineProperty(this, "_$matrix", {
49
- enumerable: true,
50
- configurable: true,
51
- writable: true,
52
- value: void 0
53
- });
54
- Object.defineProperty(this, "_$spreadMethod", {
55
- enumerable: true,
56
- configurable: true,
57
- writable: true,
58
- value: void 0
59
- });
60
- Object.defineProperty(this, "_$interpolationMethod", {
61
- enumerable: true,
62
- configurable: true,
63
- writable: true,
64
- value: void 0
65
- });
66
- Object.defineProperty(this, "_$focalPointRatio", {
67
- enumerable: true,
68
- configurable: true,
69
- writable: true,
70
- value: void 0
71
- });
72
- Object.defineProperty(this, "_$colorStops", {
73
- enumerable: true,
74
- configurable: true,
75
- writable: true,
76
- value: void 0
77
- });
78
24
  /**
79
25
  * @description 使用するグラデーションのタイプを指定する GradientType クラスの値です。
80
26
  * A value from the GradientType class that specifies which gradient type to use.
@@ -17,34 +17,6 @@ export class InteractiveObject extends DisplayObject {
17
17
  */
18
18
  constructor() {
19
19
  super();
20
- /**
21
- * @description このオブジェクトでマウスまたはその他のユーザー入力メッセージを受け取るかどうかを指定します。
22
- * Specifies whether this object receives mouse, or other user input, messages.
23
- *
24
- * @member {boolean}
25
- * @default true
26
- * @public
27
- */
28
- Object.defineProperty(this, "mouseEnabled", {
29
- enumerable: true,
30
- configurable: true,
31
- writable: true,
32
- value: void 0
33
- });
34
- /**
35
- * @description InteractiveObject の機能を所持しているかを返却
36
- * Returns whether InteractiveObject functions are possessed.
37
- *
38
- * @type {boolean}
39
- * @readonly
40
- * @public
41
- */
42
- Object.defineProperty(this, "isInteractive", {
43
- enumerable: true,
44
- configurable: true,
45
- writable: true,
46
- value: void 0
47
- });
48
20
  this.isInteractive = true;
49
21
  this.mouseEnabled = true;
50
22
  }
package/src/Loader.js CHANGED
@@ -17,31 +17,6 @@ export class Loader {
17
17
  * @public
18
18
  */
19
19
  constructor() {
20
- /**
21
- * @description 読み込まれているオブジェクトに対応する LoaderInfo オブジェクトを返します。
22
- * Returns a LoaderInfo object corresponding to the object being loaded.
23
- *
24
- * @type {LoaderInfo}
25
- * @readonly
26
- * @public
27
- */
28
- Object.defineProperty(this, "contentLoaderInfo", {
29
- enumerable: true,
30
- configurable: true,
31
- writable: true,
32
- value: void 0
33
- });
34
- /**
35
- * @type {null}
36
- * @readonly
37
- * @public
38
- */
39
- Object.defineProperty(this, "root", {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: void 0
44
- });
45
20
  this.root = null;
46
21
  this.contentLoaderInfo = new LoaderInfo();
47
22
  }
package/src/LoaderInfo.js CHANGED
@@ -18,75 +18,6 @@ export class LoaderInfo extends EventDispatcher {
18
18
  */
19
19
  constructor() {
20
20
  super();
21
- /**
22
- * @description LoaderInfoのユニークIDを返却
23
- * Returns the unique ID of LoaderInfo
24
- *
25
- * @type {number}
26
- * @readonly
27
- * @public
28
- */
29
- Object.defineProperty(this, "id", {
30
- enumerable: true,
31
- configurable: true,
32
- writable: true,
33
- value: void 0
34
- });
35
- /**
36
- * @description LoaderInfo オブジェクトに関係したロードされたオブジェクトです。
37
- * The loaded object associated with this LoaderInfo object.
38
- *
39
- * @type {MovieClip | Sprite | null}
40
- * @public
41
- */
42
- Object.defineProperty(this, "content", {
43
- enumerable: true,
44
- configurable: true,
45
- writable: true,
46
- value: void 0
47
- });
48
- /**
49
- * @description Loaderで読み込まれたデータオブジェクトを返却
50
- * Returns the data object loaded by the Loader
51
- *
52
- * @type {object}
53
- * @public
54
- */
55
- Object.defineProperty(this, "data", {
56
- enumerable: true,
57
- configurable: true,
58
- writable: true,
59
- value: void 0
60
- });
61
- /**
62
- * @description 読み込まれるメディアの URL です。
63
- * The URL of the media being loaded.
64
- *
65
- * @type {string}
66
- * @default ""
67
- * @readonly
68
- * @public
69
- */
70
- Object.defineProperty(this, "url", {
71
- enumerable: true,
72
- configurable: true,
73
- writable: true,
74
- value: void 0
75
- });
76
- /**
77
- * @description 読み込まれるメディアの データフォーマット です。
78
- * The data format of the media being loaded.
79
- *
80
- * @type {string}
81
- * @default "json"
82
- * @public
83
- */
84
- Object.defineProperty(this, "format", {
85
- enumerable: true,
86
- configurable: true,
87
- writable: true,
88
- value: void 0
89
- });
90
21
  this.id = $getInstanceId();
91
22
  this.url = "";
92
23
  this.content = null;
package/src/LoopConfig.js CHANGED
@@ -19,65 +19,6 @@ export class LoopConfig {
19
19
  * @public
20
20
  */
21
21
  constructor(type = 0, start = 1, end = 0) {
22
- /**
23
- * @description LoopTypeクラスの固定値を利用して、ループのタイプを設定できます。
24
- * You can set the type of loop by using a fixed value in the LoopType class.
25
- *
26
- * @return {number}
27
- * @default 0
28
- * @public
29
- */
30
- Object.defineProperty(this, "type", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: void 0
35
- });
36
- /**
37
- * @description フレーム移動の開始値を設定します。逆再生時はここで設定した値が終了フレームとなります。
38
- * Sets the start value for frame shift. For reverse playback,
39
- * the value set here is the end frame.
40
- *
41
- * @return {number}
42
- * @default 1
43
- * @public
44
- */
45
- Object.defineProperty(this, "start", {
46
- enumerable: true,
47
- configurable: true,
48
- writable: true,
49
- value: void 0
50
- });
51
- /**
52
- * @description フレーム移動の終了値を設定します。逆再生時はここで設定した値が開始フレームとなります。
53
- * Sets the end value of frame shift. For reverse playback,
54
- * the value set here is the start frame.
55
- *
56
- * @return {number}
57
- * @default 0
58
- * @public
59
- */
60
- Object.defineProperty(this, "end", {
61
- enumerable: true,
62
- configurable: true,
63
- writable: true,
64
- value: void 0
65
- });
66
- /**
67
- * @description ループ設定の適用を開始するフレームの値、自動で設定されます。
68
- * The value of the frame at which to start applying the loop setting, set automatically.
69
- *
70
- * @return {number}
71
- * @default 1
72
- * @readonly
73
- * @public
74
- */
75
- Object.defineProperty(this, "frame", {
76
- enumerable: true,
77
- configurable: true,
78
- writable: true,
79
- value: void 0
80
- });
81
22
  this.type = type;
82
23
  this.start = start;
83
24
  this.end = end;
package/src/MovieClip.js CHANGED
@@ -32,162 +32,6 @@ export class MovieClip extends Sprite {
32
32
  */
33
33
  constructor() {
34
34
  super();
35
- /**
36
- * @description フレーム毎のラベルマップ
37
- * Label map per frame
38
- *
39
- * @type {Map<number, FrameLabel>}
40
- * @default null
41
- * @private
42
- */
43
- Object.defineProperty(this, "$labels", {
44
- enumerable: true,
45
- configurable: true,
46
- writable: true,
47
- value: void 0
48
- });
49
- /**
50
- * @description フレーム毎のアクションマップ
51
- * Action map per frame
52
- *
53
- * @type {Map<number, Function[]>}
54
- * @default null
55
- * @private
56
- */
57
- Object.defineProperty(this, "$actions", {
58
- enumerable: true,
59
- configurable: true,
60
- writable: true,
61
- value: void 0
62
- });
63
- /**
64
- * @description フレーム毎のサウンドマップ
65
- * Sound map per frame
66
- *
67
- * @type {Map<number, Sound[]>}
68
- * @default null
69
- * @private
70
- */
71
- Object.defineProperty(this, "$sounds", {
72
- enumerable: true,
73
- configurable: true,
74
- writable: true,
75
- value: void 0
76
- });
77
- /**
78
- * @description アクション実行フラグ
79
- * Action execution flag
80
- *
81
- * @type {boolean}
82
- * @default true
83
- * @private
84
- */
85
- Object.defineProperty(this, "$canAction", {
86
- enumerable: true,
87
- configurable: true,
88
- writable: true,
89
- value: void 0
90
- });
91
- /**
92
- * @description 待機フラグ
93
- * Wait flag
94
- *
95
- * @type {boolean}
96
- * @default false
97
- * @private
98
- */
99
- Object.defineProperty(this, "$wait", {
100
- enumerable: true,
101
- configurable: true,
102
- writable: true,
103
- value: void 0
104
- });
105
- /**
106
- * @description MovieClip インスタンス内のフレーム総数です。
107
- * The total number of frames in the MovieClip instance.
108
- *
109
- * @member {number}
110
- * @default 1
111
- * @readonly
112
- * @public
113
- */
114
- Object.defineProperty(this, "totalFrames", {
115
- enumerable: true,
116
- configurable: true,
117
- writable: true,
118
- value: void 0
119
- });
120
- /**
121
- * @description MovieClipのタイムライン内の再生ヘッドが置かれているフレームの番号を示します。
122
- * Specifies the number of the frame in which the playhead is located
123
- *
124
- * @member {number}
125
- * @default 1
126
- * @readonly
127
- * @public
128
- */
129
- Object.defineProperty(this, "currentFrame", {
130
- enumerable: true,
131
- configurable: true,
132
- writable: true,
133
- value: void 0
134
- });
135
- /**
136
- * @description 停止フラグ
137
- * Stop flag
138
- *
139
- * @type {boolean}
140
- * @default false
141
- * @private
142
- */
143
- Object.defineProperty(this, "_$stopFlag", {
144
- enumerable: true,
145
- configurable: true,
146
- writable: true,
147
- value: void 0
148
- });
149
- /**
150
- * @description サウンド実行フラグ
151
- * Sound execution flag
152
- *
153
- * @type {boolean}
154
- * @default true
155
- * @private
156
- */
157
- Object.defineProperty(this, "$canSound", {
158
- enumerable: true,
159
- configurable: true,
160
- writable: true,
161
- value: void 0
162
- });
163
- /**
164
- * @description タイムラインヘッドが移動したかどうか
165
- * Whether the timeline head has moved
166
- *
167
- * @type {boolean}
168
- * @default true
169
- * @private
170
- */
171
- Object.defineProperty(this, "$hasTimelineHeadMoved", {
172
- enumerable: true,
173
- configurable: true,
174
- writable: true,
175
- value: void 0
176
- });
177
- /**
178
- * @description MovieClipの機能を所持しているかを返却
179
- * Returns whether the display object has MovieClip functionality.
180
- *
181
- * @type {boolean}
182
- * @readonly
183
- * @public
184
- */
185
- Object.defineProperty(this, "isTimelineEnabled", {
186
- enumerable: true,
187
- configurable: true,
188
- writable: true,
189
- value: void 0
190
- });
191
35
  // public
192
36
  this.currentFrame = 1;
193
37
  this.totalFrames = 1;
@@ -23,7 +23,10 @@ export const execute = (shape, src) => {
23
23
  canvas.height = height;
24
24
  const context = canvas.getContext("2d", { "willReadFrequently": true });
25
25
  context.drawImage(image, 0, 0, width, height);
26
- const buffer = new Uint8Array(context.getImageData(0, 0, width, height).data);
26
+ // getImageData が返す配列は呼び出しごとに新しく作られるので、複写せずにそのまま参照する
27
+ // (複写すると、画像 1 枚につき全ピクセルの複写が 1 回増える)
28
+ const data = context.getImageData(0, 0, width, height).data;
29
+ const buffer = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
27
30
  shapeSetBitmapBufferUseCase(shape, width, height, buffer);
28
31
  // 読み込み元のURLから uniqueKey を決める。未設定のままだと、描画時に全ピクセルを
29
32
  // ハッシュしてキーを作るため、大きな画像ではその計算だけでフレームが止まる。
package/src/Shape.js CHANGED
@@ -22,97 +22,6 @@ export class Shape extends DisplayObject {
22
22
  */
23
23
  constructor() {
24
24
  super();
25
- /**
26
- * @type {Graphics}
27
- * @default null
28
- * @private
29
- */
30
- Object.defineProperty(this, "_$graphics", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: void 0
35
- });
36
- /**
37
- * @type {string}
38
- * @default ""
39
- * @private
40
- */
41
- Object.defineProperty(this, "_$src", {
42
- enumerable: true,
43
- configurable: true,
44
- writable: true,
45
- value: void 0
46
- });
47
- /**
48
- * @description Shapeの機能を所持しているかを返却
49
- * Returns whether the display object has Shape functionality.
50
- *
51
- * @type {boolean}
52
- * @readonly
53
- * @public
54
- */
55
- Object.defineProperty(this, "isShape", {
56
- enumerable: true,
57
- configurable: true,
58
- writable: true,
59
- value: void 0
60
- });
61
- /**
62
- * @description ビルドされたキャッシュキー
63
- * Built cache key
64
- *
65
- * @type {number}
66
- * @default 0
67
- * @public
68
- */
69
- Object.defineProperty(this, "cacheKey", {
70
- enumerable: true,
71
- configurable: true,
72
- writable: true,
73
- value: void 0
74
- });
75
- /**
76
- * @description キャッシュのビルドに利用されるパラメータ
77
- * Parameters used to build the cache
78
- *
79
- * @type {number[]}
80
- * @public
81
- */
82
- Object.defineProperty(this, "cacheParams", {
83
- enumerable: true,
84
- configurable: true,
85
- writable: true,
86
- value: void 0
87
- });
88
- /**
89
- * @description ビットマップ描画の判定フラグ
90
- * Bitmap drawing judgment flag
91
- *
92
- * @type {boolean}
93
- * @default false
94
- * @protected
95
- */
96
- Object.defineProperty(this, "isBitmap", {
97
- enumerable: true,
98
- configurable: true,
99
- writable: true,
100
- value: void 0
101
- });
102
- /**
103
- * @description 画像RGBAのUint8Array
104
- * Image RGBA Uint8Array
105
- *
106
- * @type {Uint8Array|null}
107
- * @default null
108
- * @protected
109
- */
110
- Object.defineProperty(this, "$bitmapBuffer", {
111
- enumerable: true,
112
- configurable: true,
113
- writable: true,
114
- value: void 0
115
- });
116
25
  this.isShape = true;
117
26
  this.cacheKey = 0;
118
27
  this.cacheParams = $getArray(0, 0, 0);
package/src/Sprite.js CHANGED
@@ -16,74 +16,6 @@ export class Sprite extends DisplayObjectContainer {
16
16
  */
17
17
  constructor() {
18
18
  super();
19
- /**
20
- * @description このスプライトのボタンモードを指定します。
21
- * Specifies the button mode of this sprite.
22
- *
23
- * @member {boolean}
24
- * @default false
25
- * @public
26
- */
27
- Object.defineProperty(this, "buttonMode", {
28
- enumerable: true,
29
- configurable: true,
30
- writable: true,
31
- value: void 0
32
- });
33
- /**
34
- * @description buttonMode プロパティが true に設定されたスプライト上にポインターが移動したときに、
35
- * 指差しハンドポインター(ハンドカーソル)を表示するかどうかを示すブール値です。
36
- * A Boolean value that indicates whether the pointing hand (hand cursor)
37
- * appears when the pointer rolls over a sprite
38
- * in which the buttonMode property is set to true.
39
- *
40
- * @member {boolean}
41
- * @default true
42
- * @public
43
- */
44
- Object.defineProperty(this, "useHandCursor", {
45
- enumerable: true,
46
- configurable: true,
47
- writable: true,
48
- value: void 0
49
- });
50
- /**
51
- * @description Spriteの機能を所持しているかを返却
52
- * Returns whether Sprite functions are possessed.
53
- *
54
- * @type {boolean}
55
- * @readonly
56
- * @public
57
- */
58
- Object.defineProperty(this, "isSprite", {
59
- enumerable: true,
60
- configurable: true,
61
- writable: true,
62
- value: void 0
63
- });
64
- /**
65
- * @description スプライトのヒット領域となる別のスプライトを指定します。
66
- * Designates another sprite to serve as the hit area for a sprite.
67
- *
68
- * @type {Sprite|null}
69
- * @public
70
- */
71
- Object.defineProperty(this, "hitArea", {
72
- enumerable: true,
73
- configurable: true,
74
- writable: true,
75
- value: void 0
76
- });
77
- /**
78
- * @type {SoundTransform|null}
79
- * @private
80
- */
81
- Object.defineProperty(this, "_$soundTransform", {
82
- enumerable: true,
83
- configurable: true,
84
- writable: true,
85
- value: void 0
86
- });
87
19
  /**
88
20
  * @description ドラッグ時のオフセットX
89
21
  * Offset X during drag
@@ -91,12 +23,7 @@ export class Sprite extends DisplayObjectContainer {
91
23
  * @type {number}
92
24
  * @public
93
25
  */
94
- Object.defineProperty(this, "$offsetX", {
95
- enumerable: true,
96
- configurable: true,
97
- writable: true,
98
- value: 0
99
- });
26
+ this.$offsetX = 0;
100
27
  /**
101
28
  * @description ドラッグ時のオフセットY
102
29
  * Offset Y during drag
@@ -104,12 +31,7 @@ export class Sprite extends DisplayObjectContainer {
104
31
  * @type {number}
105
32
  * @public
106
33
  */
107
- Object.defineProperty(this, "$offsetY", {
108
- enumerable: true,
109
- configurable: true,
110
- writable: true,
111
- value: 0
112
- });
34
+ this.$offsetY = 0;
113
35
  /**
114
36
  * @description 中心をロックするかどうか
115
37
  * Whether to lock the center
@@ -117,12 +39,7 @@ export class Sprite extends DisplayObjectContainer {
117
39
  * @type {boolean}
118
40
  * @public
119
41
  */
120
- Object.defineProperty(this, "$lockCenter", {
121
- enumerable: true,
122
- configurable: true,
123
- writable: true,
124
- value: false
125
- });
42
+ this.$lockCenter = false;
126
43
  /**
127
44
  * @description バウンドされた矩形
128
45
  * Bounded rectangle
@@ -130,12 +47,7 @@ export class Sprite extends DisplayObjectContainer {
130
47
  * @type {Rectangle|null}
131
48
  * @public
132
49
  */
133
- Object.defineProperty(this, "$boundedRect", {
134
- enumerable: true,
135
- configurable: true,
136
- writable: true,
137
- value: null
138
- });
50
+ this.$boundedRect = null;
139
51
  // public
140
52
  this.isSprite = true;
141
53
  this.buttonMode = false;