@next2d/player 1.14.18 → 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.
Files changed (387) hide show
  1. package/{dist/player/index.js → index.js} +3 -3
  2. package/package.json +31 -12
  3. package/dist/interface/AjaxEventImpl.d.ts +0 -5
  4. package/dist/interface/AjaxEventImpl.js +0 -1
  5. package/dist/interface/AjaxOptionImpl.d.ts +0 -13
  6. package/dist/interface/AjaxOptionImpl.js +0 -1
  7. package/dist/interface/AttachmentImpl.d.ts +0 -11
  8. package/dist/interface/AttachmentImpl.js +0 -1
  9. package/dist/interface/BitmapDataChannelImpl.d.ts +0 -1
  10. package/dist/interface/BitmapDataChannelImpl.js +0 -1
  11. package/dist/interface/BitmapDrawObjectImpl.d.ts +0 -6
  12. package/dist/interface/BitmapDrawObjectImpl.js +0 -1
  13. package/dist/interface/BitmapFilterTypeImpl.d.ts +0 -1
  14. package/dist/interface/BitmapFilterTypeImpl.js +0 -1
  15. package/dist/interface/BlendModeImpl.d.ts +0 -1
  16. package/dist/interface/BlendModeImpl.js +0 -1
  17. package/dist/interface/BoundsImpl.d.ts +0 -6
  18. package/dist/interface/BoundsImpl.js +0 -1
  19. package/dist/interface/Character.d.ts +0 -2
  20. package/dist/interface/Character.js +0 -1
  21. package/dist/interface/CharacterImpl.d.ts +0 -2
  22. package/dist/interface/CharacterImpl.js +0 -1
  23. package/dist/interface/ClipObjectImpl.d.ts +0 -14
  24. package/dist/interface/ClipObjectImpl.js +0 -1
  25. package/dist/interface/ColorStopImpl.d.ts +0 -7
  26. package/dist/interface/ColorStopImpl.js +0 -1
  27. package/dist/interface/DictionaryTagImpl.d.ts +0 -7
  28. package/dist/interface/DictionaryTagImpl.js +0 -1
  29. package/dist/interface/DisplacementMapFilterModeImpl.d.ts +0 -1
  30. package/dist/interface/DisplacementMapFilterModeImpl.js +0 -1
  31. package/dist/interface/DisplayImpl.d.ts +0 -28
  32. package/dist/interface/DisplayImpl.js +0 -1
  33. package/dist/interface/DisplayObjectImpl.d.ts +0 -2
  34. package/dist/interface/DisplayObjectImpl.js +0 -1
  35. package/dist/interface/DragRulesImpl.d.ts +0 -7
  36. package/dist/interface/DragRulesImpl.js +0 -1
  37. package/dist/interface/DropTargetImpl.d.ts +0 -2
  38. package/dist/interface/DropTargetImpl.js +0 -1
  39. package/dist/interface/EventDispatcherImpl.d.ts +0 -2
  40. package/dist/interface/EventDispatcherImpl.js +0 -1
  41. package/dist/interface/EventListenerImpl.d.ts +0 -6
  42. package/dist/interface/EventListenerImpl.js +0 -1
  43. package/dist/interface/EventsImpl.d.ts +0 -20
  44. package/dist/interface/EventsImpl.js +0 -1
  45. package/dist/interface/FillMeshImpl.d.ts +0 -5
  46. package/dist/interface/FillMeshImpl.js +0 -1
  47. package/dist/interface/FilterArrayImpl.d.ts +0 -10
  48. package/dist/interface/FilterArrayImpl.js +0 -1
  49. package/dist/interface/FilterQualityImpl.d.ts +0 -1
  50. package/dist/interface/FilterQualityImpl.js +0 -1
  51. package/dist/interface/FiltersImpl.d.ts +0 -20
  52. package/dist/interface/FiltersImpl.js +0 -1
  53. package/dist/interface/GeomImpl.d.ts +0 -12
  54. package/dist/interface/GeomImpl.js +0 -1
  55. package/dist/interface/GradientTypeImpl.d.ts +0 -3
  56. package/dist/interface/GradientTypeImpl.js +0 -1
  57. package/dist/interface/GraphicsParentImpl.d.ts +0 -2
  58. package/dist/interface/GraphicsParentImpl.js +0 -1
  59. package/dist/interface/GridImpl.d.ts +0 -6
  60. package/dist/interface/GridImpl.js +0 -1
  61. package/dist/interface/ImageTypeImpl.d.ts +0 -1
  62. package/dist/interface/ImageTypeImpl.js +0 -1
  63. package/dist/interface/IndexRangeImpl.d.ts +0 -4
  64. package/dist/interface/IndexRangeImpl.js +0 -1
  65. package/dist/interface/LoaderInfoDataImpl.d.ts +0 -7
  66. package/dist/interface/LoaderInfoDataImpl.js +0 -1
  67. package/dist/interface/LoopConfigImpl.d.ts +0 -8
  68. package/dist/interface/LoopConfigImpl.js +0 -1
  69. package/dist/interface/LoopTypeImpl.d.ts +0 -1
  70. package/dist/interface/LoopTypeImpl.js +0 -1
  71. package/dist/interface/MediaImpl.d.ts +0 -10
  72. package/dist/interface/MediaImpl.js +0 -1
  73. package/dist/interface/MovieClipActionObjectImpl.d.ts +0 -5
  74. package/dist/interface/MovieClipActionObjectImpl.js +0 -1
  75. package/dist/interface/MovieClipCharacterImpl.d.ts +0 -18
  76. package/dist/interface/MovieClipCharacterImpl.js +0 -1
  77. package/dist/interface/MovieClipLabelObjectImpl.d.ts +0 -4
  78. package/dist/interface/MovieClipLabelObjectImpl.js +0 -1
  79. package/dist/interface/MovieClipSoundObjectImpl.d.ts +0 -5
  80. package/dist/interface/MovieClipSoundObjectImpl.js +0 -1
  81. package/dist/interface/NetImpl.d.ts +0 -6
  82. package/dist/interface/NetImpl.js +0 -1
  83. package/dist/interface/NoCodeDataImpl.d.ts +0 -7
  84. package/dist/interface/NoCodeDataImpl.js +0 -1
  85. package/dist/interface/NoCodeDataZlibImpl.d.ts +0 -4
  86. package/dist/interface/NoCodeDataZlibImpl.js +0 -1
  87. package/dist/interface/ParentImpl.d.ts +0 -2
  88. package/dist/interface/ParentImpl.js +0 -1
  89. package/dist/interface/PlaceObjectImpl.d.ts +0 -12
  90. package/dist/interface/PlaceObjectImpl.js +0 -1
  91. package/dist/interface/PlayerHitObjectImpl.d.ts +0 -7
  92. package/dist/interface/PlayerHitObjectImpl.js +0 -1
  93. package/dist/interface/PlayerModeImpl.d.ts +0 -1
  94. package/dist/interface/PlayerModeImpl.js +0 -1
  95. package/dist/interface/PlayerOptionsImpl.d.ts +0 -8
  96. package/dist/interface/PlayerOptionsImpl.js +0 -1
  97. package/dist/interface/PointImpl.d.ts +0 -4
  98. package/dist/interface/PointImpl.js +0 -1
  99. package/dist/interface/PreObjectImpl.d.ts +0 -23
  100. package/dist/interface/PreObjectImpl.js +0 -1
  101. package/dist/interface/PropertyBitmapDataMessageImpl.d.ts +0 -8
  102. package/dist/interface/PropertyBitmapDataMessageImpl.js +0 -1
  103. package/dist/interface/PropertyContainerMessageImpl.d.ts +0 -6
  104. package/dist/interface/PropertyContainerMessageImpl.js +0 -1
  105. package/dist/interface/PropertyMessageImpl.d.ts +0 -41
  106. package/dist/interface/PropertyMessageImpl.js +0 -1
  107. package/dist/interface/PropertyMessageMapImpl.d.ts +0 -2
  108. package/dist/interface/PropertyMessageMapImpl.js +0 -1
  109. package/dist/interface/PropertyShapeMessageImpl.d.ts +0 -6
  110. package/dist/interface/PropertyShapeMessageImpl.js +0 -1
  111. package/dist/interface/PropertyTextMessageImpl.d.ts +0 -25
  112. package/dist/interface/PropertyTextMessageImpl.js +0 -1
  113. package/dist/interface/PropertyVideoMessageImpl.d.ts +0 -5
  114. package/dist/interface/PropertyVideoMessageImpl.js +0 -1
  115. package/dist/interface/RGBAImpl.d.ts +0 -6
  116. package/dist/interface/RGBAImpl.js +0 -1
  117. package/dist/interface/ShapeCharacterImpl.d.ts +0 -14
  118. package/dist/interface/ShapeCharacterImpl.js +0 -1
  119. package/dist/interface/SoundCharacterImpl.d.ts +0 -5
  120. package/dist/interface/SoundCharacterImpl.js +0 -1
  121. package/dist/interface/SoundTagImpl.d.ts +0 -6
  122. package/dist/interface/SoundTagImpl.js +0 -1
  123. package/dist/interface/SpriteImpl.d.ts +0 -2
  124. package/dist/interface/SpriteImpl.js +0 -1
  125. package/dist/interface/StageDataImpl.d.ts +0 -6
  126. package/dist/interface/StageDataImpl.js +0 -1
  127. package/dist/interface/StageQualityImpl.d.ts +0 -1
  128. package/dist/interface/StageQualityImpl.js +0 -1
  129. package/dist/interface/StrokeMethImpl.d.ts +0 -4
  130. package/dist/interface/StrokeMethImpl.js +0 -1
  131. package/dist/interface/StrokeTypeImpl.d.ts +0 -2
  132. package/dist/interface/StrokeTypeImpl.js +0 -1
  133. package/dist/interface/SurfaceFilterImpl.d.ts +0 -6
  134. package/dist/interface/SurfaceFilterImpl.js +0 -1
  135. package/dist/interface/TextBreakObjectImpl.d.ts +0 -9
  136. package/dist/interface/TextBreakObjectImpl.js +0 -1
  137. package/dist/interface/TextCharacterImpl.d.ts +0 -27
  138. package/dist/interface/TextCharacterImpl.js +0 -1
  139. package/dist/interface/TextDataImpl.d.ts +0 -2
  140. package/dist/interface/TextDataImpl.js +0 -1
  141. package/dist/interface/TextFieldAutoSizeImpl.d.ts +0 -1
  142. package/dist/interface/TextFieldAutoSizeImpl.js +0 -1
  143. package/dist/interface/TextFieldTypeImpl.d.ts +0 -1
  144. package/dist/interface/TextFieldTypeImpl.js +0 -1
  145. package/dist/interface/TextFormatAlignImpl.d.ts +0 -1
  146. package/dist/interface/TextFormatAlignImpl.js +0 -1
  147. package/dist/interface/TextFormatVerticalAlignImpl.d.ts +0 -1
  148. package/dist/interface/TextFormatVerticalAlignImpl.js +0 -1
  149. package/dist/interface/TextImageObjectImpl.d.ts +0 -11
  150. package/dist/interface/TextImageObjectImpl.js +0 -1
  151. package/dist/interface/TextImpl.d.ts +0 -6
  152. package/dist/interface/TextImpl.js +0 -1
  153. package/dist/interface/TextObjectImpl.d.ts +0 -7
  154. package/dist/interface/TextObjectImpl.js +0 -1
  155. package/dist/interface/TextObjectModeImpl.d.ts +0 -1
  156. package/dist/interface/TextObjectModeImpl.js +0 -1
  157. package/dist/interface/TextStringObjectImpl.d.ts +0 -7
  158. package/dist/interface/TextStringObjectImpl.js +0 -1
  159. package/dist/interface/UIImpl.d.ts +0 -8
  160. package/dist/interface/UIImpl.js +0 -1
  161. package/dist/interface/URLLoaderDataFormatImpl.d.ts +0 -1
  162. package/dist/interface/URLLoaderDataFormatImpl.js +0 -1
  163. package/dist/interface/URLRequestMethodImpl.d.ts +0 -1
  164. package/dist/interface/URLRequestMethodImpl.js +0 -1
  165. package/dist/interface/UniformDataImpl.d.ts +0 -5
  166. package/dist/interface/UniformDataImpl.js +0 -1
  167. package/dist/interface/UnzipQueueImpl.d.ts +0 -6
  168. package/dist/interface/UnzipQueueImpl.js +0 -1
  169. package/dist/interface/VerticesImpl.d.ts +0 -1
  170. package/dist/interface/VerticesImpl.js +0 -1
  171. package/dist/interface/VideoCharacterImpl.d.ts +0 -12
  172. package/dist/interface/VideoCharacterImpl.js +0 -1
  173. package/dist/player/next2d/display/BitmapData.d.ts +0 -143
  174. package/dist/player/next2d/display/BitmapData.js +0 -387
  175. package/dist/player/next2d/display/BlendMode.d.ts +0 -204
  176. package/dist/player/next2d/display/BlendMode.js +0 -240
  177. package/dist/player/next2d/display/DisplayObject.d.ts +0 -565
  178. package/dist/player/next2d/display/DisplayObject.js +0 -1669
  179. package/dist/player/next2d/display/DisplayObjectContainer.d.ts +0 -351
  180. package/dist/player/next2d/display/DisplayObjectContainer.js +0 -1751
  181. package/dist/player/next2d/display/FrameLabel.d.ts +0 -98
  182. package/dist/player/next2d/display/FrameLabel.js +0 -120
  183. package/dist/player/next2d/display/Graphics.d.ts +0 -577
  184. package/dist/player/next2d/display/Graphics.js +0 -2161
  185. package/dist/player/next2d/display/GraphicsBitmapFill.d.ts +0 -49
  186. package/dist/player/next2d/display/GraphicsBitmapFill.js +0 -86
  187. package/dist/player/next2d/display/GraphicsGradientFill.d.ts +0 -66
  188. package/dist/player/next2d/display/GraphicsGradientFill.js +0 -157
  189. package/dist/player/next2d/display/InteractiveObject.d.ts +0 -32
  190. package/dist/player/next2d/display/InteractiveObject.js +0 -43
  191. package/dist/player/next2d/display/Loader.d.ts +0 -131
  192. package/dist/player/next2d/display/Loader.js +0 -321
  193. package/dist/player/next2d/display/LoaderInfo.d.ts +0 -122
  194. package/dist/player/next2d/display/LoaderInfo.js +0 -184
  195. package/dist/player/next2d/display/LoopConfig.d.ts +0 -108
  196. package/dist/player/next2d/display/LoopConfig.js +0 -156
  197. package/dist/player/next2d/display/LoopType.d.ts +0 -104
  198. package/dist/player/next2d/display/LoopType.js +0 -122
  199. package/dist/player/next2d/display/MovieClip.d.ts +0 -314
  200. package/dist/player/next2d/display/MovieClip.js +0 -941
  201. package/dist/player/next2d/display/Shape.d.ts +0 -169
  202. package/dist/player/next2d/display/Shape.js +0 -509
  203. package/dist/player/next2d/display/Sprite.d.ts +0 -175
  204. package/dist/player/next2d/display/Sprite.js +0 -280
  205. package/dist/player/next2d/display/Stage.d.ts +0 -164
  206. package/dist/player/next2d/display/Stage.js +0 -251
  207. package/dist/player/next2d/events/Event.d.ts +0 -424
  208. package/dist/player/next2d/events/Event.js +0 -560
  209. package/dist/player/next2d/events/EventDispatcher.d.ts +0 -138
  210. package/dist/player/next2d/events/EventDispatcher.js +0 -623
  211. package/dist/player/next2d/events/EventPhase.d.ts +0 -80
  212. package/dist/player/next2d/events/EventPhase.js +0 -94
  213. package/dist/player/next2d/events/FocusEvent.d.ts +0 -89
  214. package/dist/player/next2d/events/FocusEvent.js +0 -103
  215. package/dist/player/next2d/events/HTTPStatusEvent.d.ts +0 -107
  216. package/dist/player/next2d/events/HTTPStatusEvent.js +0 -139
  217. package/dist/player/next2d/events/IOErrorEvent.d.ts +0 -82
  218. package/dist/player/next2d/events/IOErrorEvent.js +0 -101
  219. package/dist/player/next2d/events/MouseEvent.d.ts +0 -163
  220. package/dist/player/next2d/events/MouseEvent.js +0 -207
  221. package/dist/player/next2d/events/ProgressEvent.d.ts +0 -97
  222. package/dist/player/next2d/events/ProgressEvent.js +0 -123
  223. package/dist/player/next2d/events/VideoEvent.d.ts +0 -145
  224. package/dist/player/next2d/events/VideoEvent.js +0 -181
  225. package/dist/player/next2d/filters/BevelFilter.d.ts +0 -254
  226. package/dist/player/next2d/filters/BevelFilter.js +0 -491
  227. package/dist/player/next2d/filters/BitmapFilter.d.ts +0 -75
  228. package/dist/player/next2d/filters/BitmapFilter.js +0 -95
  229. package/dist/player/next2d/filters/BlurFilter.d.ts +0 -150
  230. package/dist/player/next2d/filters/BlurFilter.js +0 -370
  231. package/dist/player/next2d/filters/ColorMatrixFilter.d.ts +0 -116
  232. package/dist/player/next2d/filters/ColorMatrixFilter.js +0 -179
  233. package/dist/player/next2d/filters/ConvolutionFilter.d.ts +0 -210
  234. package/dist/player/next2d/filters/ConvolutionFilter.js +0 -366
  235. package/dist/player/next2d/filters/DisplacementMapFilter.d.ts +0 -212
  236. package/dist/player/next2d/filters/DisplacementMapFilter.js +0 -372
  237. package/dist/player/next2d/filters/DropShadowFilter.d.ts +0 -240
  238. package/dist/player/next2d/filters/DropShadowFilter.js +0 -461
  239. package/dist/player/next2d/filters/GlowFilter.d.ts +0 -204
  240. package/dist/player/next2d/filters/GlowFilter.js +0 -356
  241. package/dist/player/next2d/filters/GradientBevelFilter.d.ts +0 -243
  242. package/dist/player/next2d/filters/GradientBevelFilter.js +0 -474
  243. package/dist/player/next2d/filters/GradientGlowFilter.d.ts +0 -243
  244. package/dist/player/next2d/filters/GradientGlowFilter.js +0 -464
  245. package/dist/player/next2d/geom/ColorTransform.d.ts +0 -201
  246. package/dist/player/next2d/geom/ColorTransform.js +0 -278
  247. package/dist/player/next2d/geom/Matrix.d.ts +0 -299
  248. package/dist/player/next2d/geom/Matrix.js +0 -454
  249. package/dist/player/next2d/geom/Point.d.ts +0 -213
  250. package/dist/player/next2d/geom/Point.js +0 -274
  251. package/dist/player/next2d/geom/Rectangle.d.ts +0 -364
  252. package/dist/player/next2d/geom/Rectangle.js +0 -513
  253. package/dist/player/next2d/geom/Transform.d.ts +0 -213
  254. package/dist/player/next2d/geom/Transform.js +0 -492
  255. package/dist/player/next2d/media/Sound.d.ts +0 -208
  256. package/dist/player/next2d/media/Sound.js +0 -504
  257. package/dist/player/next2d/media/SoundMixer.d.ts +0 -68
  258. package/dist/player/next2d/media/SoundMixer.js +0 -115
  259. package/dist/player/next2d/media/SoundTransform.d.ts +0 -80
  260. package/dist/player/next2d/media/SoundTransform.js +0 -111
  261. package/dist/player/next2d/media/Video.d.ts +0 -331
  262. package/dist/player/next2d/media/Video.js +0 -856
  263. package/dist/player/next2d/net/URLRequest.d.ts +0 -143
  264. package/dist/player/next2d/net/URLRequest.js +0 -232
  265. package/dist/player/next2d/net/URLRequestHeader.d.ts +0 -82
  266. package/dist/player/next2d/net/URLRequestHeader.js +0 -105
  267. package/dist/player/next2d/text/TextField.d.ts +0 -644
  268. package/dist/player/next2d/text/TextField.js +0 -2662
  269. package/dist/player/next2d/text/TextFormat.d.ts +0 -250
  270. package/dist/player/next2d/text/TextFormat.js +0 -460
  271. package/dist/player/next2d/ui/Easing.d.ts +0 -359
  272. package/dist/player/next2d/ui/Easing.js +0 -481
  273. package/dist/player/next2d/ui/Job.d.ts +0 -155
  274. package/dist/player/next2d/ui/Job.js +0 -333
  275. package/dist/player/next2d/ui/Tween.d.ts +0 -62
  276. package/dist/player/next2d/ui/Tween.js +0 -72
  277. package/dist/player/packages/Display.d.ts +0 -3
  278. package/dist/player/packages/Display.js +0 -36
  279. package/dist/player/packages/Events.d.ts +0 -3
  280. package/dist/player/packages/Events.js +0 -28
  281. package/dist/player/packages/Filters.d.ts +0 -3
  282. package/dist/player/packages/Filters.js +0 -28
  283. package/dist/player/packages/Geom.d.ts +0 -3
  284. package/dist/player/packages/Geom.js +0 -20
  285. package/dist/player/packages/Media.d.ts +0 -3
  286. package/dist/player/packages/Media.js +0 -18
  287. package/dist/player/packages/Net.d.ts +0 -3
  288. package/dist/player/packages/Net.js +0 -14
  289. package/dist/player/packages/Text.d.ts +0 -3
  290. package/dist/player/packages/Text.js +0 -14
  291. package/dist/player/packages/UI.d.ts +0 -3
  292. package/dist/player/packages/UI.js +0 -16
  293. package/dist/player/player/Next2D.d.ts +0 -70
  294. package/dist/player/player/Next2D.js +0 -192
  295. package/dist/player/player/Player.d.ts +0 -334
  296. package/dist/player/player/Player.js +0 -1863
  297. package/dist/player/util/CacheStore.d.ts +0 -115
  298. package/dist/player/util/CacheStore.js +0 -276
  299. package/dist/player/util/Global.d.ts +0 -23
  300. package/dist/player/util/Global.js +0 -67
  301. package/dist/player/util/RenderUtil.d.ts +0 -472
  302. package/dist/player/util/RenderUtil.js +0 -686
  303. package/dist/player/util/Shortcut.d.ts +0 -28
  304. package/dist/player/util/Shortcut.js +0 -28
  305. package/dist/player/util/Util.d.ts +0 -334
  306. package/dist/player/util/Util.js +0 -844
  307. package/dist/webgl/BezierConverter.d.ts +0 -59
  308. package/dist/webgl/BezierConverter.js +0 -106
  309. package/dist/webgl/CanvasGradientToWebGL.d.ts +0 -94
  310. package/dist/webgl/CanvasGradientToWebGL.js +0 -181
  311. package/dist/webgl/CanvasPatternToWebGL.d.ts +0 -39
  312. package/dist/webgl/CanvasPatternToWebGL.js +0 -66
  313. package/dist/webgl/CanvasToWebGLContext.d.ts +0 -596
  314. package/dist/webgl/CanvasToWebGLContext.js +0 -1421
  315. package/dist/webgl/CanvasToWebGLContextBlend.d.ts +0 -97
  316. package/dist/webgl/CanvasToWebGLContextBlend.js +0 -299
  317. package/dist/webgl/CanvasToWebGLContextGrid.d.ts +0 -74
  318. package/dist/webgl/CanvasToWebGLContextGrid.js +0 -283
  319. package/dist/webgl/CanvasToWebGLContextMask.d.ts +0 -113
  320. package/dist/webgl/CanvasToWebGLContextMask.js +0 -436
  321. package/dist/webgl/CanvasToWebGLContextPath.d.ts +0 -111
  322. package/dist/webgl/CanvasToWebGLContextPath.js +0 -210
  323. package/dist/webgl/CanvasToWebGLContextStyle.d.ts +0 -77
  324. package/dist/webgl/CanvasToWebGLContextStyle.js +0 -139
  325. package/dist/webgl/ColorBufferPool.d.ts +0 -58
  326. package/dist/webgl/ColorBufferPool.js +0 -134
  327. package/dist/webgl/FrameBufferManager.d.ts +0 -135
  328. package/dist/webgl/FrameBufferManager.js +0 -358
  329. package/dist/webgl/StencilBufferPool.d.ts +0 -56
  330. package/dist/webgl/StencilBufferPool.js +0 -142
  331. package/dist/webgl/TextureManager.d.ts +0 -130
  332. package/dist/webgl/TextureManager.js +0 -296
  333. package/dist/webgl/VertexArrayObjectManager.d.ts +0 -95
  334. package/dist/webgl/VertexArrayObjectManager.js +0 -277
  335. package/dist/webgl/WebGLFillMeshGenerator.d.ts +0 -31
  336. package/dist/webgl/WebGLFillMeshGenerator.js +0 -101
  337. package/dist/webgl/WebGLStrokeMeshGenerator.d.ts +0 -182
  338. package/dist/webgl/WebGLStrokeMeshGenerator.js +0 -504
  339. package/dist/webgl/shader/CanvasToWebGLShader.d.ts +0 -85
  340. package/dist/webgl/shader/CanvasToWebGLShader.js +0 -192
  341. package/dist/webgl/shader/CanvasToWebGLShaderList.d.ts +0 -70
  342. package/dist/webgl/shader/CanvasToWebGLShaderList.js +0 -109
  343. package/dist/webgl/shader/GradientLUTGenerator.d.ts +0 -36
  344. package/dist/webgl/shader/GradientLUTGenerator.js +0 -123
  345. package/dist/webgl/shader/WebGLShaderUniform.d.ts +0 -52
  346. package/dist/webgl/shader/WebGLShaderUniform.js +0 -165
  347. package/dist/webgl/shader/fragment/FragmentShaderLibrary.d.ts +0 -18
  348. package/dist/webgl/shader/fragment/FragmentShaderLibrary.js +0 -35
  349. package/dist/webgl/shader/fragment/FragmentShaderSource.d.ts +0 -29
  350. package/dist/webgl/shader/fragment/FragmentShaderSource.js +0 -99
  351. package/dist/webgl/shader/fragment/FragmentShaderSourceBlend.d.ts +0 -67
  352. package/dist/webgl/shader/fragment/FragmentShaderSourceBlend.js +0 -319
  353. package/dist/webgl/shader/fragment/FragmentShaderSourceGradient.d.ts +0 -44
  354. package/dist/webgl/shader/fragment/FragmentShaderSourceGradient.js +0 -114
  355. package/dist/webgl/shader/fragment/FragmentShaderSourceGradientLUT.d.ts +0 -14
  356. package/dist/webgl/shader/fragment/FragmentShaderSourceGradientLUT.js +0 -58
  357. package/dist/webgl/shader/fragment/FragmentShaderSourceTexture.d.ts +0 -12
  358. package/dist/webgl/shader/fragment/FragmentShaderSourceTexture.js +0 -36
  359. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceBlurFilter.d.ts +0 -12
  360. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceBlurFilter.js +0 -42
  361. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceColorMatrixFilter.d.ts +0 -11
  362. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceColorMatrixFilter.js +0 -35
  363. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.d.ts +0 -16
  364. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceConvolutionFilter.js +0 -80
  365. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.d.ts +0 -15
  366. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceDisplacementMapFilter.js +0 -106
  367. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceFilter.d.ts +0 -112
  368. package/dist/webgl/shader/fragment/filter/FragmentShaderSourceFilter.js +0 -275
  369. package/dist/webgl/shader/variants/BlendShaderVariantCollection.d.ts +0 -99
  370. package/dist/webgl/shader/variants/BlendShaderVariantCollection.js +0 -239
  371. package/dist/webgl/shader/variants/FilterShaderVariantCollection.d.ts +0 -150
  372. package/dist/webgl/shader/variants/FilterShaderVariantCollection.js +0 -395
  373. package/dist/webgl/shader/variants/GradientLUTShaderVariantCollection.d.ts +0 -49
  374. package/dist/webgl/shader/variants/GradientLUTShaderVariantCollection.js +0 -107
  375. package/dist/webgl/shader/variants/GradientShapeShaderVariantCollection.d.ts +0 -61
  376. package/dist/webgl/shader/variants/GradientShapeShaderVariantCollection.js +0 -196
  377. package/dist/webgl/shader/variants/ShapeShaderVariantCollection.d.ts +0 -117
  378. package/dist/webgl/shader/variants/ShapeShaderVariantCollection.js +0 -427
  379. package/dist/webgl/shader/vertex/VertexShaderLibrary.d.ts +0 -18
  380. package/dist/webgl/shader/vertex/VertexShaderLibrary.js +0 -75
  381. package/dist/webgl/shader/vertex/VertexShaderSource.d.ts +0 -23
  382. package/dist/webgl/shader/vertex/VertexShaderSource.js +0 -92
  383. package/dist/webgl/shader/vertex/VertexShaderSourceFill.d.ts +0 -45
  384. package/dist/webgl/shader/vertex/VertexShaderSourceFill.js +0 -112
  385. package/dist/webgl/shader/vertex/VertexShaderSourceStroke.d.ts +0 -27
  386. package/dist/webgl/shader/vertex/VertexShaderSourceStroke.js +0 -149
  387. /package/{dist/player/index.d.ts → index.d.ts} +0 -0
