@next2d/player 1.14.19 → 1.14.21

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.
Files changed (386) hide show
  1. package/index.js +3 -3
  2. package/package.json +31 -6
  3. package/interface/AjaxEventImpl.d.ts +0 -5
  4. package/interface/AjaxEventImpl.js +0 -1
  5. package/interface/AjaxOptionImpl.d.ts +0 -13
  6. package/interface/AjaxOptionImpl.js +0 -1
  7. package/interface/AttachmentImpl.d.ts +0 -11
  8. package/interface/AttachmentImpl.js +0 -1
  9. package/interface/BitmapDataChannelImpl.d.ts +0 -1
  10. package/interface/BitmapDataChannelImpl.js +0 -1
  11. package/interface/BitmapDrawObjectImpl.d.ts +0 -6
  12. package/interface/BitmapDrawObjectImpl.js +0 -1
  13. package/interface/BitmapFilterTypeImpl.d.ts +0 -1
  14. package/interface/BitmapFilterTypeImpl.js +0 -1
  15. package/interface/BlendModeImpl.d.ts +0 -1
  16. package/interface/BlendModeImpl.js +0 -1
  17. package/interface/BoundsImpl.d.ts +0 -6
  18. package/interface/BoundsImpl.js +0 -1
  19. package/interface/Character.d.ts +0 -2
  20. package/interface/Character.js +0 -1
  21. package/interface/CharacterImpl.d.ts +0 -2
  22. package/interface/CharacterImpl.js +0 -1
  23. package/interface/ClipObjectImpl.d.ts +0 -14
  24. package/interface/ClipObjectImpl.js +0 -1
  25. package/interface/ColorStopImpl.d.ts +0 -7
  26. package/interface/ColorStopImpl.js +0 -1
  27. package/interface/DictionaryTagImpl.d.ts +0 -7
  28. package/interface/DictionaryTagImpl.js +0 -1
  29. package/interface/DisplacementMapFilterModeImpl.d.ts +0 -1
  30. package/interface/DisplacementMapFilterModeImpl.js +0 -1
  31. package/interface/DisplayImpl.d.ts +0 -28
  32. package/interface/DisplayImpl.js +0 -1
  33. package/interface/DisplayObjectImpl.d.ts +0 -2
  34. package/interface/DisplayObjectImpl.js +0 -1
  35. package/interface/DragRulesImpl.d.ts +0 -7
  36. package/interface/DragRulesImpl.js +0 -1
  37. package/interface/DropTargetImpl.d.ts +0 -2
  38. package/interface/DropTargetImpl.js +0 -1
  39. package/interface/EventDispatcherImpl.d.ts +0 -2
  40. package/interface/EventDispatcherImpl.js +0 -1
  41. package/interface/EventListenerImpl.d.ts +0 -6
  42. package/interface/EventListenerImpl.js +0 -1
  43. package/interface/EventsImpl.d.ts +0 -20
  44. package/interface/EventsImpl.js +0 -1
  45. package/interface/FillMeshImpl.d.ts +0 -5
  46. package/interface/FillMeshImpl.js +0 -1
  47. package/interface/FilterArrayImpl.d.ts +0 -10
  48. package/interface/FilterArrayImpl.js +0 -1
  49. package/interface/FilterQualityImpl.d.ts +0 -1
  50. package/interface/FilterQualityImpl.js +0 -1
  51. package/interface/FiltersImpl.d.ts +0 -20
  52. package/interface/FiltersImpl.js +0 -1
  53. package/interface/GeomImpl.d.ts +0 -12
  54. package/interface/GeomImpl.js +0 -1
  55. package/interface/GradientTypeImpl.d.ts +0 -3
  56. package/interface/GradientTypeImpl.js +0 -1
  57. package/interface/GraphicsParentImpl.d.ts +0 -2
  58. package/interface/GraphicsParentImpl.js +0 -1
  59. package/interface/GridImpl.d.ts +0 -6
  60. package/interface/GridImpl.js +0 -1
  61. package/interface/ImageTypeImpl.d.ts +0 -1
  62. package/interface/ImageTypeImpl.js +0 -1
  63. package/interface/IndexRangeImpl.d.ts +0 -4
  64. package/interface/IndexRangeImpl.js +0 -1
  65. package/interface/LoaderInfoDataImpl.d.ts +0 -7
  66. package/interface/LoaderInfoDataImpl.js +0 -1
  67. package/interface/LoopConfigImpl.d.ts +0 -8
  68. package/interface/LoopConfigImpl.js +0 -1
  69. package/interface/LoopTypeImpl.d.ts +0 -1
  70. package/interface/LoopTypeImpl.js +0 -1
  71. package/interface/MediaImpl.d.ts +0 -10
  72. package/interface/MediaImpl.js +0 -1
  73. package/interface/MovieClipActionObjectImpl.d.ts +0 -5
  74. package/interface/MovieClipActionObjectImpl.js +0 -1
  75. package/interface/MovieClipCharacterImpl.d.ts +0 -18
  76. package/interface/MovieClipCharacterImpl.js +0 -1
  77. package/interface/MovieClipLabelObjectImpl.d.ts +0 -4
  78. package/interface/MovieClipLabelObjectImpl.js +0 -1
  79. package/interface/MovieClipSoundObjectImpl.d.ts +0 -5
  80. package/interface/MovieClipSoundObjectImpl.js +0 -1
  81. package/interface/NetImpl.d.ts +0 -6
  82. package/interface/NetImpl.js +0 -1
  83. package/interface/NoCodeDataImpl.d.ts +0 -7
  84. package/interface/NoCodeDataImpl.js +0 -1
  85. package/interface/NoCodeDataZlibImpl.d.ts +0 -4
  86. package/interface/NoCodeDataZlibImpl.js +0 -1
  87. package/interface/ParentImpl.d.ts +0 -2
  88. package/interface/ParentImpl.js +0 -1
  89. package/interface/PlaceObjectImpl.d.ts +0 -12
  90. package/interface/PlaceObjectImpl.js +0 -1
  91. package/interface/PlayerHitObjectImpl.d.ts +0 -7
  92. package/interface/PlayerHitObjectImpl.js +0 -1
  93. package/interface/PlayerModeImpl.d.ts +0 -1
  94. package/interface/PlayerModeImpl.js +0 -1
  95. package/interface/PlayerOptionsImpl.d.ts +0 -8
  96. package/interface/PlayerOptionsImpl.js +0 -1
  97. package/interface/PointImpl.d.ts +0 -4
  98. package/interface/PointImpl.js +0 -1
  99. package/interface/PreObjectImpl.d.ts +0 -23
  100. package/interface/PreObjectImpl.js +0 -1
  101. package/interface/PropertyBitmapDataMessageImpl.d.ts +0 -8
  102. package/interface/PropertyBitmapDataMessageImpl.js +0 -1
  103. package/interface/PropertyContainerMessageImpl.d.ts +0 -6
  104. package/interface/PropertyContainerMessageImpl.js +0 -1
  105. package/interface/PropertyMessageImpl.d.ts +0 -41
  106. package/interface/PropertyMessageImpl.js +0 -1
  107. package/interface/PropertyMessageMapImpl.d.ts +0 -2
  108. package/interface/PropertyMessageMapImpl.js +0 -1
  109. package/interface/PropertyShapeMessageImpl.d.ts +0 -6
  110. package/interface/PropertyShapeMessageImpl.js +0 -1
  111. package/interface/PropertyTextMessageImpl.d.ts +0 -25
  112. package/interface/PropertyTextMessageImpl.js +0 -1
  113. package/interface/PropertyVideoMessageImpl.d.ts +0 -5
  114. package/interface/PropertyVideoMessageImpl.js +0 -1
  115. package/interface/RGBAImpl.d.ts +0 -6
  116. package/interface/RGBAImpl.js +0 -1
  117. package/interface/ShapeCharacterImpl.d.ts +0 -14
  118. package/interface/ShapeCharacterImpl.js +0 -1
  119. package/interface/SoundCharacterImpl.d.ts +0 -5
  120. package/interface/SoundCharacterImpl.js +0 -1
  121. package/interface/SoundTagImpl.d.ts +0 -6
  122. package/interface/SoundTagImpl.js +0 -1
  123. package/interface/SpriteImpl.d.ts +0 -2
  124. package/interface/SpriteImpl.js +0 -1
  125. package/interface/StageDataImpl.d.ts +0 -6
  126. package/interface/StageDataImpl.js +0 -1
  127. package/interface/StageQualityImpl.d.ts +0 -1
  128. package/interface/StageQualityImpl.js +0 -1
  129. package/interface/StrokeMethImpl.d.ts +0 -4
  130. package/interface/StrokeMethImpl.js +0 -1
  131. package/interface/StrokeTypeImpl.d.ts +0 -2
  132. package/interface/StrokeTypeImpl.js +0 -1
  133. package/interface/SurfaceFilterImpl.d.ts +0 -6
  134. package/interface/SurfaceFilterImpl.js +0 -1
  135. package/interface/TextBreakObjectImpl.d.ts +0 -9
  136. package/interface/TextBreakObjectImpl.js +0 -1
  137. package/interface/TextCharacterImpl.d.ts +0 -27
  138. package/interface/TextCharacterImpl.js +0 -1
  139. package/interface/TextDataImpl.d.ts +0 -2
  140. package/interface/TextDataImpl.js +0 -1
  141. package/interface/TextFieldAutoSizeImpl.d.ts +0 -1
  142. package/interface/TextFieldAutoSizeImpl.js +0 -1
  143. package/interface/TextFieldTypeImpl.d.ts +0 -1
  144. package/interface/TextFieldTypeImpl.js +0 -1
  145. package/interface/TextFormatAlignImpl.d.ts +0 -1
  146. package/interface/TextFormatAlignImpl.js +0 -1
  147. package/interface/TextFormatVerticalAlignImpl.d.ts +0 -1
  148. package/interface/TextFormatVerticalAlignImpl.js +0 -1
  149. package/interface/TextImageObjectImpl.d.ts +0 -11
  150. package/interface/TextImageObjectImpl.js +0 -1
  151. package/interface/TextImpl.d.ts +0 -6
  152. package/interface/TextImpl.js +0 -1
  153. package/interface/TextObjectImpl.d.ts +0 -7
  154. package/interface/TextObjectImpl.js +0 -1
  155. package/interface/TextObjectModeImpl.d.ts +0 -1
  156. package/interface/TextObjectModeImpl.js +0 -1
  157. package/interface/TextStringObjectImpl.d.ts +0 -7
  158. package/interface/TextStringObjectImpl.js +0 -1
  159. package/interface/UIImpl.d.ts +0 -8
  160. package/interface/UIImpl.js +0 -1
  161. package/interface/URLLoaderDataFormatImpl.d.ts +0 -1
  162. package/interface/URLLoaderDataFormatImpl.js +0 -1
  163. package/interface/URLRequestMethodImpl.d.ts +0 -1
  164. package/interface/URLRequestMethodImpl.js +0 -1
  165. package/interface/UniformDataImpl.d.ts +0 -5
  166. package/interface/UniformDataImpl.js +0 -1
  167. package/interface/UnzipQueueImpl.d.ts +0 -6
  168. package/interface/UnzipQueueImpl.js +0 -1
  169. package/interface/VerticesImpl.d.ts +0 -1
  170. package/interface/VerticesImpl.js +0 -1
  171. package/interface/VideoCharacterImpl.d.ts +0 -12
  172. package/interface/VideoCharacterImpl.js +0 -1
  173. package/next2d/display/BitmapData.d.ts +0 -143
  174. package/next2d/display/BitmapData.js +0 -387
  175. package/next2d/display/BlendMode.d.ts +0 -204
  176. package/next2d/display/BlendMode.js +0 -240
  177. package/next2d/display/DisplayObject.d.ts +0 -565
  178. package/next2d/display/DisplayObject.js +0 -1670
  179. package/next2d/display/DisplayObjectContainer.d.ts +0 -351
  180. package/next2d/display/DisplayObjectContainer.js +0 -1776
  181. package/next2d/display/FrameLabel.d.ts +0 -98
  182. package/next2d/display/FrameLabel.js +0 -120
  183. package/next2d/display/Graphics.d.ts +0 -577
  184. package/next2d/display/Graphics.js +0 -2161
  185. package/next2d/display/GraphicsBitmapFill.d.ts +0 -49
  186. package/next2d/display/GraphicsBitmapFill.js +0 -86
  187. package/next2d/display/GraphicsGradientFill.d.ts +0 -66
  188. package/next2d/display/GraphicsGradientFill.js +0 -157
  189. package/next2d/display/InteractiveObject.d.ts +0 -32
  190. package/next2d/display/InteractiveObject.js +0 -43
  191. package/next2d/display/Loader.d.ts +0 -131
  192. package/next2d/display/Loader.js +0 -321
  193. package/next2d/display/LoaderInfo.d.ts +0 -122
  194. package/next2d/display/LoaderInfo.js +0 -184
  195. package/next2d/display/LoopConfig.d.ts +0 -108
  196. package/next2d/display/LoopConfig.js +0 -156
  197. package/next2d/display/LoopType.d.ts +0 -104
  198. package/next2d/display/LoopType.js +0 -122
  199. package/next2d/display/MovieClip.d.ts +0 -314
  200. package/next2d/display/MovieClip.js +0 -941
  201. package/next2d/display/Shape.d.ts +0 -169
  202. package/next2d/display/Shape.js +0 -509
  203. package/next2d/display/Sprite.d.ts +0 -175
  204. package/next2d/display/Sprite.js +0 -280
  205. package/next2d/display/Stage.d.ts +0 -164
  206. package/next2d/display/Stage.js +0 -251
  207. package/next2d/events/Event.d.ts +0 -424
  208. package/next2d/events/Event.js +0 -560
  209. package/next2d/events/EventDispatcher.d.ts +0 -138
  210. package/next2d/events/EventDispatcher.js +0 -623
  211. package/next2d/events/EventPhase.d.ts +0 -80
  212. package/next2d/events/EventPhase.js +0 -94
  213. package/next2d/events/FocusEvent.d.ts +0 -89
  214. package/next2d/events/FocusEvent.js +0 -103
  215. package/next2d/events/HTTPStatusEvent.d.ts +0 -107
  216. package/next2d/events/HTTPStatusEvent.js +0 -139
  217. package/next2d/events/IOErrorEvent.d.ts +0 -82
  218. package/next2d/events/IOErrorEvent.js +0 -101
  219. package/next2d/events/MouseEvent.d.ts +0 -163
  220. package/next2d/events/MouseEvent.js +0 -207
  221. package/next2d/events/ProgressEvent.d.ts +0 -97
  222. package/next2d/events/ProgressEvent.js +0 -123
  223. package/next2d/events/VideoEvent.d.ts +0 -145
  224. package/next2d/events/VideoEvent.js +0 -181
  225. package/next2d/filters/BevelFilter.d.ts +0 -254
  226. package/next2d/filters/BevelFilter.js +0 -491
  227. package/next2d/filters/BitmapFilter.d.ts +0 -75
  228. package/next2d/filters/BitmapFilter.js +0 -95
  229. package/next2d/filters/BlurFilter.d.ts +0 -150
  230. package/next2d/filters/BlurFilter.js +0 -370
  231. package/next2d/filters/ColorMatrixFilter.d.ts +0 -116
  232. package/next2d/filters/ColorMatrixFilter.js +0 -179
  233. package/next2d/filters/ConvolutionFilter.d.ts +0 -210
  234. package/next2d/filters/ConvolutionFilter.js +0 -366
  235. package/next2d/filters/DisplacementMapFilter.d.ts +0 -212
  236. package/next2d/filters/DisplacementMapFilter.js +0 -372
  237. package/next2d/filters/DropShadowFilter.d.ts +0 -240
  238. package/next2d/filters/DropShadowFilter.js +0 -461
  239. package/next2d/filters/GlowFilter.d.ts +0 -204
  240. package/next2d/filters/GlowFilter.js +0 -356
  241. package/next2d/filters/GradientBevelFilter.d.ts +0 -243
  242. package/next2d/filters/GradientBevelFilter.js +0 -474
  243. package/next2d/filters/GradientGlowFilter.d.ts +0 -243
  244. package/next2d/filters/GradientGlowFilter.js +0 -464
  245. package/next2d/geom/ColorTransform.d.ts +0 -201
  246. package/next2d/geom/ColorTransform.js +0 -278
  247. package/next2d/geom/Matrix.d.ts +0 -299
  248. package/next2d/geom/Matrix.js +0 -454
  249. package/next2d/geom/Point.d.ts +0 -213
  250. package/next2d/geom/Point.js +0 -274
  251. package/next2d/geom/Rectangle.d.ts +0 -364
  252. package/next2d/geom/Rectangle.js +0 -513
  253. package/next2d/geom/Transform.d.ts +0 -213
  254. package/next2d/geom/Transform.js +0 -492
  255. package/next2d/media/Sound.d.ts +0 -208
  256. package/next2d/media/Sound.js +0 -504
  257. package/next2d/media/SoundMixer.d.ts +0 -68
  258. package/next2d/media/SoundMixer.js +0 -115
  259. package/next2d/media/SoundTransform.d.ts +0 -80
  260. package/next2d/media/SoundTransform.js +0 -111
  261. package/next2d/media/Video.d.ts +0 -331
  262. package/next2d/media/Video.js +0 -856
  263. package/next2d/net/URLRequest.d.ts +0 -143
  264. package/next2d/net/URLRequest.js +0 -232
  265. package/next2d/net/URLRequestHeader.d.ts +0 -82
  266. package/next2d/net/URLRequestHeader.js +0 -105
  267. package/next2d/text/TextField.d.ts +0 -644
  268. package/next2d/text/TextField.js +0 -2662
  269. package/next2d/text/TextFormat.d.ts +0 -250
  270. package/next2d/text/TextFormat.js +0 -460
  271. package/next2d/ui/Easing.d.ts +0 -359
  272. package/next2d/ui/Easing.js +0 -481
  273. package/next2d/ui/Job.d.ts +0 -155
  274. package/next2d/ui/Job.js +0 -333
  275. package/next2d/ui/Tween.d.ts +0 -62
  276. package/next2d/ui/Tween.js +0 -72
  277. package/packages/Display.d.ts +0 -3
  278. package/packages/Display.js +0 -36
  279. package/packages/Events.d.ts +0 -3
  280. package/packages/Events.js +0 -28
  281. package/packages/Filters.d.ts +0 -3
  282. package/packages/Filters.js +0 -28
  283. package/packages/Geom.d.ts +0 -3
  284. package/packages/Geom.js +0 -20
  285. package/packages/Media.d.ts +0 -3
  286. package/packages/Media.js +0 -18
  287. package/packages/Net.d.ts +0 -3
  288. package/packages/Net.js +0 -14
  289. package/packages/Text.d.ts +0 -3
  290. package/packages/Text.js +0 -14
  291. package/packages/UI.d.ts +0 -3
  292. package/packages/UI.js +0 -16
  293. package/player/Next2D.d.ts +0 -70
  294. package/player/Next2D.js +0 -192
  295. package/player/Player.d.ts +0 -334
  296. package/player/Player.js +0 -1863
  297. package/util/CacheStore.d.ts +0 -115
  298. package/util/CacheStore.js +0 -276
  299. package/util/Global.d.ts +0 -23
  300. package/util/Global.js +0 -67
  301. package/util/RenderUtil.d.ts +0 -472
  302. package/util/RenderUtil.js +0 -686
  303. package/util/Shortcut.d.ts +0 -28
  304. package/util/Shortcut.js +0 -28
  305. package/util/Util.d.ts +0 -334
  306. package/util/Util.js +0 -844
  307. package/webgl/BezierConverter.d.ts +0 -59
  308. package/webgl/BezierConverter.js +0 -106
  309. package/webgl/CanvasGradientToWebGL.d.ts +0 -94
  310. package/webgl/CanvasGradientToWebGL.js +0 -181
  311. package/webgl/CanvasPatternToWebGL.d.ts +0 -39
  312. package/webgl/CanvasPatternToWebGL.js +0 -66
  313. package/webgl/CanvasToWebGLContext.d.ts +0 -596
  314. package/webgl/CanvasToWebGLContext.js +0 -1421
  315. package/webgl/CanvasToWebGLContextBlend.d.ts +0 -97
  316. package/webgl/CanvasToWebGLContextBlend.js +0 -299
  317. package/webgl/CanvasToWebGLContextGrid.d.ts +0 -74
  318. package/webgl/CanvasToWebGLContextGrid.js +0 -283
  319. package/webgl/CanvasToWebGLContextMask.d.ts +0 -113
  320. package/webgl/CanvasToWebGLContextMask.js +0 -436
  321. package/webgl/CanvasToWebGLContextPath.d.ts +0 -111
  322. package/webgl/CanvasToWebGLContextPath.js +0 -210
  323. package/webgl/CanvasToWebGLContextStyle.d.ts +0 -77
  324. package/webgl/CanvasToWebGLContextStyle.js +0 -139
  325. package/webgl/ColorBufferPool.d.ts +0 -58
  326. package/webgl/ColorBufferPool.js +0 -134
  327. package/webgl/FrameBufferManager.d.ts +0 -135
  328. package/webgl/FrameBufferManager.js +0 -358
  329. package/webgl/StencilBufferPool.d.ts +0 -56
  330. package/webgl/StencilBufferPool.js +0 -142
  331. package/webgl/TextureManager.d.ts +0 -130
  332. package/webgl/TextureManager.js +0 -296
  333. package/webgl/VertexArrayObjectManager.d.ts +0 -95
  334. package/webgl/VertexArrayObjectManager.js +0 -277
  335. package/webgl/WebGLFillMeshGenerator.d.ts +0 -31
  336. package/webgl/WebGLFillMeshGenerator.js +0 -101
  337. package/webgl/WebGLStrokeMeshGenerator.d.ts +0 -182
  338. package/webgl/WebGLStrokeMeshGenerator.js +0 -504
  339. package/webgl/shader/CanvasToWebGLShader.d.ts +0 -85
  340. package/webgl/shader/CanvasToWebGLShader.js +0 -192
  341. package/webgl/shader/CanvasToWebGLShaderList.d.ts +0 -70
  342. package/webgl/shader/CanvasToWebGLShaderList.js +0 -109
  343. package/webgl/shader/GradientLUTGenerator.d.ts +0 -36
  344. package/webgl/shader/GradientLUTGenerator.js +0 -123
  345. package/webgl/shader/WebGLShaderUniform.d.ts +0 -52
  346. package/webgl/shader/WebGLShaderUniform.js +0 -165
  347. package/webgl/shader/fragment/FragmentShaderLibrary.d.ts +0 -18
  348. package/webgl/shader/fragment/FragmentShaderLibrary.js +0 -35
  349. package/webgl/shader/fragment/FragmentShaderSource.d.ts +0 -29
  350. package/webgl/shader/fragment/FragmentShaderSource.js +0 -99
  351. package/webgl/shader/fragment/FragmentShaderSourceBlend.d.ts +0 -67
  352. package/webgl/shader/fragment/FragmentShaderSourceBlend.js +0 -319
  353. package/webgl/shader/fragment/FragmentShaderSourceGradient.d.ts +0 -44
  354. package/webgl/shader/fragment/FragmentShaderSourceGradient.js +0 -114
  355. package/webgl/shader/fragment/FragmentShaderSourceGradientLUT.d.ts +0 -14
  356. package/webgl/shader/fragment/FragmentShaderSourceGradientLUT.js +0 -58
  357. package/webgl/shader/fragment/FragmentShaderSourceTexture.d.ts +0 -12
  358. package/webgl/shader/fragment/FragmentShaderSourceTexture.js +0 -36
  359. package/webgl/shader/fragment/filter/FragmentShaderSourceBlurFilter.d.ts +0 -12
  360. package/webgl/shader/fragment/filter/FragmentShaderSourceBlurFilter.js +0 -42
  361. package/webgl/shader/fragment/filter/FragmentShaderSourceColorMatrixFilter.d.ts +0 -11
  362. package/webgl/shader/fragment/filter/FragmentShaderSourceColorMatrixFilter.js +0 -35
  363. package/webgl/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.d.ts +0 -16
  364. package/webgl/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.js +0 -80
  365. package/webgl/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.d.ts +0 -15
  366. package/webgl/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.js +0 -106
  367. package/webgl/shader/fragment/filter/FragmentShaderSourceFilter.d.ts +0 -112
  368. package/webgl/shader/fragment/filter/FragmentShaderSourceFilter.js +0 -275
  369. package/webgl/shader/variants/BlendShaderVariantCollection.d.ts +0 -99
  370. package/webgl/shader/variants/BlendShaderVariantCollection.js +0 -239
  371. package/webgl/shader/variants/FilterShaderVariantCollection.d.ts +0 -150
  372. package/webgl/shader/variants/FilterShaderVariantCollection.js +0 -395
  373. package/webgl/shader/variants/GradientLUTShaderVariantCollection.d.ts +0 -49
  374. package/webgl/shader/variants/GradientLUTShaderVariantCollection.js +0 -107
  375. package/webgl/shader/variants/GradientShapeShaderVariantCollection.d.ts +0 -61
  376. package/webgl/shader/variants/GradientShapeShaderVariantCollection.js +0 -196
  377. package/webgl/shader/variants/ShapeShaderVariantCollection.d.ts +0 -117
  378. package/webgl/shader/variants/ShapeShaderVariantCollection.js +0 -427
  379. package/webgl/shader/vertex/VertexShaderLibrary.d.ts +0 -18
  380. package/webgl/shader/vertex/VertexShaderLibrary.js +0 -75
  381. package/webgl/shader/vertex/VertexShaderSource.d.ts +0 -23
  382. package/webgl/shader/vertex/VertexShaderSource.js +0 -92
  383. package/webgl/shader/vertex/VertexShaderSourceFill.d.ts +0 -45
  384. package/webgl/shader/vertex/VertexShaderSourceFill.js +0 -112
  385. package/webgl/shader/vertex/VertexShaderSourceStroke.d.ts +0 -27
  386. package/webgl/shader/vertex/VertexShaderSourceStroke.js +0 -149