@@ -1,1751 +0,0 @@
1
- import { InteractiveObject } from "./InteractiveObject";
2
- import { Event as Next2DEvent } from "../events/Event";
3
- import { Rectangle } from "../geom/Rectangle";
4
- import { $doUpdated } from "../../util/Global";
5
- import { $createInstance, $currentPlayer, $hitContext, $isTouch, $MATRIX_HIT_ARRAY_IDENTITY, $rendererWorker } from "../../util/Util";
6
- import { $boundsMatrix, $clamp, $getArray, $getBoundsObject, $getFloat32Array6, $getFloat32Array8, $getMap, $getPreObject, $Math, $COLOR_ARRAY_IDENTITY, $MATRIX_ARRAY_IDENTITY, $multiplicationColor, $multiplicationMatrix, $Number, $poolArray, $poolBoundsObject, $poolFloat32Array6, $poolFloat32Array8, $poolMap, $poolPreObject } from "../../util/RenderUtil";
7
- /**
8
- * DisplayObjectContainer クラスは、表示リストで表示オブジェクトコンテナとして機能するすべてのオブジェクトの基本クラスです。
9
- * このクラス自体は、画面上でのコンテンツの描画のための API を含みません。
10
- * そのため、DisplayObject クラスのカスタムサブクラスを作成する場合は、
11
- * Sprite、または MovieClip など、画面上にコンテンツを描画する API を持つサブクラスの 1 つを拡張する必要があります。
12
- *
13
- * The DisplayObjectContainer class is the base class for all objects that can serve
14
- * as display object containers on the display list.
15
- * This class itself does not contain any API for drawing content on the screen.
16
- * Therefore, if you want to create a custom subclass of the DisplayObject class,
17
- * you need to extend one of its subclasses that has an API for drawing content on the screen,
18
- * such as Sprite or MovieClip.
19
- *
20
- * @class
21
- * @memberOf next2d.display
22
- * @extends InteractiveObject
23
- */
24
- export class DisplayObjectContainer extends InteractiveObject {
25
- /**
26
- * @constructor
27
- * @public
28
- */
29
- constructor() {
30
- super();
31
- /**
32
- * @type {array}
33
- * @default null
34
- * @private
35
- */
36
- this._$placeMap = null;
37
- /**
38
- * @type {array}
39
- * @default null
40
- * @private
41
- */
42
- this._$placeObjects = null;
43
- /**
44
- * @type {array}
45
- * @default null
46
- * @private
47
- */
48
- this._$controller = null;
49
- /**
50
- * @type {array}
51
- * @default null
52
- * @private
53
- */
54
- this._$dictionary = null;
55
- /**
56
- * @type {array}
57
- * @private
58
- */
59
- this._$children = $getArray();
60
- /**
61
- * @type {boolean}
62
- * @default true
63
- * @private
64
- */
65
- this._$needsChildren = true;
66
- /**
67
- * @type {boolean}
68
- * @default true
69
- * @private
70
- */
71
- this._$mouseChildren = true;
72
- /**
73
- * @type {boolean}
74
- * @default true
75
- * @private
76
- */
77
- this._$wait = true;
78
- /**
79
- * @type {Map}
80
- * @private
81
- */
82
- this._$names = $getMap();
83
- return new Proxy(this, {
84
- "get": (object, name) => {
85
- if (object._$names.size && object._$names.has(name)) {
86
- return object._$names.get(name);
87
- }
88
- // @ts-ignore
89
- return object[name];
90
- }
91
- });
92
- }
93
- /**
94
- * @description オブジェクトの子がマウスまたはユーザー入力デバイスに対応しているかどうかを判断します。
95
- * Determine if the object's children are compatible with mouse or user input devices.
96
- *
97
- * @member {boolean}
98
- * @public
99
- */
100
- get mouseChildren() {
101
- return this._$mouseChildren;
102
- }
103
- set mouseChildren(mouse_children) {
104
- this._$mouseChildren = !!mouse_children;
105
- }
106
- /**
107
- * @description このオブジェクトの子の数を返します。
108
- * Returns the number of children of this object.
109
- *
110
- * @member {number}
111
- * @readonly
112
- * @public
113
- */
114
- get numChildren() {
115
- return this._$needsChildren
116
- ? this._$getChildren().length
117
- : this._$children.length;
118
- }
119
- /**
120
- * @description この DisplayObjectContainer インスタンスに子 DisplayObject インスタンスを追加します。
121
- * Adds a child DisplayObject instance to this DisplayObjectContainer instance.
122
- *
123
- * @param {DisplayObject} child
124
- * @return {DisplayObject}
125
- * @method
126
- * @public
127
- */
128
- addChild(child) {
129
- if (child._$parent) {
130
- child._$parent._$remove(child, !(child._$parent._$instanceId === this._$instanceId));
131
- }
132
- this._$getChildren().push(child);
133
- if (child._$name) {
134
- this._$names.set(child._$name, child);
135
- }
136
- return this._$addChild(child);
137
- }
138
- /**
139
- * @description この DisplayObjectContainer インスタンスに子 DisplayObject インスタンスを追加します。
140
- * Adds a child DisplayObject instance to this DisplayObjectContainer instance.
141
- *
142
- * @param {DisplayObject} child
143
- * @param {number} index
144
- * @return {DisplayObject}
145
- * @method
146
- * @public
147
- */
148
- addChildAt(child, index) {
149
- if (child._$parent) {
150
- child._$parent._$remove(child, !(child._$parent._$instanceId === this._$instanceId));
151
- }
152
- const children = this._$getChildren();
153
- const length = children.length;
154
- if (0 > index || index > length) {
155
- throw new RangeError(`RangeError: addChildAt: index error: ${index}`);
156
- }
157
- if (length && length > index) {
158
- children.splice(index, 0, child);
159
- for (let idx = 0; idx < index; ++idx) {
160
- const instance = children[idx];
161
- if (instance._$name) {
162
- this._$names.set(instance._$name, instance);
163
- }
164
- }
165
- }
166
- else {
167
- children.push(child);
168
- if (child._$name) {
169
- this._$names.set(child._$name, child);
170
- }
171
- }
172
- return this._$addChild(child);
173
- }
174
- /**
175
- * @description 指定された表示オブジェクトが、DisplayObjectContainer インスタンスの子であるか
176
- * インスタンス自体であるかを指定します。
177
- * Determines whether the specified display object is a child
178
- * of the DisplayObjectContainer instance or the instance itself.
179
- *
180
- * @param {DisplayObject} child
181
- * @return {boolean}
182
- * @method
183
- * @public
184
- */
185
- contains(child) {
186
- if (this._$instanceId === child._$instanceId) {
187
- return true;
188
- }
189
- const children = this._$getChildren();
190
- for (let idx = 0; idx < children.length; ++idx) {
191
- const instance = children[idx];
192
- if (instance._$instanceId === child._$instanceId) {
193
- return true;
194
- }
195
- if (instance instanceof DisplayObjectContainer) {
196
- if (instance.contains(child)) {
197
- return true;
198
- }
199
- }
200
- }
201
- return false;
202
- }
203
- /**
204
- * @description 指定のインデックス位置にある子表示オブジェクトインスタンスを返します。
205
- * Returns the child display object instance that exists at the specified index.
206
- *
207
- * @param {number} index
208
- * @return {DisplayObject}
209
- * @method
210
- * @public
211
- */
212
- getChildAt(index) {
213
- const children = this._$getChildren();
214
- if (0 > index || index > children.length) {
215
- throw new RangeError(`RangeError: getChildAt: index error: ${index}`);
216
- }
217
- return index in children ? children[index] : null;
218
- }
219
- /**
220
- * @description 指定された名前に一致する子表示オブジェクトを返します。
221
- * Returns the child display object that exists with the specified name.
222
- *
223
- * @param {string} name
224
- * @return {{DisplayObject}|null}
225
- * @method
226
- * @public
227
- */
228
- getChildByName(name) {
229
- if (!name) {
230
- return null;
231
- }
232
- // fixed logic
233
- const children = this._$getChildren();
234
- for (let idx = 0; idx < children.length; ++idx) {
235
- const child = children[idx];
236
- if (child.name !== name) {
237
- continue;
238
- }
239
- return child;
240
- }
241
- return null;
242
- }
243
- /**
244
- * @description 子 DisplayObject インスタンスのインデックス位置を返します。
245
- * Returns the index position of a child DisplayObject instance.
246
- *
247
- * @param {DisplayObject} child
248
- * @return {number}
249
- * @method
250
- * @public
251
- */
252
- getChildIndex(child) {
253
- if (child._$parent !== this) {
254
- throw new Error("ArgumentError: getChildIndex: not child");
255
- }
256
- const index = this._$getChildren().indexOf(child);
257
- if (index === -1) {
258
- throw new Error("ArgumentError: getChildIndex: not found.");
259
- }
260
- return index;
261
- }
262
- /**
263
- * @description DisplayObjectContainer インスタンスの子リストから指定の
264
- * child DisplayObject インスタンスを削除します。
265
- * Removes the specified child DisplayObject instance from the
266
- * child list of the DisplayObjectContainer instance.
267
- *
268
- * @param {DisplayObject} child
269
- * @return {DisplayObject}
270
- * @method
271
- * @public
272
- */
273
- removeChild(child) {
274
- if (child._$parent !== this) {
275
- throw new Error("ArgumentError: removeChild: not child");
276
- }
277
- return this._$remove(child);
278
- }
279
- /**
280
- * @description DisplayObjectContainer の子リストの指定された index 位置から子 DisplayObject を削除します。
281
- * Removes a child DisplayObject from the specified index position
282
- * in the child list of the DisplayObjectContainer.
283
- *
284
- * @param {number} index
285
- * @return {DisplayObject}
286
- * @method
287
- * @public
288
- */
289
- removeChildAt(index) {
290
- return this._$remove(this.getChildAt(index));
291
- }
292
- /**
293
- * @description DisplayObjectContainer インスタンスの子リストから
294
- * すべての child DisplayObject インスタンスを削除します。
295
- * Removes all child DisplayObject instances from
296
- * the child list of the DisplayObjectContainer instance.
297
- *
298
- * @param {number} [begin_index=0]
299
- * @param {number} [end_index=0x7fffffff]
300
- * @return {void}
301
- * @method
302
- * @public
303
- */
304
- removeChildren(begin_index = 0, end_index = 0x7fffffff) {
305
- const children = this._$getChildren();
306
- if (!children.length) {
307
- return;
308
- }
309
- begin_index = $clamp(begin_index, 0, 0x7ffffffe, 0) - 1;
310
- end_index = $clamp(end_index, 1, 0x7ffffff, 0x7ffffff);
311
- for (let idx = $Math.min(end_index, children.length - 1); idx > begin_index; --idx) {
312
- this._$remove(children[idx]);
313
- }
314
- }
315
- /**
316
- * @description 表示オブジェクトコンテナの既存の子の位置を変更します。
317
- * Changes the position of an existing child in the display object container.
318
- *
319
- * @param {DisplayObject} child
320
- * @param {number} index
321
- * @return {void}
322
- * @method
323
- * @public
324
- */
325
- setChildIndex(child, index) {
326
- const currentIndex = this.getChildIndex(child);
327
- if (currentIndex === index) {
328
- return;
329
- }
330
- const children = this._$getChildren();
331
- children.splice(currentIndex, 1);
332
- children.splice(index, 0, child);
333
- if ($rendererWorker) {
334
- this._$postChildrenIds();
335
- }
336
- this._$doChanged();
337
- }
338
- /**
339
- * @description 指定された 2 つの子オブジェクトの z 順序(重ね順)を入れ替えます。
340
- * Swaps the z-order (front-to-back order) of the two specified child objects.
341
- *
342
- * @param {DisplayObject} child1
343
- * @param {DisplayObject} child2
344
- * @return {void}
345
- * @method
346
- * @public
347
- */
348
- swapChildren(child1, child2) {
349
- const children = this._$getChildren();
350
- const index1 = this.getChildIndex(child1);
351
- const index2 = this.getChildIndex(child2);
352
- children[index1] = child2;
353
- children[index2] = child1;
354
- if ($rendererWorker) {
355
- this._$postChildrenIds();
356
- }
357
- this._$doChanged();
358
- }
359
- /**
360
- * @description 子リスト内の指定されたインデックス位置に該当する 2 つの子オブジェクトの z 順序(重ね順)を入れ替えます。
361
- * Swaps the z-order (front-to-back order) of the child objects at
362
- * the two specified index positions in the child list.
363
- *
364
- * @param {number} index1
365
- * @param {number} index2
366
- * @return {void}
367
- * @method
368
- * @public
369
- */
370
- swapChildrenAt(index1, index2) {
371
- this.swapChildren(this.getChildAt(index1), this.getChildAt(index2));
372
- }
373
- /**
374
- * @param {array} [matrix=null]
375
- * @return {object}
376
- * @private
377
- */
378
- _$getBounds(matrix = null) {
379
- let multiMatrix = $MATRIX_ARRAY_IDENTITY;
380
- if (matrix) {
381
- multiMatrix = matrix;
382
- const rawMatrix = this._$transform._$rawMatrix();
383
- if (rawMatrix[0] !== 1 || rawMatrix[1] !== 0
384
- || rawMatrix[2] !== 0 || rawMatrix[3] !== 1
385
- || rawMatrix[4] !== 0 || rawMatrix[5] !== 0) {
386
- multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
387
- }
388
- }
389
- const graphics = "_$graphics" in this
390
- ? this._$graphics
391
- : null;
392
- const children = this._$needsChildren
393
- ? this._$getChildren()
394
- : this._$children;
395
- // size zero
396
- if (!children.length && !graphics) {
397
- const bounds = $getBoundsObject(multiMatrix[4], -multiMatrix[4], multiMatrix[5], -multiMatrix[5]);
398
- if (matrix && multiMatrix !== matrix) {
399
- $poolFloat32Array6(multiMatrix);
400
- }
401
- return bounds;
402
- }
403
- // data init
404
- const no = $Number.MAX_VALUE;
405
- let xMin = no;
406
- let xMax = -no;
407
- let yMin = no;
408
- let yMax = -no;
409
- if (graphics) {
410
- const baseBounds = graphics._$getBounds();
411
- const bounds = $boundsMatrix(baseBounds, multiMatrix);
412
- $poolBoundsObject(baseBounds);
413
- xMin = bounds.xMin;
414
- xMax = bounds.xMax;
415
- yMin = bounds.yMin;
416
- yMax = bounds.yMax;
417
- $poolBoundsObject(bounds);
418
- }
419
- for (let idx = 0; idx < children.length; ++idx) {
420
- const bounds = children[idx]._$getBounds(multiMatrix);
421
- xMin = $Math.min(xMin, bounds.xMin);
422
- xMax = $Math.max(xMax, bounds.xMax);
423
- yMin = $Math.min(yMin, bounds.yMin);
424
- yMax = $Math.max(yMax, bounds.yMax);
425
- $poolBoundsObject(bounds);
426
- }
427
- if (matrix && multiMatrix !== matrix) {
428
- $poolFloat32Array6(multiMatrix);
429
- }
430
- // end
431
- return $getBoundsObject(xMin, xMax, yMin, yMax);
432
- }
433
- /**
434
- * @param {array} [matrix=null]
435
- * @return {object}
436
- * @private
437
- */
438
- _$getLayerBounds(matrix = null) {
439
- let multiMatrix = $MATRIX_ARRAY_IDENTITY;
440
- if (matrix) {
441
- multiMatrix = matrix;
442
- const rawMatrix = this._$transform._$rawMatrix();
443
- if (rawMatrix !== $MATRIX_ARRAY_IDENTITY) {
444
- multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
445
- }
446
- }
447
- const graphics = "_$graphics" in this
448
- ? this._$graphics
449
- : null;
450
- const children = this._$needsChildren
451
- ? this._$getChildren()
452
- : this._$children;
453
- // size zero
454
- if (!children.length && !graphics) {
455
- const bounds = $getBoundsObject(multiMatrix[4], -multiMatrix[4], multiMatrix[5], -multiMatrix[5]);
456
- if (matrix && multiMatrix !== matrix) {
457
- $poolFloat32Array6(multiMatrix);
458
- }
459
- return bounds;
460
- }
461
- // data init
462
- const no = $Number.MAX_VALUE;
463
- let xMin = no;
464
- let xMax = -no;
465
- let yMin = no;
466
- let yMax = -no;
467
- if (graphics) {
468
- const baseBounds = graphics._$getBounds();
469
- const bounds = $boundsMatrix(baseBounds, multiMatrix);
470
- $poolBoundsObject(baseBounds);
471
- xMin = +bounds.xMin;
472
- xMax = +bounds.xMax;
473
- yMin = +bounds.yMin;
474
- yMax = +bounds.yMax;
475
- $poolBoundsObject(bounds);
476
- }
477
- for (let idx = 0; idx < children.length; ++idx) {
478
- const bounds = children[idx]
479
- ._$getLayerBounds(multiMatrix);
480
- xMin = $Math.min(xMin, bounds.xMin);
481
- xMax = $Math.max(xMax, bounds.xMax);
482
- yMin = $Math.min(yMin, bounds.yMin);
483
- yMax = $Math.max(yMax, bounds.yMax);
484
- $poolBoundsObject(bounds);
485
- }
486
- if (matrix && multiMatrix !== matrix) {
487
- $poolFloat32Array6(multiMatrix);
488
- }
489
- // end
490
- if (!matrix) {
491
- return $getBoundsObject(xMin, xMax, yMin, yMax);
492
- }
493
- const filters = this._$filters || this.filters;
494
- if (!filters.length) {
495
- return $getBoundsObject(xMin, xMax, yMin, yMax);
496
- }
497
- let rect = new Rectangle(xMin, yMin, xMax - xMin, yMax - yMin);
498
- for (let idx = 0; idx < filters.length; ++idx) {
499
- rect = filters[idx]
500
- ._$generateFilterRect(rect, 0, 0);
501
- }
502
- xMin = rect.x;
503
- xMax = rect.x + rect.width;
504
- yMin = rect.y;
505
- yMax = rect.y + rect.height;
506
- return $getBoundsObject(xMin, xMax, yMin, yMax);
507
- }
508
- /**
509
- * @return {array}
510
- * @private
511
- */
512
- _$getChildren() {
513
- if (this._$needsChildren) {
514
- // set flag
515
- this._$needsChildren = false;
516
- const currentChildren = this._$children;
517
- if (!this._$controller) {
518
- return currentChildren;
519
- }
520
- const frame = "_$currentFrame" in this ? this._$currentFrame : 1;
521
- const controller = this._$controller[frame];
522
- // first build
523
- if (!currentChildren.length) {
524
- if (controller) {
525
- for (let idx = 0; idx < controller.length; ++idx) {
526
- const instance = this._$createInstance(controller[idx]);
527
- instance._$placeId = idx;
528
- const loopConfig = instance.loopConfig;
529
- if (loopConfig) {
530
- instance._$currentFrame = instance
531
- ._$getLoopFrame(loopConfig);
532
- }
533
- currentChildren.push(instance);
534
- if (instance._$name) {
535
- this._$names.set(instance._$name, instance);
536
- }
537
- }
538
- }
539
- return currentChildren;
540
- }
541
- const player = $currentPlayer();
542
- const cacheStore = player.cacheStore;
543
- const useWorker = !!$rendererWorker && !!this._$stage;
544
- const skipIds = $getMap();
545
- const poolInstances = $getMap();
546
- let depth = 0;
547
- const children = $getArray();
548
- for (let idx = 0; idx < currentChildren.length; ++idx) {
549
- const instance = currentChildren[idx];
550
- const parent = instance._$parent;
551
- if (!parent || parent._$instanceId !== this._$instanceId) {
552
- continue;
553
- }
554
- const instanceId = instance._$instanceId;
555
- const startFrame = instance._$startFrame;
556
- const endFrame = instance._$endFrame;
557
- if (startFrame === 1 && endFrame === 0
558
- || startFrame <= frame && endFrame > frame) {
559
- // reset
560
- instance._$isNext = true;
561
- instance._$placeObject = null;
562
- instance._$filters = null;
563
- instance._$blendMode = null;
564
- if (instance._$id === -1) {
565
- children.push(instance);
566
- if (instance._$name) {
567
- this._$names.set(instance._$name, instance);
568
- }
569
- continue;
570
- }
571
- const id = controller[depth];
572
- if (instance._$id === id) {
573
- instance._$placeId = depth;
574
- children.push(instance);
575
- if (instance._$name) {
576
- this._$names.set(instance._$name, instance);
577
- }
578
- if (poolInstances.has(id)) {
579
- poolInstances.delete(id);
580
- }
581
- skipIds.set(id, true);
582
- depth++;
583
- if (useWorker) {
584
- instance._$postProperty();
585
- }
586
- continue;
587
- }
588
- poolInstances.set(instance._$id, instance);
589
- continue;
590
- }
591
- if (useWorker) {
592
- instance._$removeWorkerInstance();
593
- }
594
- cacheStore.setRemoveTimer(instanceId);
595
- if (instance._$loaderInfo && instance._$characterId) {
596
- cacheStore.setRemoveTimer(`${instance._$loaderInfo._$id}@${instance._$characterId}`);
597
- }
598
- // remove event
599
- if (instance.willTrigger(Next2DEvent.REMOVED)) {
600
- instance.dispatchEvent(new Next2DEvent(Next2DEvent.REMOVED, true));
601
- }
602
- if (instance.willTrigger(Next2DEvent.REMOVED_FROM_STAGE)) {
603
- instance.dispatchEvent(new Next2DEvent(Next2DEvent.REMOVED_FROM_STAGE, true));
604
- }
605
- // reset
606
- instance._$added = false;
607
- instance._$addedStage = false;
608
- instance._$active = false;
609
- instance._$updated = true;
610
- instance._$filters = null;
611
- instance._$blendMode = null;
612
- instance._$isNext = true;
613
- instance._$placeObject = null;
614
- instance._$created = false;
615
- instance._$posted = false;
616
- if (instance instanceof DisplayObjectContainer) {
617
- instance._$executeRemovedFromStage();
618
- instance._$removeParentAndStage();
619
- }
620
- }
621
- if (controller) {
622
- for (let idx = 0; idx < controller.length; ++idx) {
623
- const id = controller[idx];
624
- if (skipIds.has(id)) {
625
- continue;
626
- }
627
- const instance = poolInstances.has(id)
628
- ? poolInstances.get(id)
629
- : this._$createInstance(id);
630
- instance._$placeId = idx;
631
- const loopConfig = instance.loopConfig;
632
- if (loopConfig) {
633
- instance._$currentFrame = instance
634
- ._$getLoopFrame(loopConfig);
635
- }
636
- children.push(instance);
637
- if (instance._$name) {
638
- this._$names.set(instance._$name, instance);
639
- }
640
- }
641
- }
642
- // object pool
643
- $poolMap(skipIds);
644
- $poolMap(poolInstances);
645
- // update
646
- currentChildren.length = 0;
647
- currentChildren.push(...children);
648
- $poolArray(children);
649
- }
650
- return this._$children;
651
- }
652
- /**
653
- * @return void
654
- * @private
655
- */
656
- _$clearChildren() {
657
- this._$doChanged();
658
- $doUpdated();
659
- // reset
660
- this._$names.clear();
661
- // clear
662
- this._$needsChildren = true;
663
- }
664
- /**
665
- * @param {DisplayObject} child
666
- * @returns {DisplayObject}
667
- * @private
668
- */
669
- _$addChild(child) {
670
- // init
671
- child._$parent = this;
672
- if (!child._$stage || !child._$root) {
673
- child._$stage = this._$stage;
674
- child._$root = this._$root;
675
- }
676
- // setup
677
- if (child instanceof DisplayObjectContainer) {
678
- child._$setParentAndStage();
679
- child._$wait = true;
680
- }
681
- // added event
682
- if (!child._$added) {
683
- if (child.willTrigger(Next2DEvent.ADDED)) {
684
- child.dispatchEvent(new Next2DEvent(Next2DEvent.ADDED, true));
685
- }
686
- child._$added = true;
687
- }
688
- if (this._$stage !== null && !child._$addedStage) {
689
- if (child.willTrigger(Next2DEvent.ADDED_TO_STAGE)) {
690
- child.dispatchEvent(new Next2DEvent(Next2DEvent.ADDED_TO_STAGE));
691
- }
692
- child._$addedStage = true;
693
- // set params
694
- if (child instanceof DisplayObjectContainer) {
695
- child._$executeAddedToStage();
696
- }
697
- if ($rendererWorker) {
698
- child._$createWorkerInstance();
699
- child._$postProperty();
700
- this._$postChildrenIds();
701
- }
702
- }
703
- this._$doChanged();
704
- child._$active = true;
705
- child._$updated = true;
706
- child._$isNext = true;
707
- return child;
708
- }
709
- /**
710
- * @return {void}
711
- * @method
712
- * @private
713
- */
714
- _$setParentAndStage() {
715
- const children = this._$needsChildren
716
- ? this._$getChildren()
717
- : this._$children;
718
- for (let idx = 0; idx < children.length; ++idx) {
719
- const instance = children[idx];
720
- instance._$root = this._$root;
721
- instance._$stage = this._$stage;
722
- if (instance instanceof DisplayObjectContainer) {
723
- instance._$setParentAndStage();
724
- instance._$wait = true;
725
- }
726
- }
727
- }
728
- /**
729
- * @return {void}
730
- * @method
731
- * @private
732
- */
733
- _$executeAddedToStage() {
734
- const children = this._$needsChildren
735
- ? this._$getChildren()
736
- : this._$children;
737
- const childrenIds = $getArray();
738
- for (let idx = 0; idx < children.length; ++idx) {
739
- const instance = children[idx];
740
- if (!instance) {
741
- continue;
742
- }
743
- childrenIds.push(instance._$instanceId);
744
- if (!instance._$addedStage) {
745
- if ($rendererWorker) {
746
- instance._$createWorkerInstance();
747
- instance._$postProperty();
748
- }
749
- if (instance.willTrigger(Next2DEvent.ADDED_TO_STAGE)) {
750
- instance.dispatchEvent(new Next2DEvent(Next2DEvent.ADDED_TO_STAGE));
751
- }
752
- instance._$addedStage = true;
753
- }
754
- if (instance instanceof DisplayObjectContainer) {
755
- instance._$executeAddedToStage();
756
- }
757
- }
758
- if ($rendererWorker) {
759
- this._$postChildrenIds(childrenIds);
760
- }
761
- $poolArray(childrenIds);
762
- }
763
- /**
764
- * @param {DisplayObject} child
765
- * @param {boolean} do_event
766
- * @return {DisplayObject}
767
- * @private
768
- */
769
- _$remove(child, do_event = true) {
770
- child._$transform._$transform();
771
- // remove
772
- const children = this._$needsChildren
773
- ? this._$getChildren()
774
- : this._$children;
775
- const depth = this.getChildIndex(child);
776
- children.splice(depth, 1);
777
- this._$names.delete(child.name);
778
- if (do_event) {
779
- // event
780
- if (child.willTrigger(Next2DEvent.REMOVED)) {
781
- child.dispatchEvent(new Next2DEvent(Next2DEvent.REMOVED, true));
782
- }
783
- // remove stage event
784
- if (this._$stage !== null) {
785
- // worker側のDisplayObjectも削除
786
- if ($rendererWorker) {
787
- child._$removeWorkerInstance();
788
- this._$postChildrenIds();
789
- }
790
- if (child.willTrigger(Next2DEvent.REMOVED_FROM_STAGE)) {
791
- child.dispatchEvent(new Next2DEvent(Next2DEvent.REMOVED_FROM_STAGE));
792
- }
793
- if (child instanceof DisplayObjectContainer) {
794
- child._$executeRemovedFromStage();
795
- }
796
- }
797
- const player = $currentPlayer();
798
- const cacheStore = player.cacheStore;
799
- cacheStore.setRemoveTimer(child._$instanceId);
800
- if (child._$loaderInfo && child._$characterId) {
801
- cacheStore.setRemoveTimer(`${child._$loaderInfo._$id}@${child._$characterId}`);
802
- }
803
- // reset params
804
- if (child instanceof DisplayObjectContainer) {
805
- child._$removeParentAndStage();
806
- }
807
- // reset
808
- child._$stage = null;
809
- child._$parent = null;
810
- child._$root = null;
811
- child._$active = false;
812
- child._$wait = true;
813
- child._$updated = true;
814
- child._$added = false;
815
- child._$addedStage = false;
816
- child._$created = false;
817
- child._$posted = false;
818
- this._$doChanged();
819
- }
820
- return child;
821
- }
822
- /**
823
- * @return {void}
824
- * @method
825
- * @private
826
- */
827
- _$executeRemovedFromStage() {
828
- const children = this._$getChildren().slice(0);
829
- for (let idx = 0; idx < children.length; ++idx) {
830
- const instance = children[idx];
831
- if (!instance) {
832
- continue;
833
- }
834
- if (instance._$addedStage) {
835
- // workerのDisplayObjectを削除
836
- if ($rendererWorker) {
837
- instance._$removeWorkerInstance();
838
- }
839
- if (instance.willTrigger(Next2DEvent.REMOVED_FROM_STAGE)) {
840
- instance.dispatchEvent(new Next2DEvent(Next2DEvent.REMOVED_FROM_STAGE));
841
- }
842
- instance._$created = false;
843
- instance._$posted = false;
844
- instance._$addedStage = false;
845
- }
846
- if (instance instanceof DisplayObjectContainer) {
847
- instance._$executeRemovedFromStage();
848
- }
849
- }
850
- }
851
- /**
852
- * @return {void}
853
- * @method
854
- * @private
855
- */
856
- _$removeParentAndStage() {
857
- const children = this._$needsChildren
858
- ? this._$getChildren()
859
- : this._$children;
860
- const player = $currentPlayer();
861
- const cacheStore = player.cacheStore;
862
- for (let idx = 0; idx < children.length; ++idx) {
863
- const instance = children[idx];
864
- cacheStore.setRemoveTimer(instance._$instanceId);
865
- if (instance._$loaderInfo && instance._$characterId) {
866
- cacheStore.setRemoveTimer(`${instance._$loaderInfo._$id}@${instance._$characterId}`);
867
- }
868
- if (instance instanceof DisplayObjectContainer) {
869
- instance._$removeParentAndStage();
870
- }
871
- instance._$stage = null;
872
- instance._$root = null;
873
- instance._$addedStage = false;
874
- }
875
- if ("_$sounds" in this) {
876
- const soundsMap = this._$sounds;
877
- if (soundsMap.size) {
878
- for (const sounds of soundsMap.values()) {
879
- for (let idx = 0; idx < sounds.length; ++idx) {
880
- const sound = sounds[idx];
881
- sound.stop();
882
- }
883
- }
884
- }
885
- }
886
- this._$needsChildren = true;
887
- }
888
- /**
889
- * @return {void}
890
- * @method
891
- * @private
892
- */
893
- _$prepareActions() {
894
- const children = this._$needsChildren
895
- ? this._$getChildren()
896
- : this._$children;
897
- for (let idx = children.length - 1; idx > -1; --idx) {
898
- children[idx]._$prepareActions();
899
- }
900
- // added event
901
- this._$executeAddedEvent();
902
- }
903
- /**
904
- * @return {boolean}
905
- * @method
906
- * @private
907
- */
908
- _$nextFrame() {
909
- let isNext = false;
910
- const children = this._$getChildren();
911
- for (let idx = children.length - 1; idx > -1; --idx) {
912
- const child = children[idx];
913
- if (!child._$isNext) {
914
- continue;
915
- }
916
- if (isNext) {
917
- child._$nextFrame();
918
- }
919
- else {
920
- isNext = child._$nextFrame();
921
- }
922
- }
923
- // added event
924
- this._$executeAddedEvent();
925
- this._$isNext = isNext;
926
- if (!this._$posted && $rendererWorker) {
927
- this._$postProperty();
928
- }
929
- return this._$isNext;
930
- }
931
- /**
932
- * @param {CanvasToWebGLContext} context
933
- * @param {Float32Array} matrix
934
- * @return {void}
935
- * @method
936
- * @private
937
- */
938
- _$clip(context, matrix) {
939
- let multiMatrix = matrix;
940
- const rawMatrix = this._$transform._$rawMatrix();
941
- if (rawMatrix[0] !== 1 || rawMatrix[1] !== 0
942
- || rawMatrix[2] !== 0 || rawMatrix[3] !== 1
943
- || rawMatrix[4] !== 0 || rawMatrix[5] !== 0) {
944
- multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
945
- }
946
- const graphics = "_$graphics" in this
947
- ? this._$graphics
948
- : null;
949
- if (graphics && graphics._$canDraw) {
950
- graphics._$clip(context, multiMatrix);
951
- }
952
- const children = this._$getChildren();
953
- for (let idx = 0; idx < children.length; ++idx) {
954
- const instance = children[idx];
955
- // mask instance
956
- if (instance._$isMask) {
957
- continue;
958
- }
959
- instance._$clip(context, multiMatrix);
960
- instance._$updated = false;
961
- }
962
- if (multiMatrix !== matrix) {
963
- $poolFloat32Array6(multiMatrix);
964
- }
965
- }
966
- /**
967
- * @param {CanvasToWebGLContext} context
968
- * @param {Float32Array} matrix
969
- * @return {object}
970
- * @private
971
- */
972
- _$preDraw(context, matrix) {
973
- let multiMatrix = matrix;
974
- const rawMatrix = this._$transform._$rawMatrix();
975
- if (rawMatrix !== $MATRIX_HIT_ARRAY_IDENTITY
976
- && rawMatrix[0] !== 1 || rawMatrix[1] !== 0
977
- || rawMatrix[2] !== 0 || rawMatrix[3] !== 1
978
- || rawMatrix[4] !== 0 || rawMatrix[5] !== 0) {
979
- multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
980
- }
981
- // size zero
982
- if (!multiMatrix[0] && !multiMatrix[1]
983
- || !multiMatrix[2] && !multiMatrix[3]) {
984
- return null;
985
- }
986
- // return object
987
- const object = $getPreObject();
988
- // setup
989
- object.matrix = multiMatrix;
990
- // check
991
- const filters = this._$filters || this.filters;
992
- const blendMode = this._$blendMode || this.blendMode;
993
- if (filters.length > 0 || blendMode !== "normal") {
994
- // check size
995
- const baseBounds = this._$getBounds(null);
996
- const bounds = $boundsMatrix(baseBounds, multiMatrix);
997
- $poolBoundsObject(baseBounds);
998
- const xMax = +bounds.xMax;
999
- const xMin = +bounds.xMin;
1000
- const yMax = +bounds.yMax;
1001
- const yMin = +bounds.yMin;
1002
- $poolBoundsObject(bounds);
1003
- const width = $Math.abs(xMax - xMin);
1004
- const height = $Math.abs(yMax - yMin);
1005
- if (0 >= width || 0 >= height) {
1006
- $poolPreObject(object);
1007
- return null;
1008
- }
1009
- if (0 > xMin + width || 0 > yMin + height) {
1010
- $poolPreObject(object);
1011
- return null;
1012
- }
1013
- const currentAttachment = context
1014
- .frameBuffer
1015
- .currentAttachment;
1016
- if (!currentAttachment
1017
- || !currentAttachment.texture
1018
- || xMin > currentAttachment.width
1019
- || yMin > currentAttachment.height) {
1020
- $poolPreObject(object);
1021
- return null;
1022
- }
1023
- // set origin position
1024
- object.basePosition.x = rawMatrix[4];
1025
- object.basePosition.y = rawMatrix[5];
1026
- // check after size
1027
- const baseLayerBounds = this._$getLayerBounds(null);
1028
- const layerBounds = $boundsMatrix(baseLayerBounds, multiMatrix);
1029
- // filter size
1030
- let layerWidth = $Math.abs(layerBounds.xMax - layerBounds.xMin);
1031
- let layerHeight = $Math.abs(layerBounds.yMax - layerBounds.yMin);
1032
- $poolBoundsObject(layerBounds);
1033
- // move size
1034
- let tx = multiMatrix[4] - $Math.floor(xMin);
1035
- let ty = multiMatrix[5] - $Math.floor(yMin);
1036
- let dx = $Math.floor(xMin);
1037
- let dy = $Math.floor(yMin);
1038
- let originX = xMin;
1039
- let originY = yMin;
1040
- if (layerWidth !== width || layerHeight !== height) {
1041
- const layerMatrix = $getFloat32Array6(multiMatrix[0], multiMatrix[1], multiMatrix[2], multiMatrix[3], 0, 0);
1042
- const moveBounds = $boundsMatrix(baseLayerBounds, layerMatrix);
1043
- // pool
1044
- $poolFloat32Array6(layerMatrix);
1045
- tx += -$Math.floor(moveBounds.xMin) - tx;
1046
- ty += -$Math.floor(moveBounds.yMin) - ty;
1047
- dx -= -$Math.floor(moveBounds.xMin) - (multiMatrix[4] - dx);
1048
- dy -= -$Math.floor(moveBounds.yMin) - (multiMatrix[5] - dy);
1049
- originX -= -moveBounds.xMin - (multiMatrix[4] - originX);
1050
- originY -= -moveBounds.yMin - (multiMatrix[5] - originY);
1051
- $poolBoundsObject(moveBounds);
1052
- }
1053
- $poolBoundsObject(baseLayerBounds);
1054
- // set position
1055
- object.position.dx = dx > 0 ? dx : 0;
1056
- object.position.dy = dy > 0 ? dy : 0;
1057
- // resize
1058
- if (layerWidth + originX > currentAttachment.texture.width) {
1059
- layerWidth -= layerWidth - currentAttachment.texture.width + originX;
1060
- }
1061
- if (layerHeight + originY > currentAttachment.texture.height) {
1062
- layerHeight -= layerHeight - currentAttachment.texture.height + originY;
1063
- }
1064
- if (0 > dx) {
1065
- tx += dx;
1066
- layerWidth += originX;
1067
- }
1068
- if (0 > dy) {
1069
- ty += dy;
1070
- layerHeight += originY;
1071
- }
1072
- if (0 >= layerWidth || 0 >= layerHeight // size (-)
1073
- || !layerWidth || !layerHeight // NaN or Infinity
1074
- ) {
1075
- $poolPreObject(object);
1076
- return null;
1077
- }
1078
- // start layer
1079
- context._$startLayer($getBoundsObject(originX, 0, originY, 0));
1080
- // check cache
1081
- object.canApply = this._$canApply(filters);
1082
- const updated = this._$isFilterUpdated(layerWidth, layerHeight, multiMatrix, filters, object.canApply, object.basePosition.x, object.basePosition.y);
1083
- // current mask cache
1084
- context._$saveCurrentMask();
1085
- if (updated) {
1086
- context._$saveAttachment($Math.ceil(layerWidth), $Math.ceil(layerHeight), false);
1087
- }
1088
- // setup
1089
- object.isFilter = true;
1090
- object.isUpdated = updated;
1091
- object.color = $getFloat32Array8();
1092
- object.baseMatrix = multiMatrix;
1093
- object.filters = filters;
1094
- object.blendMode = blendMode;
1095
- object.layerWidth = layerWidth;
1096
- object.layerHeight = layerHeight;
1097
- object.matrix = $getFloat32Array6(multiMatrix[0], multiMatrix[1], multiMatrix[2], multiMatrix[3], tx, ty);
1098
- }
1099
- return object;
1100
- }
1101
- /**
1102
- * @param {CanvasToWebGLContext} context
1103
- * @param {Float32Array} matrix
1104
- * @param {Float32Array} color_transform
1105
- * @param {object} object
1106
- * @return {void}
1107
- * @method
1108
- * @private
1109
- */
1110
- _$postDraw(context, matrix, color_transform, object) {
1111
- // cache
1112
- const cacheKeys = $getArray(this._$instanceId, "f");
1113
- const player = $currentPlayer();
1114
- const cacheStore = player.cacheStore;
1115
- const manager = context.frameBuffer;
1116
- // cache or new texture
1117
- let texture = null;
1118
- if (object.isUpdated) {
1119
- texture = manager
1120
- .getTextureFromCurrentAttachment();
1121
- const cacheTexture = cacheStore.get(cacheKeys);
1122
- if (cacheTexture) {
1123
- cacheStore.set(cacheKeys, null);
1124
- manager.releaseTexture(cacheTexture);
1125
- }
1126
- }
1127
- else {
1128
- texture = cacheStore.get(cacheKeys);
1129
- if (!texture) {
1130
- throw new Error("the texture is null.");
1131
- }
1132
- }
1133
- // blend only
1134
- if (!object.canApply) {
1135
- texture._$offsetX = 0;
1136
- texture._$offsetY = 0;
1137
- }
1138
- // set cache offset
1139
- let offsetX = texture._$offsetX;
1140
- let offsetY = texture._$offsetY;
1141
- // execute filter
1142
- if (object.isUpdated && object.canApply) {
1143
- // cache clear
1144
- const cache = cacheStore.get(cacheKeys);
1145
- if (cache) {
1146
- // reset cache params
1147
- cacheStore.set(cacheKeys, null);
1148
- cache.layerWidth = 0;
1149
- cache.layerHeight = 0;
1150
- cache._$offsetX = 0;
1151
- cache._$offsetY = 0;
1152
- cache.matrix = null;
1153
- cache.colorTransform = null;
1154
- manager.releaseTexture(cache);
1155
- }
1156
- // apply filter
1157
- const filters = object.filters;
1158
- if (filters && filters.length) {
1159
- // init
1160
- context._$offsetX = 0;
1161
- context._$offsetY = 0;
1162
- for (let idx = 0; idx < filters.length; ++idx) {
1163
- texture = filters[idx]
1164
- ._$applyFilter(context, matrix);
1165
- }
1166
- offsetX = context._$offsetX;
1167
- offsetY = context._$offsetY;
1168
- // reset
1169
- context._$offsetX = 0;
1170
- context._$offsetY = 0;
1171
- // set offset
1172
- texture._$offsetX = offsetX;
1173
- texture._$offsetY = offsetY;
1174
- }
1175
- }
1176
- // update cache params
1177
- if (object.isUpdated) {
1178
- texture.filterState = object.canApply;
1179
- // cache texture
1180
- const matrix = object.baseMatrix;
1181
- if (matrix) {
1182
- texture.matrix = `${matrix[0]}_${matrix[1]}_${matrix[2]}_${matrix[3]}`;
1183
- }
1184
- texture.layerWidth = object.layerWidth;
1185
- texture.layerHeight = object.layerHeight;
1186
- }
1187
- // cache texture
1188
- cacheStore.set(cacheKeys, texture);
1189
- $poolArray(cacheKeys);
1190
- // set current buffer
1191
- if (object.isUpdated) {
1192
- context._$restoreAttachment();
1193
- }
1194
- // set
1195
- context.reset();
1196
- context.globalAlpha = $clamp(color_transform[3] + color_transform[7] / 255, 0, 1);
1197
- context.globalCompositeOperation = object.blendMode;
1198
- context.setTransform(1, 0, 0, 1, 0, 0);
1199
- context.drawImage(texture, -offsetX + object.position.dx, -offsetY + object.position.dy, texture.width, texture.height, color_transform);
1200
- // end blend
1201
- context._$endLayer();
1202
- // reset
1203
- context._$restoreCurrentMask();
1204
- // object pool
1205
- if (object.baseMatrix !== matrix) {
1206
- $poolFloat32Array6(object.baseMatrix);
1207
- }
1208
- $poolFloat32Array6(object.matrix);
1209
- $poolPreObject(object);
1210
- }
1211
- /**
1212
- * @param {CanvasToWebGLContext} context
1213
- * @param {Float32Array} matrix
1214
- * @param {Float32Array} color_transform
1215
- * @return {void}
1216
- * @method
1217
- * @private
1218
- */
1219
- _$draw(context, matrix, color_transform) {
1220
- // not draw
1221
- if (!this._$visible) {
1222
- return;
1223
- }
1224
- const transform = this._$transform;
1225
- let multiColor = color_transform;
1226
- const rawColor = transform._$rawColorTransform();
1227
- if (rawColor !== $COLOR_ARRAY_IDENTITY
1228
- && rawColor[0] !== 1 || rawColor[1] !== 1
1229
- || rawColor[2] !== 1 || rawColor[3] !== 1
1230
- || rawColor[4] !== 0 || rawColor[5] !== 0
1231
- || rawColor[6] !== 0 || rawColor[7] !== 0) {
1232
- multiColor = $multiplicationColor(color_transform, rawColor);
1233
- }
1234
- // not draw
1235
- const alpha = $clamp(multiColor[3] + multiColor[7] / 255, 0, 1, 0);
1236
- if (!alpha) {
1237
- return;
1238
- }
1239
- // not draw
1240
- const children = this._$getChildren();
1241
- const length = children.length;
1242
- const graphics = "_$graphics" in this
1243
- ? this._$graphics
1244
- : null;
1245
- if (!length && (!graphics || !graphics._$canDraw)) {
1246
- return;
1247
- }
1248
- // pre data
1249
- const preObject = this._$preDraw(context, matrix);
1250
- if (!preObject) {
1251
- return;
1252
- }
1253
- // use cache
1254
- if (preObject.isFilter && !preObject.isUpdated) {
1255
- this._$postDraw(context, matrix, multiColor, preObject);
1256
- return;
1257
- }
1258
- let preMatrix = preObject.matrix;
1259
- const preColorTransform = preObject.isFilter && preObject.color
1260
- ? preObject.color
1261
- : multiColor;
1262
- // if graphics draw
1263
- if (graphics && graphics._$canDraw) {
1264
- graphics._$draw(context, preMatrix, preColorTransform);
1265
- }
1266
- // init clip params
1267
- let shouldClip = true;
1268
- let clipDepth = 0;
1269
- const clipMatrix = $getArray();
1270
- const instanceMatrix = $getArray();
1271
- const clipStack = $getArray();
1272
- const shouldClips = $getArray();
1273
- const player = $currentPlayer();
1274
- // draw children
1275
- const isLayer = context.isLayer;
1276
- const isUpdate = this._$isUpdated();
1277
- for (let idx = 0; idx < length; ++idx) {
1278
- const instance = children[idx];
1279
- if (isUpdate) {
1280
- instance._$placeObject = null;
1281
- }
1282
- // mask instance
1283
- if (instance._$isMask) {
1284
- continue;
1285
- }
1286
- // not layer mode
1287
- const blendMode = instance._$blendMode || instance.blendMode;
1288
- if ((blendMode === "alpha" || blendMode === "erase")
1289
- && !isLayer) {
1290
- continue;
1291
- }
1292
- // mask end
1293
- if (clipDepth
1294
- && (instance._$placeId > clipDepth || instance._$clipDepth > 0)) {
1295
- context.restore();
1296
- if (shouldClip) {
1297
- context._$leaveClip();
1298
- if (clipMatrix.length) {
1299
- const matrix = clipMatrix.pop();
1300
- if (matrix) {
1301
- $poolFloat32Array6(preMatrix);
1302
- preMatrix = matrix;
1303
- }
1304
- }
1305
- }
1306
- // clear
1307
- clipDepth = clipStack.length ? clipStack.pop() || 0 : 0;
1308
- shouldClip = !!shouldClips.pop();
1309
- }
1310
- // mask size 0
1311
- if (!shouldClip) {
1312
- continue;
1313
- }
1314
- // mask start
1315
- if (instance._$clipDepth > 0) {
1316
- context.save();
1317
- if (clipDepth) {
1318
- clipStack.push(clipDepth);
1319
- }
1320
- shouldClips.push(shouldClip);
1321
- clipDepth = instance._$clipDepth;
1322
- shouldClip = instance._$shouldClip(preMatrix);
1323
- if (shouldClip) {
1324
- const adjMatrix = instance._$startClip(context, preMatrix);
1325
- if (adjMatrix === false) { // fixed
1326
- shouldClip = false;
1327
- continue;
1328
- }
1329
- if (adjMatrix instanceof Float32Array) {
1330
- clipMatrix.push(preMatrix);
1331
- preMatrix = adjMatrix;
1332
- }
1333
- }
1334
- continue;
1335
- }
1336
- // mask start
1337
- const maskInstance = instance._$mask;
1338
- if (maskInstance) {
1339
- maskInstance._$updated = false;
1340
- let maskMatrix;
1341
- if (this === maskInstance._$parent) {
1342
- maskMatrix = preMatrix;
1343
- }
1344
- else {
1345
- maskMatrix = $MATRIX_ARRAY_IDENTITY;
1346
- let parent = maskInstance._$parent;
1347
- while (parent) {
1348
- maskMatrix = $multiplicationMatrix(parent._$transform._$rawMatrix(), maskMatrix);
1349
- parent = parent._$parent;
1350
- }
1351
- const mScale = player.scaleX;
1352
- const playerMatrix = $getFloat32Array6(mScale, 0, 0, mScale, 0, 0);
1353
- maskMatrix = $multiplicationMatrix(playerMatrix, maskMatrix);
1354
- $poolFloat32Array6(playerMatrix);
1355
- if (context.isLayer) {
1356
- const currentPosition = context.getCurrentPosition();
1357
- maskMatrix[4] -= currentPosition.xMin;
1358
- maskMatrix[5] -= currentPosition.yMin;
1359
- }
1360
- if (context.cacheBounds) {
1361
- maskMatrix[4] -= context.cacheBounds.xMin;
1362
- maskMatrix[5] -= context.cacheBounds.yMin;
1363
- }
1364
- }
1365
- if (!maskInstance._$shouldClip(maskMatrix)) {
1366
- continue;
1367
- }
1368
- const adjMatrix = maskInstance._$startClip(context, maskMatrix);
1369
- context.save();
1370
- if (adjMatrix === false) { // fixed
1371
- context.restore();
1372
- continue;
1373
- }
1374
- if (adjMatrix instanceof Float32Array) {
1375
- instanceMatrix.push(preMatrix);
1376
- if (this !== maskInstance._$parent) {
1377
- const rawMatrix = transform._$rawMatrix();
1378
- adjMatrix[0] = $Math.abs(preMatrix[0]) * $Math.sign(rawMatrix[0]);
1379
- adjMatrix[1] = $Math.abs(preMatrix[1]) * $Math.sign(rawMatrix[1]);
1380
- adjMatrix[2] = $Math.abs(preMatrix[2]) * $Math.sign(rawMatrix[2]);
1381
- adjMatrix[3] = $Math.abs(preMatrix[3]) * $Math.sign(rawMatrix[3]);
1382
- adjMatrix[4] = preMatrix[4] - context.cacheBounds.xMin;
1383
- adjMatrix[5] = preMatrix[5] - context.cacheBounds.yMin;
1384
- }
1385
- preMatrix = adjMatrix;
1386
- }
1387
- }
1388
- instance._$draw(context, preMatrix, preColorTransform);
1389
- instance._$updated = false;
1390
- // mask end
1391
- if (maskInstance) {
1392
- context.restore();
1393
- context._$leaveClip();
1394
- if (instanceMatrix.length) {
1395
- const matrix = instanceMatrix.pop();
1396
- if (matrix) {
1397
- $poolFloat32Array6(preMatrix);
1398
- preMatrix = matrix;
1399
- }
1400
- }
1401
- }
1402
- }
1403
- // end mask
1404
- if (clipDepth) {
1405
- context.restore();
1406
- if (shouldClips.pop()) {
1407
- context._$leaveClip();
1408
- }
1409
- }
1410
- // object pool
1411
- $poolArray(clipMatrix);
1412
- $poolArray(instanceMatrix);
1413
- $poolArray(clipStack);
1414
- $poolArray(shouldClips);
1415
- // filter and blend
1416
- if (preObject.isFilter) {
1417
- return this._$postDraw(context, matrix, multiColor, preObject);
1418
- }
1419
- if (preObject.matrix !== matrix) {
1420
- $poolFloat32Array6(preObject.matrix);
1421
- }
1422
- if (multiColor !== color_transform) {
1423
- $poolFloat32Array8(multiColor);
1424
- }
1425
- $poolPreObject(preObject);
1426
- }
1427
- /**
1428
- * @param {CanvasRenderingContext2D} context
1429
- * @param {Float32Array} matrix
1430
- * @param {object} options
1431
- * @param {boolean} [mouse_children=true]
1432
- * @return {boolean}
1433
- * @method
1434
- * @private
1435
- */
1436
- _$mouseHit(context, matrix, options, mouse_children = true) {
1437
- let multiMatrix = matrix;
1438
- const rawMatrix = this._$transform._$rawMatrix();
1439
- if (rawMatrix !== $MATRIX_ARRAY_IDENTITY) {
1440
- multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
1441
- }
1442
- const children = this._$getChildren();
1443
- // mask set
1444
- const clips = $getArray();
1445
- const targets = $getArray();
1446
- const clipIndexes = $getMap();
1447
- let clipDepth = 0;
1448
- let clipIdx = 0;
1449
- for (let idx = 0; idx < children.length; ++idx) {
1450
- const instance = children[idx];
1451
- if (!instance._$visible && !instance._$hitObject) {
1452
- continue;
1453
- }
1454
- if (instance._$clipDepth) {
1455
- clipIdx = clips.length;
1456
- clipDepth = instance._$clipDepth;
1457
- clips.push(instance);
1458
- continue;
1459
- }
1460
- // clip end
1461
- if (clipDepth && instance._$placeId > clipDepth) {
1462
- clipIdx = 0;
1463
- clipDepth = 0;
1464
- }
1465
- // clip check on
1466
- if (clipIdx) {
1467
- clipIndexes.set(instance._$instanceId, clipIdx);
1468
- }
1469
- targets.push(instance);
1470
- }
1471
- // setup
1472
- const mouseChildren = this._$mouseChildren && mouse_children;
1473
- let hit = false;
1474
- const isRoot = this._$root === this;
1475
- while (targets.length) {
1476
- const instance = targets.pop();
1477
- if (instance._$isMask) {
1478
- continue;
1479
- }
1480
- if (isRoot && !(instance instanceof InteractiveObject)) {
1481
- continue;
1482
- }
1483
- // mask target
1484
- if (clipIndexes.has(instance._$instanceId)) {
1485
- const index = clipIndexes.get(instance._$instanceId);
1486
- if (!index) {
1487
- continue;
1488
- }
1489
- const clip = clips[index];
1490
- if (!clip._$hit(context, multiMatrix, options, true)) {
1491
- continue;
1492
- }
1493
- }
1494
- // mask hit test
1495
- const maskInstance = instance._$mask;
1496
- if (maskInstance) {
1497
- if (this === maskInstance._$parent) {
1498
- if (!maskInstance._$hit(context, multiMatrix, options, true)) {
1499
- continue;
1500
- }
1501
- }
1502
- else {
1503
- let maskMatrix = $MATRIX_ARRAY_IDENTITY;
1504
- let parent = maskInstance._$parent;
1505
- while (parent) {
1506
- maskMatrix = $multiplicationMatrix(parent._$transform._$rawMatrix(), maskMatrix);
1507
- parent = parent._$parent;
1508
- }
1509
- if (!maskInstance._$hit(context, maskMatrix, options, true)) {
1510
- continue;
1511
- }
1512
- }
1513
- }
1514
- if (instance._$mouseHit(context, multiMatrix, options, mouseChildren)
1515
- || instance._$hitArea
1516
- && instance
1517
- ._$hitArea
1518
- ._$mouseHit(context, multiMatrix, options, mouseChildren)) {
1519
- if (instance._$root === instance) {
1520
- return true;
1521
- }
1522
- if (!mouseChildren) {
1523
- return true;
1524
- }
1525
- hit = true;
1526
- if (instance instanceof InteractiveObject) {
1527
- if (!instance.mouseEnabled && !instance._$hitObject) {
1528
- continue;
1529
- }
1530
- if (!$isTouch && !options.pointer) {
1531
- if ("_$text" in instance
1532
- && "type" in instance
1533
- && instance.type === "input") {
1534
- options.pointer = "text";
1535
- }
1536
- if ("buttonMode" in instance
1537
- && "useHandCursor" in instance
1538
- && instance.buttonMode
1539
- && instance.useHandCursor) {
1540
- options.pointer = "pointer";
1541
- }
1542
- }
1543
- if (!options.hit) {
1544
- options.hit = !instance.mouseEnabled && instance._$hitObject
1545
- ? instance._$hitObject
1546
- : instance;
1547
- }
1548
- return true;
1549
- }
1550
- }
1551
- }
1552
- // pool
1553
- $poolArray(clips);
1554
- $poolArray(targets);
1555
- $poolMap(clipIndexes);
1556
- // graphics
1557
- if (!hit) {
1558
- const graphics = "_$graphics" in this
1559
- ? this._$graphics
1560
- : null;
1561
- if (graphics) {
1562
- hit = graphics._$hit(context, multiMatrix, options);
1563
- }
1564
- }
1565
- if (multiMatrix !== matrix) {
1566
- $poolFloat32Array6(multiMatrix);
1567
- }
1568
- // not found
1569
- return hit;
1570
- }
1571
- /**
1572
- * @param {CanvasRenderingContext2D} context
1573
- * @param {Float32Array} matrix
1574
- * @param {object} options
1575
- * @param {boolean} [is_clip=false]
1576
- * @return {boolean}
1577
- * @method
1578
- * @private
1579
- */
1580
- _$hit(context, matrix, options, is_clip = false) {
1581
- let multiMatrix = matrix;
1582
- const rawMatrix = this._$transform._$rawMatrix();
1583
- if (rawMatrix !== $MATRIX_ARRAY_IDENTITY) {
1584
- multiMatrix = $multiplicationMatrix(matrix, rawMatrix);
1585
- }
1586
- const children = this._$getChildren();
1587
- for (let idx = children.length; idx > -1; --idx) {
1588
- const instance = children[idx];
1589
- if (instance._$isMask) {
1590
- continue;
1591
- }
1592
- if (instance._$hit(context, multiMatrix, options, is_clip)) {
1593
- return true;
1594
- }
1595
- }
1596
- let hit = false;
1597
- const graphics = "_$graphics" in this
1598
- ? this._$graphics
1599
- : null;
1600
- if (graphics) {
1601
- hit = graphics._$hit(context, multiMatrix, options);
1602
- }
1603
- if (multiMatrix !== matrix) {
1604
- $poolFloat32Array6(multiMatrix);
1605
- }
1606
- return hit;
1607
- }
1608
- /**
1609
- * @param {number} index
1610
- * @return {DisplayObject}
1611
- * @method
1612
- * @private
1613
- */
1614
- _$createInstance(index) {
1615
- if (!this._$dictionary) {
1616
- throw new Error("the dictionary is null.");
1617
- }
1618
- // build
1619
- const tag = this._$dictionary[index];
1620
- const loaderInfo = this._$loaderInfo;
1621
- if (!loaderInfo || !loaderInfo._$data) {
1622
- throw new Error("the loaderInfo or data is null.");
1623
- }
1624
- const character = loaderInfo._$data.characters[tag.characterId];
1625
- // symbol class
1626
- const instance = $createInstance(character.extends);
1627
- instance._$build(tag, this);
1628
- instance._$id = index;
1629
- return instance;
1630
- }
1631
- /**
1632
- * @param {number} x
1633
- * @param {number} y
1634
- * @return {boolean}
1635
- * @method
1636
- * @private
1637
- */
1638
- _$outCheck(x, y) {
1639
- let matrix = $MATRIX_ARRAY_IDENTITY;
1640
- let parent = this._$parent;
1641
- while (parent) {
1642
- matrix = $multiplicationMatrix(parent._$transform._$rawMatrix(), matrix);
1643
- parent = parent._$parent;
1644
- }
1645
- $hitContext.setTransform(1, 0, 0, 1, 0, 0);
1646
- $hitContext.beginPath();
1647
- const options = {
1648
- "x": x,
1649
- "y": y,
1650
- "pointer": "",
1651
- "hit": null
1652
- };
1653
- return this._$mouseHit($hitContext, matrix, options);
1654
- }
1655
- /**
1656
- * @return {void}
1657
- * @method
1658
- * @private
1659
- */
1660
- _$createWorkerInstance() {
1661
- if (this._$created || !$rendererWorker) {
1662
- return;
1663
- }
1664
- this._$created = true;
1665
- const options = $getArray();
1666
- const message = {
1667
- "command": "createDisplayObjectContainer",
1668
- "instanceId": this._$instanceId,
1669
- "parentId": this._$parent ? this._$parent._$instanceId : -1
1670
- };
1671
- const graphics = "_$graphics" in this
1672
- ? this._$graphics
1673
- : null;
1674
- if (graphics) {
1675
- const recodes = graphics._$getRecodes();
1676
- options.push(recodes.buffer);
1677
- message.recodes = recodes;
1678
- message.maxAlpha = graphics._$maxAlpha;
1679
- message.canDraw = graphics._$canDraw;
1680
- message.xMin = graphics._$xMin;
1681
- message.yMin = graphics._$yMin;
1682
- message.xMax = graphics._$xMax;
1683
- message.yMax = graphics._$yMax;
1684
- }
1685
- $rendererWorker.postMessage(message, options);
1686
- }
1687
- /**
1688
- * @return {object}
1689
- * @method
1690
- * @private
1691
- */
1692
- _$postProperty() {
1693
- if (!$rendererWorker) {
1694
- return;
1695
- }
1696
- this._$postChildrenIds();
1697
- const options = $getArray();
1698
- const message = this._$createMessage();
1699
- const graphics = "_$graphics" in this
1700
- ? this._$graphics
1701
- : null;
1702
- if (graphics && !graphics._$buffer) {
1703
- message.maxAlpha = graphics._$maxAlpha;
1704
- message.canDraw = graphics._$canDraw;
1705
- const recodes = graphics._$getRecodes();
1706
- message.recodes = recodes;
1707
- options.push(recodes.buffer);
1708
- const bounds = this._$getBounds();
1709
- message.xMin = bounds.xMin;
1710
- message.yMin = bounds.yMin;
1711
- message.xMax = bounds.xMax;
1712
- message.yMax = bounds.yMax;
1713
- }
1714
- $rendererWorker
1715
- .postMessage(message, options);
1716
- $poolArray(options);
1717
- this._$posted = true;
1718
- this._$updated = false;
1719
- }
1720
- /**
1721
- * @param {array} [childrenIds=null]
1722
- * @return {void}
1723
- * @method
1724
- * @private
1725
- */
1726
- _$postChildrenIds(childrenIds = null) {
1727
- if (!$rendererWorker) {
1728
- return;
1729
- }
1730
- if (!childrenIds) {
1731
- const children = this._$getChildren();
1732
- childrenIds = $getArray();
1733
- for (let idx = 0; idx < children.length; ++idx) {
1734
- childrenIds.push(children[idx]._$instanceId);
1735
- }
1736
- $rendererWorker.postMessage({
1737
- "command": "setChildren",
1738
- "instanceId": this._$instanceId,
1739
- "children": childrenIds
1740
- });
1741
- $poolArray(childrenIds);
1742
- }
1743
- else {
1744
- $rendererWorker.postMessage({
1745
- "command": "setChildren",
1746
- "instanceId": this._$instanceId,
1747
- "children": childrenIds
1748
- });
1749
- }
1750
- }
1751
- }