@@ -1,1670 +0,0 @@
1
- import { Event as Next2DEvent } from "../events/Event";
2
- import { EventDispatcher } from "../events/EventDispatcher";
3
- import { Transform } from "../geom/Transform";
4
- import { Rectangle } from "../geom/Rectangle";
5
- import { Point } from "../geom/Point";
6
- import { $doUpdated, $getEvent, $getInstanceId } from "../../util/Global";
7
- import { $currentMousePoint, $currentPlayer, $poolColorTransform, $rendererWorker, $poolMatrix, $hitContext, $variables } from "../../util/Util";
8
- import { $clamp, $getArray, $boundsMatrix, $Math, $poolBoundsObject, $Infinity, $getBoundsObject, $isNaN, $Deg2Rad, $Number, $Rad2Deg, $SHORT_INT_MIN, $SHORT_INT_MAX, $MATRIX_ARRAY_IDENTITY, $multiplicationMatrix, $poolFloat32Array6, $getMap, $poolMap, $getFloat32Array6 } from "../../util/RenderUtil";
9
- /**
10
- * DisplayObject クラスは、表示リストに含めることのできるすべてのオブジェクトに関する基本クラスです。
11
- * DisplayObject クラス自体は、画面上でのコンテンツの描画のための API を含みません。
12
- * そのため、DisplayObject クラスのカスタムサブクラスを作成する場合は、
13
- * Shape、Sprite、Bitmap、TextField または MovieClip など、
14
- * 画面上にコンテンツを描画する API を持つサブクラスの 1 つを拡張する必要があります。
15
- *
16
- * The DisplayObject class is the base class for all objects that can be placed on the display list.
17
- * The DisplayObject class itself does not include any APIs for rendering content onscreen.
18
- * For that reason, if you want create a custom subclass of the DisplayObject class,
19
- * you will want to extend one of its subclasses that do have APIs for rendering content onscreen,
20
- * such as the Shape, Sprite, Bitmap, TextField, or MovieClip class.
21
- *
22
- * @class
23
- * @memberOf next2d.display
24
- * @extends EventDispatcher
25
- */
26
- export class DisplayObject extends EventDispatcher {
27
- /**
28
- * @constructor
29
- * @public
30
- */
31
- constructor() {
32
- super();
33
- /**
34
- * @type {number}
35
- * @private
36
- */
37
- this._$id = -1;
38
- /**
39
- * @type {number}
40
- * @private
41
- */
42
- this._$instanceId = $getInstanceId();
43
- /**
44
- * @type {number}
45
- * @private
46
- */
47
- this._$characterId = 0;
48
- /**
49
- * @type {boolean}
50
- * @default false
51
- * @private
52
- */
53
- this._$active = false;
54
- /**
55
- * @type {boolean}
56
- * @default false
57
- * @private
58
- */
59
- this._$isMask = false;
60
- /**
61
- * @type {boolean}
62
- * @default false
63
- * @private
64
- */
65
- this._$updated = true;
66
- /**
67
- * @type {boolean}
68
- * @default false
69
- * @private
70
- */
71
- this._$added = false;
72
- /**
73
- * @type {boolean}
74
- * @default false
75
- * @private
76
- */
77
- this._$addedStage = false;
78
- /**
79
- * @type {array|null}
80
- * @default null
81
- * @private
82
- */
83
- this._$filters = null;
84
- /**
85
- * @type {string|null}
86
- * @default null
87
- * @private
88
- */
89
- this._$blendMode = null;
90
- /**
91
- * @type {Sprite|null}
92
- * @default null
93
- * @private
94
- */
95
- this._$hitObject = null;
96
- /**
97
- * @type {boolean}
98
- * @default true
99
- * @private
100
- */
101
- this._$isNext = true;
102
- /**
103
- * @type {boolean}
104
- * @default false
105
- * @private
106
- */
107
- this._$created = false;
108
- /**
109
- * @type {boolean}
110
- * @default false
111
- * @private
112
- */
113
- this._$posted = false;
114
- /**
115
- * @type {number}
116
- * @default 0
117
- * @private
118
- */
119
- this._$clipDepth = 0;
120
- /**
121
- * @type {string}
122
- * @default ""
123
- * @private
124
- */
125
- this._$name = "";
126
- /**
127
- * @type {boolean}
128
- * @default true
129
- * @private
130
- */
131
- this._$visible = true;
132
- /**
133
- * @type {DisplayObject|null}
134
- * @default null
135
- * @private
136
- */
137
- this._$mask = null;
138
- /**
139
- * @type {Rectangle|null}
140
- * @default null
141
- * @private
142
- */
143
- this._$scale9Grid = null;
144
- /**
145
- * @type {Sprite | null}
146
- * @default null
147
- * @private
148
- */
149
- this._$parent = null;
150
- /**
151
- * @type {Stage|null}
152
- * @default null
153
- * @private
154
- */
155
- this._$stage = null;
156
- /**
157
- * @type {Sprite|null}
158
- * @default null
159
- * @private
160
- */
161
- this._$root = null;
162
- /**
163
- * @type {number|null}
164
- * @default null
165
- * @private
166
- */
167
- this._$loaderInfo = null;
168
- /**
169
- * @type {number|null}
170
- * @default null
171
- * @private
172
- */
173
- this._$placeId = -1;
174
- /**
175
- * @type {number}
176
- * @default null
177
- * @private
178
- */
179
- this._$startFrame = 1;
180
- /**
181
- * @type {number}
182
- * @default 0
183
- * @private
184
- */
185
- this._$endFrame = 0;
186
- /**
187
- * @type {Transform}
188
- * @private
189
- */
190
- this._$transform = new Transform(this);
191
- /**
192
- * @type {Map}
193
- * @default null
194
- * @private
195
- */
196
- this._$variables = null;
197
- /**
198
- * @type {object}
199
- * @default null
200
- * @private
201
- */
202
- this._$placeObject = null;
203
- /**
204
- * @type {number}
205
- * @default -1
206
- * @private
207
- */
208
- this._$currentPlaceId = -1;
209
- /**
210
- * @type {boolean}
211
- * @default false
212
- * @private
213
- */
214
- this._$changePlace = false;
215
- /**
216
- * @type {number}
217
- * @default null
218
- * @private
219
- */
220
- this._$scaleX = null;
221
- /**
222
- * @type {number}
223
- * @default null
224
- * @private
225
- */
226
- this._$scaleY = null;
227
- /**
228
- * @type {number}
229
- * @default null
230
- * @private
231
- */
232
- this._$rotation = null;
233
- }
234
- /**
235
- * @description 指定されたオブジェクトのアルファ透明度値を示します。
236
- * 有効な値は 0.0(完全な透明)~ 1.0(完全な不透明)です。
237
- * デフォルト値は 1.0 です。alpha が 0.0 に設定されている表示オブジェクトは、
238
- * 表示されない場合でも、アクティブです。
239
- * Indicates the alpha transparency value of the object specified.
240
- * Valid values are 0.0 (fully transparent) to 1.0 (fully opaque).
241
- * The default value is 1.0. Display objects with alpha set to 0.0 are active,
242
- * even though they are invisible.
243
- *
244
- * @member {number}
245
- * @default 1
246
- * @public
247
- */
248
- get alpha() {
249
- const colorTransform = this
250
- ._$transform
251
- ._$rawColorTransform();
252
- return colorTransform[3] + colorTransform[7] / 255;
253
- }
254
- set alpha(alpha) {
255
- alpha = $clamp(alpha, 0, 1, 0);
256
- // clone
257
- const colorTransform = this
258
- ._$transform
259
- .colorTransform;
260
- colorTransform._$colorTransform[3] = alpha;
261
- colorTransform._$colorTransform[7] = 0;
262
- this._$transform.colorTransform = colorTransform;
263
- $poolColorTransform(colorTransform);
264
- }
265
- /**
266
- * @description 使用するブレンドモードを指定する BlendMode クラスの値です。
267
- * A value from the BlendMode class that specifies which blend mode to use.
268
- *
269
- * @member {string}
270
- * @default BlendMode.NORMAL
271
- * @public
272
- */
273
- get blendMode() {
274
- // use cache
275
- if (this._$blendMode) {
276
- return this._$blendMode;
277
- }
278
- const transform = this._$transform;
279
- if (transform._$blendMode) {
280
- // cache
281
- this._$blendMode = transform._$blendMode;
282
- return transform._$blendMode;
283
- }
284
- const placeObject = this._$getPlaceObject();
285
- if (placeObject && placeObject.blendMode) {
286
- // cache
287
- this._$blendMode = placeObject.blendMode;
288
- return placeObject.blendMode;
289
- }
290
- // cache
291
- this._$blendMode = "normal";
292
- return "normal";
293
- }
294
- set blendMode(blend_mode) {
295
- this._$transform._$transform(null, null, null, blend_mode);
296
- this._$blendMode = blend_mode;
297
- }
298
- /**
299
- * @description 表示オブジェクトに現在関連付けられている各フィルターオブジェクトが
300
- * 格納されているインデックス付きの配列です。
301
- * An indexed array that contains each filter object
302
- * currently associated with the display object.
303
- *
304
- * @member {array}
305
- * @default {array}
306
- * @public
307
- */
308
- get filters() {
309
- // use cache
310
- if (this._$filters) {
311
- const filters = $getArray();
312
- for (let idx = 0; idx < this._$filters.length; ++idx) {
313
- filters[idx] = this._$filters[idx].clone();
314
- }
315
- return filters;
316
- }
317
- const transform = this._$transform;
318
- if (transform._$filters) {
319
- const clone = $getArray();
320
- const filters = $getArray();
321
- for (let idx = 0; idx < transform._$filters.length; ++idx) {
322
- const filter = transform._$filters[idx];
323
- clone[idx] = filter.clone();
324
- filters[idx] = filter.clone();
325
- }
326
- // cache
327
- this._$filters = clone;
328
- return filters;
329
- }
330
- const placeObject = this._$getPlaceObject();
331
- if (placeObject && placeObject.surfaceFilterList) {
332
- // create filter
333
- if (!placeObject.filters) {
334
- placeObject.filters = transform
335
- ._$buildFilter(placeObject.surfaceFilterList);
336
- }
337
- const clone = $getArray();
338
- // @ts-ignore
339
- const filters = $getArray();
340
- for (let idx = 0; idx < placeObject.filters.length; ++idx) {
341
- const filter = placeObject.filters[idx];
342
- clone[idx] = filter.clone();
343
- filters[idx] = filter.clone();
344
- }
345
- // cache
346
- this._$filters = clone;
347
- return filters;
348
- }
349
- const filters = $getArray();
350
- // cache
351
- this._$filters = filters;
352
- return filters;
353
- }
354
- set filters(filters) {
355
- if (!filters) {
356
- filters = $getArray();
357
- }
358
- this._$transform._$transform(null, null, filters);
359
- this._$filters = filters;
360
- }
361
- /**
362
- * @description 表示オブジェクトの高さを示します(ピクセル単位)。
363
- * Indicates the height of the display object, in pixels.
364
- *
365
- * @member {number}
366
- * @public
367
- */
368
- get height() {
369
- const baseBounds = "_$getBounds" in this && typeof this._$getBounds === "function"
370
- ? this._$getBounds()
371
- : $getBoundsObject();
372
- const bounds = $boundsMatrix(baseBounds, this._$transform._$rawMatrix());
373
- $poolBoundsObject(baseBounds);
374
- const height = $Math.abs(bounds.yMax - bounds.yMin);
375
- // object pool
376
- $poolBoundsObject(bounds);
377
- switch (height) {
378
- case 0:
379
- case $Infinity:
380
- case -$Infinity:
381
- return 0;
382
- default:
383
- return +height.toFixed(2);
384
- }
385
- }
386
- set height(height) {
387
- height = +height;
388
- if (!$isNaN(height) && height > -1) {
389
- const baseBounds = "_$getBounds" in this && typeof this._$getBounds === "function"
390
- ? this._$getBounds()
391
- : $getBoundsObject();
392
- const rotation = this.rotation;
393
- const bounds = rotation
394
- ? $boundsMatrix(baseBounds, this._$transform._$rawMatrix())
395
- : baseBounds;
396
- if (rotation) {
397
- $poolBoundsObject(baseBounds);
398
- }
399
- const exHeight = $Math.abs(bounds.yMax - bounds.yMin);
400
- $poolBoundsObject(bounds);
401
- switch (exHeight) {
402
- case 0:
403
- case $Infinity:
404
- case -$Infinity:
405
- this.scaleY = 0;
406
- break;
407
- default:
408
- this.scaleY = height / exHeight;
409
- break;
410
- }
411
- }
412
- }
413
- /**
414
- * @description この表示オブジェクトが属するファイルの読み込み情報を含む LoaderInfo オブジェクトを返します。
415
- * Returns a LoaderInfo object containing information
416
- * about loading the file to which this display object belongs.
417
- *
418
- * @member {LoaderInfo}
419
- * @default null
420
- * @readonly
421
- * @public
422
- */
423
- get loaderInfo() {
424
- return this._$loaderInfo;
425
- }
426
- /**
427
- * @description 呼び出し元の表示オブジェクトは、指定された mask オブジェクトによってマスクされます。
428
- * The calling display object is masked by the specified mask object.
429
- *
430
- * @member {DisplayObject|null}
431
- * @public
432
- */
433
- get mask() {
434
- return this._$mask;
435
- }
436
- set mask(mask) {
437
- if (mask === this._$mask) {
438
- return;
439
- }
440
- // reset
441
- if (this._$mask) {
442
- if ($rendererWorker && this._$mask.stage) {
443
- this._$mask._$removeWorkerInstance();
444
- }
445
- this._$mask._$isMask = false;
446
- this._$mask = null;
447
- }
448
- if (mask) {
449
- if ($rendererWorker
450
- && "_$createWorkerInstance" in mask
451
- && typeof mask._$createWorkerInstance === "function") {
452
- mask._$createWorkerInstance();
453
- }
454
- mask._$isMask = true;
455
- this._$mask = mask;
456
- }
457
- this._$doChanged();
458
- }
459
- /**
460
- * @description マウスまたはユーザー入力デバイスの x 軸の位置をピクセルで示します。
461
- * Indicates the x coordinate of the mouse or user input device position, in pixels.
462
- *
463
- * @member {number}
464
- * @default 0
465
- * @readonly
466
- * @public
467
- */
468
- get mouseX() {
469
- return $getEvent()
470
- ? this.globalToLocal($currentMousePoint()).x
471
- : 0;
472
- }
473
- /**
474
- * @description マウスまたはユーザー入力デバイスの y 軸の位置をピクセルで示します。
475
- * Indicates the y coordinate of the mouse or user input device position, in pixels.
476
- *
477
- * @member {number}
478
- * @default 0
479
- * @readonly
480
- * @public
481
- */
482
- get mouseY() {
483
- return $getEvent()
484
- ? this.globalToLocal($currentMousePoint()).y
485
- : 0;
486
- }
487
- /**
488
- * @description DisplayObject のインスタンス名を示します。
489
- * Indicates the instance name of the DisplayObject.
490
- *
491
- * @member {string}
492
- * @public
493
- */
494
- get name() {
495
- if (this._$name) {
496
- return this._$name;
497
- }
498
- return `instance${this._$instanceId}`;
499
- }
500
- set name(name) {
501
- this._$name = `${name}`;
502
- const parent = this._$parent;
503
- if (parent && parent._$names) {
504
- parent._$names.clear();
505
- const children = parent._$getChildren();
506
- for (let idx = 0; idx < children.length; ++idx) {
507
- const child = children[idx];
508
- if (child._$name) {
509
- parent._$names.set(child.name, child);
510
- }
511
- }
512
- }
513
- }
514
- /**
515
- * @description この表示オブジェクトを含む DisplayObjectContainer オブジェクトを示します。
516
- * Indicates the DisplayObjectContainer object that contains this display object.
517
- *
518
- * @member {DisplayObjectContainer | null}
519
- * @readonly
520
- * @public
521
- */
522
- get parent() {
523
- return this._$parent;
524
- }
525
- /**
526
- * @description 読み込まれた SWF ファイル内の表示オブジェクトの場合、
527
- * root プロパティはその SWF ファイルが表す表示リストのツリー構造部分の一番上にある表示オブジェクトとなります。
528
- * For a display object in a loaded SWF file,
529
- * the root property is the top-most display object
530
- * in the portion of the display list's tree structure represented by that SWF file.
531
- *
532
- * @member {DisplayObject|null}
533
- * @readonly
534
- * @public
535
- */
536
- get root() {
537
- return this._$root;
538
- }
539
- /**
540
- * @description DisplayObject インスタンスの元の位置からの回転角を度単位で示します。
541
- * Indicates the rotation of the DisplayObject instance,
542
- * in degrees, from its original orientation.
543
- *
544
- * @member {number}
545
- * @public
546
- */
547
- get rotation() {
548
- if (this._$rotation !== null) {
549
- return this._$rotation;
550
- }
551
- const matrix = this._$transform._$rawMatrix();
552
- return $Math.atan2(matrix[1], matrix[0]) * $Rad2Deg;
553
- }
554
- set rotation(rotation) {
555
- rotation = $clamp(rotation % 360, 0 - 360, 360, 0);
556
- if (this._$rotation === rotation) {
557
- return;
558
- }
559
- const transform = this._$transform;
560
- const matrix = transform.matrix;
561
- const scaleX = $Math.sqrt(matrix.a * matrix.a + matrix.b * matrix.b);
562
- const scaleY = $Math.sqrt(matrix.c * matrix.c + matrix.d * matrix.d);
563
- if (rotation === 0) {
564
- matrix.a = scaleX;
565
- matrix.b = 0;
566
- matrix.c = 0;
567
- matrix.d = scaleY;
568
- }
569
- else {
570
- let radianX = $Math.atan2(matrix.b, matrix.a);
571
- let radianY = $Math.atan2(0 - matrix.c, matrix.d);
572
- const radian = rotation * $Deg2Rad;
573
- radianY = radianY + radian - radianX;
574
- radianX = radian;
575
- matrix.b = scaleX * $Math.sin(radianX);
576
- if (matrix.b === 1 || matrix.b === -1) {
577
- matrix.a = 0;
578
- }
579
- else {
580
- matrix.a = scaleX * $Math.cos(radianX);
581
- }
582
- matrix.c = -scaleY * $Math.sin(radianY);
583
- if (matrix.c === 1 || matrix.c === -1) {
584
- matrix.d = 0;
585
- }
586
- else {
587
- matrix.d = scaleY * $Math.cos(radianY);
588
- }
589
- }
590
- transform.matrix = matrix;
591
- $poolMatrix(matrix);
592
- this._$rotation = rotation;
593
- }
594
- /**
595
- * @description 現在有効な拡大 / 縮小グリッドです。
596
- * The current scaling grid that is in effect.
597
- *
598
- * @member {Rectangle}
599
- * @public
600
- */
601
- get scale9Grid() {
602
- return this._$scale9Grid;
603
- }
604
- set scale9Grid(scale_9_grid) {
605
- if (this._$scale9Grid !== scale_9_grid) {
606
- this._$scale9Grid = scale_9_grid;
607
- this._$doChanged();
608
- $doUpdated();
609
- }
610
- }
611
- /**
612
- * @description 基準点から適用されるオブジェクトの水平スケール(パーセンテージ)を示します。
613
- * Indicates the horizontal scale (percentage)
614
- * of the object as applied from the registration point.
615
- *
616
- * @member {number}
617
- * @public
618
- */
619
- get scaleX() {
620
- if (this._$scaleX !== null) {
621
- return this._$scaleX;
622
- }
623
- const matrix = this._$transform._$rawMatrix();
624
- let xScale = $Math.sqrt(matrix[0] * matrix[0]
625
- + matrix[1] * matrix[1]);
626
- if (!$Number.isInteger(xScale)) {
627
- const value = xScale.toString();
628
- const index = value.indexOf("e");
629
- if (index !== -1) {
630
- xScale = +value.slice(0, index);
631
- }
632
- xScale = +xScale.toFixed(4);
633
- }
634
- return 0 > matrix[0] ? xScale * -1 : xScale;
635
- }
636
- set scaleX(scale_x) {
637
- scale_x = $clamp(+scale_x, $SHORT_INT_MIN, $SHORT_INT_MAX);
638
- if (!$Number.isInteger(scale_x)) {
639
- const value = scale_x.toString();
640
- const index = value.indexOf("e");
641
- if (index !== -1) {
642
- scale_x = +value.slice(0, index);
643
- }
644
- scale_x = +scale_x.toFixed(4);
645
- }
646
- if (this._$scaleX === scale_x) {
647
- return;
648
- }
649
- const transform = this._$transform;
650
- const matrix = transform.matrix;
651
- if (matrix.b === 0 || $isNaN(matrix.b)) {
652
- matrix.a = scale_x;
653
- }
654
- else {
655
- let radianX = $Math.atan2(matrix.b, matrix.a);
656
- if (radianX === -$Math.PI) {
657
- radianX = 0;
658
- }
659
- matrix.b = scale_x * $Math.sin(radianX);
660
- matrix.a = scale_x * $Math.cos(radianX);
661
- }
662
- transform.matrix = matrix;
663
- $poolMatrix(matrix);
664
- this._$scaleX = scale_x;
665
- }
666
- /**
667
- * @description 基準点から適用されるオブジェクトの垂直スケール(パーセンテージ)を示します。
668
- * IIndicates the vertical scale (percentage)
669
- * of an object as applied from the registration point.
670
- *
671
- * @member {number}
672
- * @public
673
- */
674
- get scaleY() {
675
- if (this._$scaleY !== null) {
676
- return this._$scaleY;
677
- }
678
- const matrix = this._$transform._$rawMatrix();
679
- let yScale = $Math.sqrt(matrix[2] * matrix[2]
680
- + matrix[3] * matrix[3]);
681
- if (!$Number.isInteger(yScale)) {
682
- const value = yScale.toString();
683
- const index = value.indexOf("e");
684
- if (index !== -1) {
685
- yScale = +value.slice(0, index);
686
- }
687
- yScale = +yScale.toFixed(4);
688
- }
689
- return 0 > matrix[3] ? yScale * -1 : yScale;
690
- }
691
- set scaleY(scale_y) {
692
- scale_y = $clamp(+scale_y, $SHORT_INT_MIN, $SHORT_INT_MAX);
693
- if (!$Number.isInteger(scale_y)) {
694
- const value = scale_y.toString();
695
- const index = value.indexOf("e");
696
- if (index !== -1) {
697
- scale_y = +value.slice(0, index);
698
- }
699
- scale_y = +scale_y.toFixed(4);
700
- }
701
- if (this._$scaleY === scale_y) {
702
- return;
703
- }
704
- const transform = this._$transform;
705
- const matrix = transform.matrix;
706
- if (matrix.c === 0 || $isNaN(matrix.c)) {
707
- matrix.d = scale_y;
708
- }
709
- else {
710
- let radianY = $Math.atan2(-matrix.c, matrix.d);
711
- if (radianY === -$Math.PI) {
712
- radianY = 0;
713
- }
714
- matrix.c = -scale_y * $Math.sin(radianY);
715
- matrix.d = scale_y * $Math.cos(radianY);
716
- }
717
- transform.matrix = matrix;
718
- $poolMatrix(matrix);
719
- this._$scaleY = scale_y;
720
- }
721
- /**
722
- * @description 表示オブジェクトのステージです。
723
- * The Stage of the display object.
724
- *
725
- * @member {Stage}
726
- * @readonly
727
- * @public
728
- */
729
- get stage() {
730
- if (this._$stage) {
731
- return this._$stage;
732
- }
733
- // find parent
734
- const parent = this._$parent;
735
- if (parent) {
736
- return parent._$stage;
737
- }
738
- return null;
739
- }
740
- /**
741
- * @description 表示オブジェクトのマトリックス、カラー変換、
742
- * ピクセル境界に関係するプロパティを持つオブジェクトです。
743
- * An object with properties pertaining
744
- * to a display object's matrix, color transform, and pixel bounds.
745
- *
746
- * @member {Transform}
747
- * @public
748
- */
749
- get transform() {
750
- return this._$transform;
751
- }
752
- set transform(transform) {
753
- this._$transform = transform;
754
- }
755
- /**
756
- * @description 表示オブジェクトが可視かどうかを示します。
757
- * Whether or not the display object is visible.
758
- *
759
- * @member {boolean}
760
- * @public
761
- */
762
- get visible() {
763
- return this._$visible;
764
- }
765
- set visible(visible) {
766
- if (this._$visible !== visible) {
767
- this._$visible = !!visible;
768
- this._$doChanged();
769
- $doUpdated();
770
- }
771
- }
772
- /**
773
- * @description 表示オブジェクトの幅を示します(ピクセル単位)。
774
- * Indicates the width of the display object, in pixels.
775
- *
776
- * @member {number}
777
- * @public
778
- */
779
- get width() {
780
- const baseBounds = "_$getBounds" in this && typeof this._$getBounds === "function"
781
- ? this._$getBounds()
782
- : $getBoundsObject();
783
- const bounds = $boundsMatrix(baseBounds, this._$transform._$rawMatrix());
784
- $poolBoundsObject(baseBounds);
785
- const width = $Math.abs(bounds.xMax - bounds.xMin);
786
- $poolBoundsObject(bounds);
787
- switch (true) {
788
- case width === 0:
789
- case width === $Infinity:
790
- case width === 0 - $Infinity:
791
- return 0;
792
- default:
793
- return +width.toFixed(2);
794
- }
795
- }
796
- set width(width) {
797
- width = +width;
798
- if (!$isNaN(width) && width > -1) {
799
- const baseBounds = "_$getBounds" in this && typeof this._$getBounds === "function"
800
- ? this._$getBounds()
801
- : $getBoundsObject();
802
- const rotation = this.rotation;
803
- const bounds = rotation
804
- ? $boundsMatrix(baseBounds, this._$transform._$rawMatrix())
805
- : baseBounds;
806
- if (rotation) {
807
- $poolBoundsObject(baseBounds);
808
- }
809
- const exWidth = $Math.abs(bounds.xMax - bounds.xMin);
810
- $poolBoundsObject(bounds);
811
- switch (true) {
812
- case exWidth === 0:
813
- case exWidth === $Infinity:
814
- case exWidth === -$Infinity:
815
- this.scaleX = 0;
816
- break;
817
- default:
818
- this.scaleX = width / exWidth;
819
- break;
820
- }
821
- }
822
- }
823
- /**
824
- * @description 親 DisplayObjectContainer のローカル座標を基準にした
825
- * DisplayObject インスタンスの x 座標を示します。
826
- * Indicates the x coordinate
827
- * of the DisplayObject instance relative to the local coordinates
828
- * of the parent DisplayObjectContainer.
829
- *
830
- * @member {number}
831
- * @public
832
- */
833
- get x() {
834
- return this._$transform._$rawMatrix()[4];
835
- }
836
- set x(x) {
837
- const transform = this._$transform;
838
- const matrix = transform.matrix;
839
- matrix.tx = x;
840
- transform.matrix = matrix;
841
- $poolMatrix(matrix);
842
- }
843
- /**
844
- * @description 親 DisplayObjectContainer のローカル座標を基準にした
845
- * DisplayObject インスタンスの y 座標を示します。
846
- * Indicates the y coordinate
847
- * of the DisplayObject instance relative to the local coordinates
848
- * of the parent DisplayObjectContainer.
849
- *
850
- * @member {number}
851
- * @public
852
- */
853
- get y() {
854
- return this._$transform._$rawMatrix()[5];
855
- }
856
- set y(y) {
857
- const transform = this._$transform;
858
- const matrix = transform.matrix;
859
- matrix.ty = y;
860
- transform.matrix = matrix;
861
- $poolMatrix(matrix);
862
- }
863
- /**
864
- * @description targetCoordinateSpace オブジェクトの座標系を基準にして、
865
- * 表示オブジェクトの領域を定義する矩形を返します。
866
- * Returns a rectangle that defines the area
867
- * of the display object relative to the coordinate system
868
- * of the targetCoordinateSpace object.
869
- *
870
- * @param {DisplayObject} [target=null]
871
- * @return {Rectangle}
872
- */
873
- getBounds(target = null) {
874
- const baseBounds = "_$getBounds" in this && typeof this._$getBounds === "function"
875
- ? this._$getBounds()
876
- : $getBoundsObject();
877
- const matrix = this._$transform.concatenatedMatrix;
878
- // to global
879
- const bounds = $boundsMatrix(baseBounds, matrix._$matrix);
880
- // pool
881
- $poolMatrix(matrix);
882
- $poolBoundsObject(baseBounds);
883
- // create bounds object
884
- const targetBaseBounds = $getBoundsObject(bounds.xMin, bounds.xMax, bounds.yMin, bounds.yMax);
885
- // pool
886
- $poolBoundsObject(bounds);
887
- if (!target) {
888
- target = this;
889
- }
890
- const targetMatrix = target._$transform.concatenatedMatrix;
891
- targetMatrix.invert();
892
- const resultBounds = $boundsMatrix(targetBaseBounds, targetMatrix._$matrix);
893
- $poolBoundsObject(targetBaseBounds);
894
- $poolMatrix(targetMatrix);
895
- const xMin = resultBounds.xMin;
896
- const yMin = resultBounds.yMin;
897
- const xMax = resultBounds.xMax;
898
- const yMax = resultBounds.yMax;
899
- // pool
900
- $poolBoundsObject(resultBounds);
901
- return new Rectangle(xMin, yMin, $Math.abs(xMax - xMin), $Math.abs(yMax - yMin));
902
- }
903
- /**
904
- * @description point オブジェクトをステージ(グローバル)座標から
905
- * 表示オブジェクトの(ローカル)座標に変換します。
906
- * Converts the point object from the Stage (global) coordinates
907
- * to the display object's (local) coordinates.
908
- *
909
- * @param {Point} point
910
- * @return {Point}
911
- * @public
912
- */
913
- globalToLocal(point) {
914
- const matrix = this._$transform.concatenatedMatrix;
915
- matrix.invert();
916
- const newPoint = new Point(point.x * matrix.a + point.y * matrix.c + matrix.tx, point.x * matrix.b + point.y * matrix.d + matrix.ty);
917
- $poolMatrix(matrix);
918
- return newPoint;
919
- }
920
- /**
921
- * @description 表示オブジェクトの境界ボックスを評価して、
922
- * obj 表示オブジェクトの境界ボックスと重複または交差するかどうかを調べます。
923
- * Evaluates the bounding box of the display object to see
924
- * if it overlaps or intersects with the bounding box of the obj display object.
925
- *
926
- * @param {DisplayObject} object
927
- * @returns {boolean}
928
- * @public
929
- */
930
- hitTestObject(object) {
931
- const baseBounds1 = "_$getBounds" in this && typeof this._$getBounds === "function"
932
- ? this._$getBounds()
933
- : $getBoundsObject();
934
- const matrix1 = this._$transform.concatenatedMatrix;
935
- const bounds1 = $boundsMatrix(baseBounds1, matrix1._$matrix);
936
- // pool
937
- $poolMatrix(matrix1);
938
- $poolBoundsObject(baseBounds1);
939
- const baseBounds2 = object._$getBounds(null);
940
- const matrix2 = object._$transform.concatenatedMatrix;
941
- const bounds2 = $boundsMatrix(baseBounds2, matrix2._$matrix);
942
- // pool
943
- $poolMatrix(matrix2);
944
- $poolBoundsObject(baseBounds2);
945
- // calc
946
- const sx = $Math.max(bounds1.xMin, bounds2.xMin);
947
- const sy = $Math.max(bounds1.yMin, bounds2.yMin);
948
- const ex = $Math.min(bounds1.xMax, bounds2.xMax);
949
- const ey = $Math.min(bounds1.yMax, bounds2.yMax);
950
- // pool
951
- $poolBoundsObject(bounds1);
952
- $poolBoundsObject(bounds2);
953
- return ex - sx >= 0 && ey - sy >= 0;
954
- }
955
- /**
956
- * @description 表示オブジェクトを評価して、x および y パラメーターで指定された
957
- * ポイントと重複または交差するかどうかを調べます。
958
- * Evaluates the display object to see if it overlaps
959
- * or intersects with the point specified by the x and y parameters.
960
- *
961
- * @param {number} x
962
- * @param {number} y
963
- * @param {boolean} [shape_flag=false]
964
- * @returns {boolean}
965
- * @public
966
- */
967
- hitTestPoint(x, y, shape_flag = false) {
968
- if (shape_flag) {
969
- let matrix = $MATRIX_ARRAY_IDENTITY;
970
- let parent = this._$parent;
971
- while (parent) {
972
- matrix = $multiplicationMatrix(parent._$transform._$rawMatrix(), matrix);
973
- parent = parent._$parent;
974
- }
975
- $hitContext.setTransform(1, 0, 0, 1, 0, 0);
976
- $hitContext.beginPath();
977
- let result = false;
978
- if ("_$hit" in this && typeof this._$hit === "function") {
979
- result = this._$hit($hitContext, matrix, { "x": x, "y": y }, true);
980
- }
981
- if (matrix !== $MATRIX_ARRAY_IDENTITY) {
982
- $poolFloat32Array6(matrix);
983
- }
984
- return result;
985
- }
986
- const baseBounds = "_$getBounds" in this && typeof this._$getBounds === "function"
987
- ? this._$getBounds()
988
- : $getBoundsObject();
989
- const bounds = $boundsMatrix(baseBounds, this._$transform._$rawMatrix());
990
- $poolBoundsObject(baseBounds);
991
- const rectangle = new Rectangle(bounds.xMin, bounds.yMin, bounds.xMax - bounds.xMin, bounds.yMax - bounds.yMin);
992
- // pool
993
- $poolBoundsObject(bounds);
994
- const point = this._$parent
995
- ? this._$parent.globalToLocal(new Point(x, y))
996
- : new Point(x, y);
997
- return rectangle.containsPoint(point);
998
- }
999
- /**
1000
- * @description point オブジェクトを表示オブジェクトの(ローカル)座標から
1001
- * ステージ(グローバル)座標に変換します。
1002
- * Converts the point object from the display object's (local) coordinates
1003
- * to the Stage (global) coordinates.
1004
- *
1005
- *
1006
- * @param {Point} point
1007
- * @returns {Point}
1008
- * @public
1009
- */
1010
- localToGlobal(point) {
1011
- const matrix = this
1012
- ._$transform
1013
- .concatenatedMatrix;
1014
- const newPoint = new Point(point.x * matrix.a + point.y * matrix.c + matrix.tx, point.x * matrix.b + point.y * matrix.d + matrix.ty);
1015
- $poolMatrix(matrix);
1016
- return newPoint;
1017
- }
1018
- /**
1019
- * @description クラスのローカル変数空間から値を取得
1020
- * Get a value from the local variable space of the class
1021
- *
1022
- * @param {*} key
1023
- * @return {*}
1024
- * @method
1025
- * @public
1026
- */
1027
- getLocalVariable(key) {
1028
- if (!this._$variables) {
1029
- return null;
1030
- }
1031
- if (this._$variables.has(key)) {
1032
- return this._$variables.get(key);
1033
- }
1034
- }
1035
- /**
1036
- * @description クラスのローカル変数空間へ値を保存
1037
- * Store values in the local variable space of the class
1038
- *
1039
- * @param {*} key
1040
- * @param {*} value
1041
- * @return {void}
1042
- * @method
1043
- * @public
1044
- */
1045
- setLocalVariable(key, value) {
1046
- if (!this._$variables) {
1047
- this._$variables = $getMap();
1048
- }
1049
- this._$variables.set(key, value);
1050
- }
1051
- /**
1052
- * @description クラスのローカル変数空間に値があるかどうかを判断します。
1053
- * Determines if there is a value in the local variable space of the class.
1054
- *
1055
- * @param {*} key
1056
- * @return {boolean}
1057
- * @method
1058
- * @public
1059
- */
1060
- hasLocalVariable(key) {
1061
- return this._$variables
1062
- ? this._$variables.has(key)
1063
- : false;
1064
- }
1065
- /**
1066
- * @description クラスのローカル変数空間の値を削除
1067
- * Remove values from the local variable space of a class
1068
- *
1069
- * @param {*} key
1070
- * @return {void}
1071
- * @method
1072
- * @public
1073
- */
1074
- deleteLocalVariable(key) {
1075
- if (this._$variables && this._$variables.has(key)) {
1076
- this._$variables.delete(key);
1077
- if (!this._$variables.size) {
1078
- $poolMap(this._$variables);
1079
- this._$variables = null;
1080
- }
1081
- }
1082
- }
1083
- /**
1084
- * @description グローバル変数空間から値を取得
1085
- * Get a value from the global variable space
1086
- *
1087
- * @param {*} key
1088
- * @return {*}
1089
- * @method
1090
- * @public
1091
- */
1092
- getGlobalVariable(key) {
1093
- if ($variables.has(key)) {
1094
- return $variables.get(key);
1095
- }
1096
- return null;
1097
- }
1098
- /**
1099
- * @description グローバル変数空間へ値を保存
1100
- * Save values to global variable space
1101
- *
1102
- * @param {*} key
1103
- * @param {*} value
1104
- * @return {void}
1105
- * @method
1106
- * @public
1107
- */
1108
- setGlobalVariable(key, value) {
1109
- $variables.set(key, value);
1110
- }
1111
- /**
1112
- * @description グローバル変数空間に値があるかどうかを判断します。
1113
- * Determines if there is a value in the global variable space.
1114
- *
1115
- * @param {*} key
1116
- * @return {boolean}
1117
- * @method
1118
- * @public
1119
- */
1120
- hasGlobalVariable(key) {
1121
- return $variables.has(key);
1122
- }
1123
- /**
1124
- * @description グローバル変数空間の値を削除
1125
- * Remove values from global variable space.
1126
- *
1127
- * @param {*} key
1128
- * @return {void}
1129
- * @method
1130
- * @public
1131
- */
1132
- deleteGlobalVariable(key) {
1133
- if ($variables.has(key)) {
1134
- $variables.delete(key);
1135
- }
1136
- }
1137
- /**
1138
- * @description グローバル変数空間に値を全てクリアします。
1139
- * Clear all values in the global variable space.
1140
- *
1141
- * @return {void}
1142
- * @method
1143
- * @public
1144
- */
1145
- clearGlobalVariable() {
1146
- return $variables.clear();
1147
- }
1148
- /**
1149
- * @return {object}
1150
- * @method
1151
- * @private
1152
- */
1153
- _$getPlaceObject() {
1154
- if (!this._$placeObject) {
1155
- const placeId = this._$placeId;
1156
- if (placeId === -1) {
1157
- return null;
1158
- }
1159
- const parent = this._$parent;
1160
- if (!parent || !parent._$placeObjects) {
1161
- return null;
1162
- }
1163
- const placeMap = parent._$placeMap;
1164
- if (!placeMap || !placeMap.length) {
1165
- return null;
1166
- }
1167
- const frame = "currentFrame" in parent ? parent.currentFrame : 1;
1168
- const places = placeMap[frame];
1169
- if (!places) {
1170
- return null;
1171
- }
1172
- const currentPlaceId = places[placeId] | 0;
1173
- const placeObject = parent._$placeObjects[currentPlaceId];
1174
- if (!placeObject) {
1175
- return null;
1176
- }
1177
- this._$changePlace = currentPlaceId !== this._$currentPlaceId;
1178
- this._$currentPlaceId = currentPlaceId;
1179
- this._$placeObject = placeObject;
1180
- return placeObject;
1181
- }
1182
- return this._$placeObject;
1183
- }
1184
- /**
1185
- * @param {object} tag
1186
- * @param {DisplayObjectContainer} parent
1187
- * @return {object}
1188
- * @method
1189
- * @private
1190
- */
1191
- _$baseBuild(tag, parent) {
1192
- const loaderInfo = parent._$loaderInfo;
1193
- if (!loaderInfo || !loaderInfo._$data) {
1194
- throw new Error("the loaderInfo or data is nul.");
1195
- }
1196
- // setup
1197
- this._$parent = parent;
1198
- this._$root = parent._$root;
1199
- this._$stage = parent._$stage;
1200
- this._$loaderInfo = loaderInfo;
1201
- // bind tag data
1202
- this._$characterId = tag.characterId | 0;
1203
- this._$clipDepth = tag.clipDepth | 0;
1204
- this._$startFrame = tag.startFrame | 0;
1205
- this._$endFrame = tag.endFrame | 0;
1206
- this._$name = tag.name || "";
1207
- return loaderInfo._$data.characters[tag.characterId];
1208
- }
1209
- /**
1210
- * @return {boolean}
1211
- * @method
1212
- * @private
1213
- */
1214
- _$isUpdated() {
1215
- return this._$updated;
1216
- }
1217
- /**
1218
- * @return {void}
1219
- * @method
1220
- * @private
1221
- */
1222
- _$updateState() {
1223
- this._$isNext = true;
1224
- const parent = this._$parent;
1225
- if (parent) {
1226
- parent._$updateState();
1227
- }
1228
- }
1229
- /**
1230
- * @return {void}
1231
- * @method
1232
- * @private
1233
- */
1234
- _$doChanged() {
1235
- this._$posted = false;
1236
- this._$isNext = true;
1237
- this._$updated = true;
1238
- const parent = this._$parent;
1239
- if (parent) {
1240
- if (!parent._$updated) {
1241
- parent._$doChanged();
1242
- }
1243
- }
1244
- }
1245
- /**
1246
- * @param {CanvasToWebGLContext} context
1247
- * @param {WebGLTexture} target_texture
1248
- * @param {Float32Array} matrix
1249
- * @param {array} filters
1250
- * @param {number} width
1251
- * @param {number} height
1252
- * @return {WebGLTexture}
1253
- * @method
1254
- * @private
1255
- */
1256
- _$drawFilter(context, target_texture, matrix, filters, width, height) {
1257
- const player = $currentPlayer();
1258
- const cacheStore = player.cacheStore;
1259
- const cacheKeys = [this._$instanceId, "f"];
1260
- const cache = cacheStore.get(cacheKeys);
1261
- const updated = this._$isFilterUpdated(width, height, matrix, filters, true);
1262
- if (cache && !updated) {
1263
- return cache;
1264
- }
1265
- // cache clear
1266
- if (cache) {
1267
- cacheStore.set(cacheKeys, null);
1268
- cache.layerWidth = 0;
1269
- cache.layerHeight = 0;
1270
- cache._$offsetX = 0;
1271
- cache._$offsetY = 0;
1272
- cache.matrix = null;
1273
- cache.colorTransform = null;
1274
- context
1275
- .frameBuffer
1276
- .releaseTexture(cache);
1277
- }
1278
- if (!cache || updated) {
1279
- const texture = this._$applyFilter(context, filters, target_texture, matrix, width, height);
1280
- cacheStore.set(cacheKeys, texture);
1281
- return texture;
1282
- }
1283
- return cache;
1284
- }
1285
- /**
1286
- * @param {array} [matrix=null]
1287
- * @returns {object}
1288
- * @private
1289
- */
1290
- _$getLayerBounds(matrix = null) {
1291
- const baseBounds = "_$getBounds" in this && typeof this._$getBounds === "function"
1292
- ? this._$getBounds(matrix)
1293
- : $getBoundsObject();
1294
- if (!matrix) {
1295
- return baseBounds;
1296
- }
1297
- const filters = this._$filters || this.filters;
1298
- if (!filters.length) {
1299
- return baseBounds;
1300
- }
1301
- let rect = new Rectangle(baseBounds.xMin, baseBounds.yMin, baseBounds.xMax - baseBounds.xMin, baseBounds.yMax - baseBounds.yMin);
1302
- $poolBoundsObject(baseBounds);
1303
- for (let idx = 0; idx < filters.length; ++idx) {
1304
- rect = filters[idx]
1305
- ._$generateFilterRect(rect, 0, 0);
1306
- }
1307
- return $getBoundsObject(rect.x, rect.x + rect.width, rect.y, rect.y + rect.height);
1308
- }
1309
- /**
1310
- * @return {void}
1311
- * @method
1312
- * @private
1313
- */
1314
- _$executeAddedEvent() {
1315
- if (!this._$parent) {
1316
- return;
1317
- }
1318
- // add event
1319
- if (!this._$added) {
1320
- // added event
1321
- if (this.willTrigger(Next2DEvent.ADDED)) {
1322
- this.dispatchEvent(new Next2DEvent(Next2DEvent.ADDED, true));
1323
- }
1324
- // update
1325
- this._$added = true;
1326
- }
1327
- if (!this._$addedStage && this._$stage !== null) {
1328
- if (this.willTrigger(Next2DEvent.ADDED_TO_STAGE)) {
1329
- this.dispatchEvent(new Next2DEvent(Next2DEvent.ADDED_TO_STAGE));
1330
- }
1331
- // update
1332
- this._$addedStage = true;
1333
- }
1334
- }
1335
- /**
1336
- * @return {void}
1337
- * @method
1338
- * @private
1339
- */
1340
- _$prepareActions() {
1341
- this._$nextFrame();
1342
- }
1343
- /**
1344
- * @return {boolean}
1345
- * @method
1346
- * @private
1347
- */
1348
- _$nextFrame() {
1349
- // added event
1350
- this._$executeAddedEvent();
1351
- this._$isNext = false;
1352
- if (!this._$posted && $rendererWorker) {
1353
- // @ts-ignore
1354
- this._$postProperty();
1355
- }
1356
- return false;
1357
- }
1358
- /**
1359
- * @param {array} [filters=null]
1360
- * @return {boolean}
1361
- * @private
1362
- */
1363
- _$canApply(filters = null) {
1364
- if (filters) {
1365
- for (let idx = 0; idx < filters.length; ++idx) {
1366
- if (filters[idx]._$canApply()) {
1367
- return true;
1368
- }
1369
- }
1370
- }
1371
- return false;
1372
- }
1373
- /**
1374
- * @param {number} width
1375
- * @param {number} height
1376
- * @param {Float32Array} matrix
1377
- * @param {array} [filters=null]
1378
- * @param {boolean} [can_apply=false]
1379
- * @param {number} [position_x=0]
1380
- * @param {number} [position_y=0]
1381
- * @return {boolean}
1382
- * @private
1383
- */
1384
- _$isFilterUpdated(width, height, matrix, filters = null, can_apply = false, position_x = 0, position_y = 0) {
1385
- // cache flag
1386
- if (this._$isUpdated()) {
1387
- return true;
1388
- }
1389
- // check filter data
1390
- if (can_apply && filters) {
1391
- for (let idx = 0; idx < filters.length; ++idx) {
1392
- if (!filters[idx]._$isUpdated()) {
1393
- continue;
1394
- }
1395
- return true;
1396
- }
1397
- }
1398
- // check status
1399
- const player = $currentPlayer();
1400
- const cache = player.cacheStore.get([this._$instanceId, "f"]);
1401
- switch (true) {
1402
- case cache === null:
1403
- case cache.filterState !== can_apply:
1404
- case cache.layerWidth !== $Math.ceil(width):
1405
- case cache.layerHeight !== $Math.ceil(height):
1406
- case cache.matrix !==
1407
- matrix[0] + "_" + matrix[1] + "_" + matrix[2] + "_" + matrix[3] + "_" +
1408
- position_x + "_" + position_y:
1409
- return true;
1410
- default:
1411
- break;
1412
- }
1413
- return false;
1414
- }
1415
- /**
1416
- * @param {CanvasToWebGLContext} context
1417
- * @param {array} filters
1418
- * @param {WebGLTexture} target_texture
1419
- * @param {Float32Array} matrix
1420
- * @param {number} width
1421
- * @param {number} height
1422
- * @return {WebGLTexture}
1423
- * @private
1424
- */
1425
- _$applyFilter(context, filters, target_texture, matrix, width, height) {
1426
- const xScale = +$Math.sqrt(matrix[0] * matrix[0]
1427
- + matrix[1] * matrix[1]);
1428
- const yScale = +$Math.sqrt(matrix[2] * matrix[2]
1429
- + matrix[3] * matrix[3]);
1430
- const radianX = $Math.atan2(matrix[1], matrix[0]);
1431
- const radianY = $Math.atan2(-matrix[2], matrix[3]);
1432
- const parentMatrix = $getFloat32Array6($Math.cos(radianX), $Math.sin(radianX), -$Math.sin(radianY), $Math.cos(radianY), width / 2, height / 2);
1433
- const baseMatrix = $getFloat32Array6(1, 0, 0, 1, -target_texture.width / 2, -target_texture.height / 2);
1434
- const multiMatrix = $multiplicationMatrix(parentMatrix, baseMatrix);
1435
- $poolFloat32Array6(parentMatrix);
1436
- $poolFloat32Array6(baseMatrix);
1437
- const manager = context.frameBuffer;
1438
- const currentAttachment = manager.currentAttachment;
1439
- const attachment = manager
1440
- .createCacheAttachment(width, height);
1441
- context._$bind(attachment);
1442
- context.reset();
1443
- context.setTransform(multiMatrix[0], multiMatrix[1], multiMatrix[2], multiMatrix[3], multiMatrix[4], multiMatrix[5]);
1444
- $poolFloat32Array6(multiMatrix);
1445
- context.drawImage(target_texture, 0, 0, target_texture.width, target_texture.height);
1446
- // init
1447
- context._$offsetX = 0;
1448
- context._$offsetY = 0;
1449
- const filterMatrix = $getFloat32Array6(xScale, 0, 0, yScale, 0, 0);
1450
- let texture = null;
1451
- for (let idx = 0; idx < filters.length; ++idx) {
1452
- texture = filters[idx]._$applyFilter(context, filterMatrix);
1453
- }
1454
- $poolFloat32Array6(filterMatrix);
1455
- if (!texture) {
1456
- return target_texture;
1457
- }
1458
- const offsetX = context._$offsetX;
1459
- const offsetY = context._$offsetY;
1460
- // reset
1461
- context._$offsetX = 0;
1462
- context._$offsetY = 0;
1463
- // set offset
1464
- texture._$offsetX = offsetX;
1465
- texture._$offsetY = offsetY;
1466
- // cache texture
1467
- texture.matrix =
1468
- matrix[0] + "_" + matrix[1] + "_"
1469
- + matrix[2] + "_" + matrix[3];
1470
- texture.filterState = true;
1471
- texture.layerWidth = width;
1472
- texture.layerHeight = height;
1473
- context._$bind(currentAttachment);
1474
- manager.releaseAttachment(attachment, false);
1475
- return texture;
1476
- }
1477
- /**
1478
- * @param {Float32Array} matrix
1479
- * @return {boolean}
1480
- * @method
1481
- * @private
1482
- */
1483
- _$shouldClip(matrix) {
1484
- const bounds = "_$getBounds" in this && typeof this._$getBounds === "function"
1485
- ? this._$getBounds(matrix)
1486
- : $getBoundsObject();
1487
- const width = $Math.abs(bounds.xMax - bounds.xMin);
1488
- const height = $Math.abs(bounds.yMax - bounds.yMin);
1489
- $poolBoundsObject(bounds);
1490
- // size 0
1491
- return !(!width || !height);
1492
- }
1493
- /**
1494
- * @param {CanvasToWebGLContext} context
1495
- * @param {Float32Array} matrix
1496
- * @return {Float32Array|boolean|null}
1497
- * @method
1498
- * @private
1499
- */
1500
- _$startClip(context, matrix) {
1501
- let clipMatrix = null;
1502
- // ネストしてない初回のマスクだけ実行
1503
- // ネストしてる場合は初回に作られたbufferを流用
1504
- if (!context.cacheAttachment) {
1505
- let multiMatrix = matrix;
1506
- const rawMatrix = this._$transform._$rawMatrix();
1507
- if (rawMatrix[0] !== 1 || rawMatrix[1] !== 0
1508
- || rawMatrix[2] !== 0 || rawMatrix[3] !== 1
1509
- || rawMatrix[4] !== 0 || rawMatrix[5] !== 0) {
1510
- multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
1511
- }
1512
- const baseBounds = "_$getBounds" in this && typeof this._$getBounds === "function"
1513
- ? this._$getBounds()
1514
- : $getBoundsObject();
1515
- const bounds = $boundsMatrix(baseBounds, multiMatrix);
1516
- $poolBoundsObject(baseBounds);
1517
- clipMatrix = context._$startClip(matrix, bounds);
1518
- $poolBoundsObject(bounds);
1519
- if (multiMatrix !== matrix) {
1520
- $poolFloat32Array6(multiMatrix);
1521
- }
1522
- if (!clipMatrix) {
1523
- return false;
1524
- }
1525
- }
1526
- // start clip
1527
- context._$enterClip();
1528
- // mask start
1529
- context._$beginClipDef();
1530
- let containerClip = false;
1531
- if ("_$children" in this) {
1532
- containerClip = true;
1533
- context._$updateContainerClipFlag(true);
1534
- }
1535
- // @ts-ignore
1536
- this._$clip(context, clipMatrix || matrix);
1537
- this._$updated = false;
1538
- // container clip
1539
- if (containerClip) {
1540
- // update flag
1541
- context._$updateContainerClipFlag(false);
1542
- // execute clip
1543
- context._$drawContainerClip();
1544
- }
1545
- // mask end
1546
- context._$endClipDef();
1547
- return clipMatrix;
1548
- }
1549
- /**
1550
- * @return {void}
1551
- * @method
1552
- * @private
1553
- */
1554
- _$removeWorkerInstance() {
1555
- if ($rendererWorker) {
1556
- $rendererWorker.postMessage({
1557
- "command": "remove",
1558
- "instanceId": this._$instanceId
1559
- });
1560
- }
1561
- }
1562
- /**
1563
- * @return {object}
1564
- * @method
1565
- * @private
1566
- */
1567
- _$createMessage() {
1568
- const message = {
1569
- "command": "setProperty",
1570
- "instanceId": this._$instanceId,
1571
- "parentId": this._$parent ? this._$parent._$instanceId : -1,
1572
- "visible": this._$visible
1573
- };
1574
- if (this._$placeId > -1) {
1575
- message.depth = this._$placeId;
1576
- }
1577
- if (this._$clipDepth) {
1578
- message.clipDepth = this._$clipDepth;
1579
- }
1580
- if (this._$isMask) {
1581
- message.isMask = this._$isMask;
1582
- }
1583
- const mask = this._$mask;
1584
- if (mask) {
1585
- message.maskId = mask._$instanceId;
1586
- let maskMatrix = $MATRIX_ARRAY_IDENTITY;
1587
- let parent = mask._$parent;
1588
- while (parent) {
1589
- maskMatrix = $multiplicationMatrix(parent._$transform._$rawMatrix(), maskMatrix);
1590
- parent = parent._$parent;
1591
- }
1592
- message.maskMatrix = maskMatrix;
1593
- }
1594
- if (this._$visible) {
1595
- const transform = this._$transform;
1596
- const matrix = transform._$rawMatrix();
1597
- if (matrix[0] !== 1) {
1598
- message.a = matrix[0];
1599
- }
1600
- if (matrix[1] !== 0) {
1601
- message.b = matrix[1];
1602
- }
1603
- if (matrix[2] !== 0) {
1604
- message.c = matrix[2];
1605
- }
1606
- if (matrix[3] !== 1) {
1607
- message.d = matrix[3];
1608
- }
1609
- if (matrix[4] !== 0) {
1610
- message.tx = matrix[4];
1611
- }
1612
- if (matrix[5] !== 0) {
1613
- message.ty = matrix[5];
1614
- }
1615
- const colorTransform = transform._$rawColorTransform();
1616
- if (colorTransform[0] !== 1) {
1617
- message.f0 = colorTransform[0];
1618
- }
1619
- if (colorTransform[1] !== 1) {
1620
- message.f1 = colorTransform[1];
1621
- }
1622
- if (colorTransform[2] !== 1) {
1623
- message.f2 = colorTransform[2];
1624
- }
1625
- if (colorTransform[3] !== 1) {
1626
- message.f3 = colorTransform[3];
1627
- }
1628
- if (colorTransform[4] !== 0) {
1629
- message.f4 = colorTransform[4];
1630
- }
1631
- if (colorTransform[5] !== 0) {
1632
- message.f5 = colorTransform[5];
1633
- }
1634
- if (colorTransform[6] !== 0) {
1635
- message.f6 = colorTransform[6];
1636
- }
1637
- if (colorTransform[7] !== 0) {
1638
- message.f7 = colorTransform[7];
1639
- }
1640
- const filters = this._$filters || this.filters;
1641
- if (filters && filters.length) {
1642
- const parameters = $getArray();
1643
- for (let idx = 0; idx < filters.length; ++idx) {
1644
- parameters.push(filters[idx]._$toArray());
1645
- }
1646
- message.filters = parameters;
1647
- }
1648
- const blendMode = this._$blendMode || this.blendMode;
1649
- if (blendMode !== "normal") {
1650
- message.blendMode = blendMode;
1651
- }
1652
- const scale9Grid = this._$scale9Grid;
1653
- if (scale9Grid && this._$isUpdated()) {
1654
- const baseMatrix = this
1655
- ._$parent
1656
- ._$transform
1657
- .concatenatedMatrix;
1658
- message.matrixBase = baseMatrix._$matrix.slice();
1659
- $poolMatrix(baseMatrix);
1660
- message.grid = {
1661
- "x": scale9Grid.x,
1662
- "y": scale9Grid.y,
1663
- "w": scale9Grid.width,
1664
- "h": scale9Grid.height
1665
- };
1666
- }
1667
- }
1668
- return message;
1669
- }
1670
- }