@next2d/display 1.18.11 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/package.json +17 -28
  2. package/src/BitmapData/service/BitmapDataCanvasToBufferService.d.ts +10 -0
  3. package/src/BitmapData/service/BitmapDataCanvasToBufferService.js +22 -0
  4. package/src/BitmapData/service/BitmapDataImageToBufferService.d.ts +10 -0
  5. package/src/BitmapData/service/BitmapDataImageToBufferService.js +21 -0
  6. package/src/BitmapData.d.ts +71 -0
  7. package/src/BitmapData.js +133 -0
  8. package/{dist → src}/BlendMode.d.ts +4 -50
  9. package/{dist → src}/BlendMode.js +4 -58
  10. package/src/DisplayObject/service/DisplayObjectApplyChangesService.d.ts +11 -0
  11. package/src/DisplayObject/service/DisplayObjectApplyChangesService.js +16 -0
  12. package/src/DisplayObject/service/DisplayObjectBaseBuildService.d.ts +16 -0
  13. package/src/DisplayObject/service/DisplayObjectBaseBuildService.js +31 -0
  14. package/src/DisplayObject/service/DisplayObjectBlendToNumberService.d.ts +11 -0
  15. package/src/DisplayObject/service/DisplayObjectBlendToNumberService.js +45 -0
  16. package/src/DisplayObject/service/DisplayObjectBuildFilterService.d.ts +12 -0
  17. package/src/DisplayObject/service/DisplayObjectBuildFilterService.js +53 -0
  18. package/src/DisplayObject/service/DisplayObjectCalcBoundsMatrixService.d.ts +14 -0
  19. package/src/DisplayObject/service/DisplayObjectCalcBoundsMatrixService.js +31 -0
  20. package/src/DisplayObject/service/DisplayObjectDispatchAddedEventService.d.ts +11 -0
  21. package/src/DisplayObject/service/DisplayObjectDispatchAddedEventService.js +19 -0
  22. package/src/DisplayObject/service/DisplayObjectDispatchAddedToStageEventService.d.ts +11 -0
  23. package/src/DisplayObject/service/DisplayObjectDispatchAddedToStageEventService.js +21 -0
  24. package/src/DisplayObject/service/DisplayObjectDispatchRemovedEventService.d.ts +11 -0
  25. package/src/DisplayObject/service/DisplayObjectDispatchRemovedEventService.js +19 -0
  26. package/src/DisplayObject/service/DisplayObjectDispatchRemovedToStageEventService.d.ts +11 -0
  27. package/src/DisplayObject/service/DisplayObjectDispatchRemovedToStageEventService.js +27 -0
  28. package/src/DisplayObject/service/DisplayObjectGenerateHashService.d.ts +10 -0
  29. package/src/DisplayObject/service/DisplayObjectGenerateHashService.js +24 -0
  30. package/src/DisplayObject/service/DisplayObjectGetPlaceObjectService.d.ts +12 -0
  31. package/src/DisplayObject/service/DisplayObjectGetPlaceObjectService.js +41 -0
  32. package/src/DisplayObject/service/DisplayObjectGlobalToLocalService.d.ts +13 -0
  33. package/src/DisplayObject/service/DisplayObjectGlobalToLocalService.js +18 -0
  34. package/src/DisplayObject/service/DisplayObjectLocalToGlobalService.d.ts +13 -0
  35. package/src/DisplayObject/service/DisplayObjectLocalToGlobalService.js +17 -0
  36. package/src/DisplayObject/service/DisplayObjectRemoveService.d.ts +11 -0
  37. package/src/DisplayObject/service/DisplayObjectRemoveService.js +16 -0
  38. package/src/DisplayObject/usecase/DisplayObjectConcatenatedMatrixUseCase.d.ts +12 -0
  39. package/src/DisplayObject/usecase/DisplayObjectConcatenatedMatrixUseCase.js +25 -0
  40. package/src/DisplayObject/usecase/DisplayObjectGetAlphaUseCase.d.ts +11 -0
  41. package/src/DisplayObject/usecase/DisplayObjectGetAlphaUseCase.js +24 -0
  42. package/src/DisplayObject/usecase/DisplayObjectGetBlendModeUseCase.d.ts +12 -0
  43. package/src/DisplayObject/usecase/DisplayObjectGetBlendModeUseCase.js +19 -0
  44. package/src/DisplayObject/usecase/DisplayObjectGetBoundsUseCase.d.ts +13 -0
  45. package/src/DisplayObject/usecase/DisplayObjectGetBoundsUseCase.js +37 -0
  46. package/src/DisplayObject/usecase/DisplayObjectGetCalcBoundsUseCase.d.ts +11 -0
  47. package/src/DisplayObject/usecase/DisplayObjectGetCalcBoundsUseCase.js +28 -0
  48. package/src/DisplayObject/usecase/DisplayObjectGetColorTransformUseCase.d.ts +12 -0
  49. package/src/DisplayObject/usecase/DisplayObjectGetColorTransformUseCase.js +17 -0
  50. package/src/DisplayObject/usecase/DisplayObjectGetFiltersUseCase.d.ts +12 -0
  51. package/src/DisplayObject/usecase/DisplayObjectGetFiltersUseCase.js +25 -0
  52. package/src/DisplayObject/usecase/DisplayObjectGetHeightUseCase.d.ts +11 -0
  53. package/src/DisplayObject/usecase/DisplayObjectGetHeightUseCase.js +24 -0
  54. package/src/DisplayObject/usecase/DisplayObjectGetMatrixUseCase.d.ts +12 -0
  55. package/src/DisplayObject/usecase/DisplayObjectGetMatrixUseCase.js +17 -0
  56. package/src/DisplayObject/usecase/DisplayObjectGetRawBoundsUseCase.d.ts +11 -0
  57. package/src/DisplayObject/usecase/DisplayObjectGetRawBoundsUseCase.js +28 -0
  58. package/src/DisplayObject/usecase/DisplayObjectGetRawColorTransformUseCase.d.ts +11 -0
  59. package/src/DisplayObject/usecase/DisplayObjectGetRawColorTransformUseCase.js +25 -0
  60. package/src/DisplayObject/usecase/DisplayObjectGetRawMatrixUseCase.d.ts +12 -0
  61. package/src/DisplayObject/usecase/DisplayObjectGetRawMatrixUseCase.js +26 -0
  62. package/src/DisplayObject/usecase/DisplayObjectGetRotationUseCase.d.ts +11 -0
  63. package/src/DisplayObject/usecase/DisplayObjectGetRotationUseCase.js +23 -0
  64. package/src/DisplayObject/usecase/DisplayObjectGetScaleXUseCase.d.ts +11 -0
  65. package/src/DisplayObject/usecase/DisplayObjectGetScaleXUseCase.js +29 -0
  66. package/src/DisplayObject/usecase/DisplayObjectGetScaleYUseCase.d.ts +11 -0
  67. package/src/DisplayObject/usecase/DisplayObjectGetScaleYUseCase.js +29 -0
  68. package/src/DisplayObject/usecase/DisplayObjectGetWidthUseCase.d.ts +11 -0
  69. package/src/DisplayObject/usecase/DisplayObjectGetWidthUseCase.js +24 -0
  70. package/src/DisplayObject/usecase/DisplayObjectGetXUseCase.d.ts +11 -0
  71. package/src/DisplayObject/usecase/DisplayObjectGetXUseCase.js +16 -0
  72. package/src/DisplayObject/usecase/DisplayObjectGetYUseCase.d.ts +11 -0
  73. package/src/DisplayObject/usecase/DisplayObjectGetYUseCase.js +16 -0
  74. package/src/DisplayObject/usecase/DisplayObjectHitTestObjectUseCase.d.ts +10 -0
  75. package/src/DisplayObject/usecase/DisplayObjectHitTestObjectUseCase.js +35 -0
  76. package/src/DisplayObject/usecase/DisplayObjectHitTestPointUseCase.d.ts +14 -0
  77. package/src/DisplayObject/usecase/DisplayObjectHitTestPointUseCase.js +69 -0
  78. package/src/DisplayObject/usecase/DisplayObjectIsMaskReflectedInDisplayUseCase.d.ts +16 -0
  79. package/src/DisplayObject/usecase/DisplayObjectIsMaskReflectedInDisplayUseCase.js +59 -0
  80. package/src/DisplayObject/usecase/DisplayObjectSetAlphaUseCase.d.ts +12 -0
  81. package/src/DisplayObject/usecase/DisplayObjectSetAlphaUseCase.js +32 -0
  82. package/src/DisplayObject/usecase/DisplayObjectSetBlendModeUseCase.d.ts +13 -0
  83. package/src/DisplayObject/usecase/DisplayObjectSetBlendModeUseCase.js +18 -0
  84. package/src/DisplayObject/usecase/DisplayObjectSetFiltersUseCase.d.ts +13 -0
  85. package/src/DisplayObject/usecase/DisplayObjectSetFiltersUseCase.js +15 -0
  86. package/src/DisplayObject/usecase/DisplayObjectSetHeightUseCase.d.ts +12 -0
  87. package/src/DisplayObject/usecase/DisplayObjectSetHeightUseCase.js +30 -0
  88. package/src/DisplayObject/usecase/DisplayObjectSetRotationUseCase.d.ts +12 -0
  89. package/src/DisplayObject/usecase/DisplayObjectSetRotationUseCase.js +63 -0
  90. package/src/DisplayObject/usecase/DisplayObjectSetScaleXUseCase.d.ts +12 -0
  91. package/src/DisplayObject/usecase/DisplayObjectSetScaleXUseCase.js +48 -0
  92. package/src/DisplayObject/usecase/DisplayObjectSetScaleYUseCase.d.ts +12 -0
  93. package/src/DisplayObject/usecase/DisplayObjectSetScaleYUseCase.js +48 -0
  94. package/src/DisplayObject/usecase/DisplayObjectSetWidthUseCase.d.ts +12 -0
  95. package/src/DisplayObject/usecase/DisplayObjectSetWidthUseCase.js +30 -0
  96. package/src/DisplayObject/usecase/DisplayObjectSetXUseCase.d.ts +12 -0
  97. package/src/DisplayObject/usecase/DisplayObjectSetXUseCase.js +27 -0
  98. package/src/DisplayObject/usecase/DisplayObjectSetYUseCase.d.ts +12 -0
  99. package/src/DisplayObject/usecase/DisplayObjectSetYUseCase.js +27 -0
  100. package/src/DisplayObject.d.ts +706 -0
  101. package/src/DisplayObject.js +1094 -0
  102. package/src/DisplayObjectContainer/service/DisplayObjectContainerAddedToStageService.d.ts +11 -0
  103. package/src/DisplayObjectContainer/service/DisplayObjectContainerAddedToStageService.js +24 -0
  104. package/src/DisplayObjectContainer/service/DisplayObjectContainerAssignStageAndRootService.d.ts +11 -0
  105. package/src/DisplayObjectContainer/service/DisplayObjectContainerAssignStageAndRootService.js +26 -0
  106. package/src/DisplayObjectContainer/service/DisplayObjectContainerContainsService.d.ts +13 -0
  107. package/src/DisplayObjectContainer/service/DisplayObjectContainerContainsService.js +32 -0
  108. package/src/DisplayObjectContainer/service/DisplayObjectContainerGetChildAtService.d.ts +13 -0
  109. package/src/DisplayObjectContainer/service/DisplayObjectContainerGetChildAtService.js +14 -0
  110. package/src/DisplayObjectContainer/service/DisplayObjectContainerGetChildByNameService.d.ts +13 -0
  111. package/src/DisplayObjectContainer/service/DisplayObjectContainerGetChildByNameService.js +24 -0
  112. package/src/DisplayObjectContainer/service/DisplayObjectContainerRemovedToStageService.d.ts +12 -0
  113. package/src/DisplayObjectContainer/service/DisplayObjectContainerRemovedToStageService.js +24 -0
  114. package/src/DisplayObjectContainer/service/DisplayObjectContainerUnAssignStageAndRootService.d.ts +11 -0
  115. package/src/DisplayObjectContainer/service/DisplayObjectContainerUnAssignStageAndRootService.js +29 -0
  116. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerAddChildUseCase.d.ts +13 -0
  117. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerAddChildUseCase.js +53 -0
  118. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerAdvanceFrameUseCase.d.ts +11 -0
  119. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerAdvanceFrameUseCase.js +39 -0
  120. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerCalcBoundsMatrixUseCase.d.ts +11 -0
  121. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerCalcBoundsMatrixUseCase.js +62 -0
  122. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerGenerateClipQueueUseCase.d.ts +13 -0
  123. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerGenerateClipQueueUseCase.js +49 -0
  124. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerGenerateRenderQueueUseCase.d.ts +18 -0
  125. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerGenerateRenderQueueUseCase.js +163 -0
  126. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerMouseHitUseCase.d.ts +17 -0
  127. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerMouseHitUseCase.js +206 -0
  128. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerPrepareUseCase.d.ts +11 -0
  129. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerPrepareUseCase.js +32 -0
  130. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerRawBoundsMatrixUseCase.d.ts +12 -0
  131. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerRawBoundsMatrixUseCase.js +62 -0
  132. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerRemoveChildAtUseCase.d.ts +12 -0
  133. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerRemoveChildAtUseCase.js +19 -0
  134. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerRemoveChildUseCase.d.ts +13 -0
  135. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerRemoveChildUseCase.js +66 -0
  136. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerRemoveChildrenUseCase.d.ts +12 -0
  137. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerRemoveChildrenUseCase.js +25 -0
  138. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerSetChildIndexUseCase.d.ts +14 -0
  139. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerSetChildIndexUseCase.js +22 -0
  140. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerSwapChildrenAtUseCase.d.ts +13 -0
  141. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerSwapChildrenAtUseCase.js +23 -0
  142. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerSwapChildrenUseCase.d.ts +14 -0
  143. package/src/DisplayObjectContainer/usecase/DisplayObjectContainerSwapChildrenUseCase.js +23 -0
  144. package/src/DisplayObjectContainer.d.ts +229 -0
  145. package/src/DisplayObjectContainer.js +317 -0
  146. package/src/DisplayObjectUtil.d.ts +288 -0
  147. package/src/DisplayObjectUtil.js +465 -0
  148. package/src/FrameLabel.d.ts +45 -0
  149. package/src/FrameLabel.js +59 -0
  150. package/src/Graphics/service/GraphicsCalcFillBoundsService.d.ts +13 -0
  151. package/src/Graphics/service/GraphicsCalcFillBoundsService.js +17 -0
  152. package/src/Graphics/service/GraphicsCalcLineBoundsService.d.ts +17 -0
  153. package/src/Graphics/service/GraphicsCalcLineBoundsService.js +58 -0
  154. package/src/Graphics/service/GraphicsDrawEllipseService.d.ts +15 -0
  155. package/src/Graphics/service/GraphicsDrawEllipseService.js +36 -0
  156. package/src/Graphics/service/GraphicsDrawRectService.d.ts +15 -0
  157. package/src/Graphics/service/GraphicsDrawRectService.js +28 -0
  158. package/src/Graphics/service/GraphicsDrawRoundRectService.d.ts +17 -0
  159. package/src/Graphics/service/GraphicsDrawRoundRectService.js +48 -0
  160. package/src/Graphics/service/GraphicsHitTestService.d.ts +13 -0
  161. package/src/Graphics/service/GraphicsHitTestService.js +73 -0
  162. package/src/Graphics/service/GraphicsMargePathService.d.ts +15 -0
  163. package/src/Graphics/service/GraphicsMargePathService.js +23 -0
  164. package/src/Graphics/service/GraphicsToNumberArrayService.d.ts +10 -0
  165. package/src/Graphics/service/GraphicsToNumberArrayService.js +242 -0
  166. package/src/Graphics/usecase/GraphicsCalcBoundsUseCase.d.ts +17 -0
  167. package/src/Graphics/usecase/GraphicsCalcBoundsUseCase.js +28 -0
  168. package/{dist → src}/Graphics.d.ts +240 -217
  169. package/src/Graphics.js +1224 -0
  170. package/{dist → src}/GraphicsBitmapFill.d.ts +4 -5
  171. package/{dist → src}/GraphicsBitmapFill.js +29 -6
  172. package/{dist → src}/GraphicsGradientFill.d.ts +12 -13
  173. package/{dist → src}/GraphicsGradientFill.js +68 -19
  174. package/src/InteractiveObject.d.ts +37 -0
  175. package/src/InteractiveObject.js +51 -0
  176. package/src/Loader/service/LoaderBuildService.d.ts +13 -0
  177. package/src/Loader/service/LoaderBuildService.js +46 -0
  178. package/src/Loader/service/LoaderLoadStartEventService.d.ts +12 -0
  179. package/src/Loader/service/LoaderLoadStartEventService.js +19 -0
  180. package/src/Loader/service/LoaderProgressEventService.d.ts +12 -0
  181. package/src/Loader/service/LoaderProgressEventService.js +16 -0
  182. package/src/Loader/usecase/LoaderLoadEndEventUseCase.d.ts +12 -0
  183. package/src/Loader/usecase/LoaderLoadEndEventUseCase.js +39 -0
  184. package/src/Loader/usecase/LoaderLoadJsonUseCase.d.ts +14 -0
  185. package/src/Loader/usecase/LoaderLoadJsonUseCase.js +33 -0
  186. package/src/Loader/usecase/LoaderLoadUseCase.d.ts +14 -0
  187. package/src/Loader/usecase/LoaderLoadUseCase.js +39 -0
  188. package/src/Loader/worker/ZlibInflateWorker.d.ts +2 -0
  189. package/src/Loader/worker/ZlibInflateWorker.js +20 -0
  190. package/src/Loader.d.ts +82 -0
  191. package/src/Loader.js +104 -0
  192. package/src/LoaderInfo.d.ts +68 -0
  193. package/src/LoaderInfo.js +96 -0
  194. package/src/LoopConfig.d.ts +61 -0
  195. package/src/LoopConfig.js +86 -0
  196. package/src/LoopType.d.ts +59 -0
  197. package/src/LoopType.js +69 -0
  198. package/src/MovieClip/service/MovieClipAddActionsService.d.ts +12 -0
  199. package/src/MovieClip/service/MovieClipAddActionsService.js +27 -0
  200. package/src/MovieClip/service/MovieClipAddFrameLabelService.d.ts +13 -0
  201. package/src/MovieClip/service/MovieClipAddFrameLabelService.js +16 -0
  202. package/src/MovieClip/service/MovieClipAddLabelsService.d.ts +13 -0
  203. package/src/MovieClip/service/MovieClipAddLabelsService.js +20 -0
  204. package/src/MovieClip/service/MovieClipBuildSoundsService.d.ts +15 -0
  205. package/src/MovieClip/service/MovieClipBuildSoundsService.js +47 -0
  206. package/src/MovieClip/service/MovieClipCurrentFrameLabelService.d.ts +12 -0
  207. package/src/MovieClip/service/MovieClipCurrentFrameLabelService.js +19 -0
  208. package/src/MovieClip/service/MovieClipCurrentLabelsService.d.ts +12 -0
  209. package/src/MovieClip/service/MovieClipCurrentLabelsService.js +14 -0
  210. package/src/MovieClip/service/MovieClipDispatchFrameLabelEventService.d.ts +13 -0
  211. package/src/MovieClip/service/MovieClipDispatchFrameLabelEventService.js +24 -0
  212. package/src/MovieClip/service/MovieClipGetChildrenService.d.ts +13 -0
  213. package/src/MovieClip/service/MovieClipGetChildrenService.js +133 -0
  214. package/src/MovieClip/service/MovieClipGetFrameForLabelService.d.ts +12 -0
  215. package/src/MovieClip/service/MovieClipGetFrameForLabelService.js +22 -0
  216. package/src/MovieClip/service/MovieClipSetActionService.d.ts +12 -0
  217. package/src/MovieClip/service/MovieClipSetActionService.js +21 -0
  218. package/src/MovieClip/service/MovieClipSetSoundsService.d.ts +13 -0
  219. package/src/MovieClip/service/MovieClipSetSoundsService.js +21 -0
  220. package/src/MovieClip/usecase/MovieClipAdvanceFrameUseCase.d.ts +11 -0
  221. package/src/MovieClip/usecase/MovieClipAdvanceFrameUseCase.js +36 -0
  222. package/src/MovieClip/usecase/MovieClipBuildDictionaryCharacterUseCase.d.ts +17 -0
  223. package/src/MovieClip/usecase/MovieClipBuildDictionaryCharacterUseCase.js +51 -0
  224. package/src/MovieClip/usecase/MovieClipBuildFromCharacterUseCase.d.ts +12 -0
  225. package/src/MovieClip/usecase/MovieClipBuildFromCharacterUseCase.js +33 -0
  226. package/src/MovieClip/usecase/MovieClipGoToFrameUseCase.d.ts +12 -0
  227. package/src/MovieClip/usecase/MovieClipGoToFrameUseCase.js +58 -0
  228. package/src/MovieClip/usecase/MovieClipGotoAndPlayUseCase.d.ts +12 -0
  229. package/src/MovieClip/usecase/MovieClipGotoAndPlayUseCase.js +15 -0
  230. package/src/MovieClip/usecase/MovieClipGotoAndStopUseCase.d.ts +12 -0
  231. package/src/MovieClip/usecase/MovieClipGotoAndStopUseCase.js +16 -0
  232. package/src/MovieClip/usecase/MovieClipNextFrameUseCase.d.ts +11 -0
  233. package/src/MovieClip/usecase/MovieClipNextFrameUseCase.js +17 -0
  234. package/src/MovieClip/usecase/MovieClipPrepareActionUseCase.d.ts +11 -0
  235. package/src/MovieClip/usecase/MovieClipPrepareActionUseCase.js +21 -0
  236. package/src/MovieClip/usecase/MovieClipPrepareSoundUseCase.d.ts +11 -0
  237. package/src/MovieClip/usecase/MovieClipPrepareSoundUseCase.js +18 -0
  238. package/src/MovieClip/usecase/MovieClipPrevFrameUseCase.d.ts +11 -0
  239. package/src/MovieClip/usecase/MovieClipPrevFrameUseCase.js +17 -0
  240. package/{dist → src}/MovieClip.d.ts +128 -167
  241. package/src/MovieClip.js +409 -0
  242. package/src/Shape/service/ShapeGetRawBoundsService.d.ts +10 -0
  243. package/src/Shape/service/ShapeGetRawBoundsService.js +13 -0
  244. package/src/Shape/usecase/ShapeBuildFromCharacterUseCase.d.ts +13 -0
  245. package/src/Shape/usecase/ShapeBuildFromCharacterUseCase.js +121 -0
  246. package/src/Shape/usecase/ShapeCalcBoundsMatrixUseCase.d.ts +12 -0
  247. package/src/Shape/usecase/ShapeCalcBoundsMatrixUseCase.js +30 -0
  248. package/src/Shape/usecase/ShapeClearBitmapBufferUseCase.d.ts +11 -0
  249. package/src/Shape/usecase/ShapeClearBitmapBufferUseCase.js +24 -0
  250. package/src/Shape/usecase/ShapeGenerateClipQueueUseCase.d.ts +12 -0
  251. package/src/Shape/usecase/ShapeGenerateClipQueueUseCase.js +30 -0
  252. package/src/Shape/usecase/ShapeGenerateRenderQueueUseCase.d.ts +17 -0
  253. package/src/Shape/usecase/ShapeGenerateRenderQueueUseCase.js +241 -0
  254. package/src/Shape/usecase/ShapeHitTestUseCase.d.ts +15 -0
  255. package/src/Shape/usecase/ShapeHitTestUseCase.js +34 -0
  256. package/src/Shape/usecase/ShapeLoadSrcUseCase.d.ts +12 -0
  257. package/src/Shape/usecase/ShapeLoadSrcUseCase.js +32 -0
  258. package/src/Shape/usecase/ShapeSetBitmapBufferUseCase.d.ts +14 -0
  259. package/src/Shape/usecase/ShapeSetBitmapBufferUseCase.js +22 -0
  260. package/src/Shape.d.ts +153 -0
  261. package/src/Shape.js +235 -0
  262. package/src/Sprite/service/SpriteStartDragService.d.ts +14 -0
  263. package/src/Sprite/service/SpriteStartDragService.js +22 -0
  264. package/src/Sprite/service/SpriteStopDragService.d.ts +11 -0
  265. package/src/Sprite/service/SpriteStopDragService.js +17 -0
  266. package/src/Sprite.d.ts +126 -0
  267. package/src/Sprite.js +192 -0
  268. package/src/Stage/service/StageExecuteFrameActionsService.d.ts +9 -0
  269. package/src/Stage/service/StageExecuteFrameActionsService.js +34 -0
  270. package/src/Stage/service/StageExecuteFrameSoundsService.d.ts +9 -0
  271. package/src/Stage/service/StageExecuteFrameSoundsService.js +35 -0
  272. package/src/Stage/usecase/StageGenerateRenderQueueUseCase.d.ts +18 -0
  273. package/src/Stage/usecase/StageGenerateRenderQueueUseCase.js +42 -0
  274. package/src/Stage/usecase/StageReadyUseCase.d.ts +11 -0
  275. package/src/Stage/usecase/StageReadyUseCase.js +20 -0
  276. package/src/Stage/usecase/StageTickerUseCase.d.ts +9 -0
  277. package/src/Stage/usecase/StageTickerUseCase.js +20 -0
  278. package/src/Stage.d.ts +161 -0
  279. package/src/Stage.js +240 -0
  280. package/src/TextField/service/TextFieldGetRawBoundsService.d.ts +10 -0
  281. package/src/TextField/service/TextFieldGetRawBoundsService.js +12 -0
  282. package/src/TextField/usecase/TextFieldCalcBoundsMatrixUseCase.d.ts +12 -0
  283. package/src/TextField/usecase/TextFieldCalcBoundsMatrixUseCase.js +30 -0
  284. package/src/TextField/usecase/TextFieldGenerateRenderQueueUseCase.d.ts +17 -0
  285. package/src/TextField/usecase/TextFieldGenerateRenderQueueUseCase.js +200 -0
  286. package/src/TextField/usecase/TextFieldHitTestUseCase.d.ts +15 -0
  287. package/src/TextField/usecase/TextFieldHitTestUseCase.js +36 -0
  288. package/src/Video/service/VideoGetRawBoundsService.d.ts +11 -0
  289. package/src/Video/service/VideoGetRawBoundsService.js +13 -0
  290. package/src/Video/usecase/VideoCalcBoundsMatrixUseCase.d.ts +12 -0
  291. package/src/Video/usecase/VideoCalcBoundsMatrixUseCase.js +30 -0
  292. package/src/Video/usecase/VideoGenerateRenderQueueUseCase.d.ts +18 -0
  293. package/src/Video/usecase/VideoGenerateRenderQueueUseCase.js +177 -0
  294. package/src/Video/usecase/VideoHitTestUseCase.d.ts +15 -0
  295. package/src/Video/usecase/VideoHitTestUseCase.js +37 -0
  296. package/{dist → src}/index.d.ts +0 -3
  297. package/{dist → src}/index.js +0 -3
  298. package/src/interface/IAjaxEvent.d.ts +5 -0
  299. package/src/interface/IAjaxEvent.js +1 -0
  300. package/src/interface/IAjaxOption.d.ts +13 -0
  301. package/src/interface/IAjaxOption.js +1 -0
  302. package/src/interface/IAnimationToolData.d.ts +8 -0
  303. package/src/interface/IAnimationToolData.js +1 -0
  304. package/src/interface/IAnimationToolDataZlib.d.ts +4 -0
  305. package/src/interface/IAnimationToolDataZlib.js +1 -0
  306. package/src/interface/IBlendMode.d.ts +1 -0
  307. package/src/interface/IBlendMode.js +1 -0
  308. package/src/interface/IBounds.d.ts +6 -0
  309. package/src/interface/IBounds.js +1 -0
  310. package/src/interface/ICapsStyle.d.ts +1 -0
  311. package/src/interface/ICapsStyle.js +1 -0
  312. package/src/interface/ICharacter.d.ts +5 -0
  313. package/src/interface/ICharacter.js +1 -0
  314. package/src/interface/IColorStop.d.ts +7 -0
  315. package/src/interface/IColorStop.js +1 -0
  316. package/src/interface/IDictionaryTag.d.ts +8 -0
  317. package/src/interface/IDictionaryTag.js +1 -0
  318. package/src/interface/IDisplayObject.d.ts +2 -0
  319. package/src/interface/IDisplayObject.js +1 -0
  320. package/src/interface/IFilterArray.d.ts +2 -0
  321. package/src/interface/IFilterArray.js +1 -0
  322. package/src/interface/IGradientType.d.ts +1 -0
  323. package/src/interface/IGradientType.js +1 -0
  324. package/src/interface/IGrid.d.ts +6 -0
  325. package/src/interface/IGrid.js +1 -0
  326. package/src/interface/IInterpolationMethod.d.ts +1 -0
  327. package/src/interface/IInterpolationMethod.js +1 -0
  328. package/src/interface/IJointStyle.d.ts +1 -0
  329. package/src/interface/IJointStyle.js +1 -0
  330. package/src/interface/ILoaderInfoData.d.ts +7 -0
  331. package/src/interface/ILoaderInfoData.js +1 -0
  332. package/src/interface/ILoopConfig.d.ts +8 -0
  333. package/src/interface/ILoopConfig.js +1 -0
  334. package/src/interface/ILoopType.d.ts +1 -0
  335. package/src/interface/ILoopType.js +1 -0
  336. package/src/interface/IMovieClipActionObject.d.ts +5 -0
  337. package/src/interface/IMovieClipActionObject.js +1 -0
  338. package/src/interface/IMovieClipCharacter.d.ts +17 -0
  339. package/src/interface/IMovieClipCharacter.js +1 -0
  340. package/src/interface/IMovieClipLabelObject.d.ts +4 -0
  341. package/src/interface/IMovieClipLabelObject.js +1 -0
  342. package/src/interface/IMovieClipSoundObject.d.ts +5 -0
  343. package/src/interface/IMovieClipSoundObject.js +1 -0
  344. package/src/interface/IParent.d.ts +2 -0
  345. package/src/interface/IParent.js +1 -0
  346. package/src/interface/IPlaceObject.d.ts +14 -0
  347. package/src/interface/IPlaceObject.js +1 -0
  348. package/src/interface/IPlayerHitObject.d.ts +7 -0
  349. package/src/interface/IPlayerHitObject.js +1 -0
  350. package/src/interface/IShapeCharacter.d.ts +14 -0
  351. package/src/interface/IShapeCharacter.js +1 -0
  352. package/src/interface/ISoundCharacter.d.ts +4 -0
  353. package/src/interface/ISoundCharacter.js +1 -0
  354. package/src/interface/ISoundTag.d.ts +6 -0
  355. package/src/interface/ISoundTag.js +1 -0
  356. package/src/interface/ISpreadMethod.d.ts +1 -0
  357. package/src/interface/ISpreadMethod.js +1 -0
  358. package/src/interface/ISprite.d.ts +2 -0
  359. package/src/interface/ISprite.js +1 -0
  360. package/src/interface/IStageData.d.ts +6 -0
  361. package/src/interface/IStageData.js +1 -0
  362. package/src/interface/ISurfaceFilter.d.ts +6 -0
  363. package/src/interface/ISurfaceFilter.js +1 -0
  364. package/src/interface/ITextFieldCharacter.d.ts +26 -0
  365. package/src/interface/ITextFieldCharacter.js +1 -0
  366. package/src/interface/ITextFieldType.d.ts +1 -0
  367. package/src/interface/ITextFieldType.js +1 -0
  368. package/src/interface/ITextFormatAlign.d.ts +1 -0
  369. package/src/interface/ITextFormatAlign.js +1 -0
  370. package/src/interface/IURLLoaderDataFormat.d.ts +1 -0
  371. package/src/interface/IURLLoaderDataFormat.js +1 -0
  372. package/src/interface/IURLRequestHeader.d.ts +4 -0
  373. package/src/interface/IURLRequestHeader.js +1 -0
  374. package/src/interface/IURLRequestMethod.d.ts +1 -0
  375. package/src/interface/IURLRequestMethod.js +1 -0
  376. package/src/interface/IVideoCharacter.d.ts +11 -0
  377. package/src/interface/IVideoCharacter.js +1 -0
  378. package/dist/BitmapData.d.ts +0 -151
  379. package/dist/BitmapData.js +0 -416
  380. package/dist/DisplayObject.d.ts +0 -563
  381. package/dist/DisplayObject.js +0 -1791
  382. package/dist/DisplayObjectContainer.d.ts +0 -346
  383. package/dist/DisplayObjectContainer.js +0 -1608
  384. package/dist/FrameLabel.d.ts +0 -98
  385. package/dist/FrameLabel.js +0 -120
  386. package/dist/Graphics.js +0 -2304
  387. package/dist/InteractiveObject.d.ts +0 -32
  388. package/dist/InteractiveObject.js +0 -43
  389. package/dist/Loader.d.ts +0 -140
  390. package/dist/Loader.js +0 -319
  391. package/dist/LoaderInfo.d.ts +0 -120
  392. package/dist/LoaderInfo.js +0 -184
  393. package/dist/LoopConfig.d.ts +0 -108
  394. package/dist/LoopConfig.js +0 -156
  395. package/dist/LoopType.d.ts +0 -104
  396. package/dist/LoopType.js +0 -122
  397. package/dist/MovieClip.js +0 -934
  398. package/dist/Shape.d.ts +0 -162
  399. package/dist/Shape.js +0 -517
  400. package/dist/Sprite.d.ts +0 -158
  401. package/dist/Sprite.js +0 -258
  402. package/dist/Stage.d.ts +0 -164
  403. package/dist/Stage.js +0 -252
  404. package/dist/TextField.d.ts +0 -656
  405. package/dist/TextField.js +0 -2807
@@ -0,0 +1,1224 @@
1
+ import { GraphicsBitmapFill } from "./GraphicsBitmapFill";
2
+ import { GraphicsGradientFill } from "./GraphicsGradientFill";
3
+ import { execute as graphicsCalcBoundsUseCase } from "./Graphics/usecase/GraphicsCalcBoundsUseCase";
4
+ import { execute as graphicsMargePathService } from "./Graphics/service/GraphicsMargePathService";
5
+ import { execute as graphicsDrawEllipseService } from "./Graphics/service/GraphicsDrawEllipseService";
6
+ import { execute as graphicsDrawRectService } from "./Graphics/service/GraphicsDrawRectService";
7
+ import { execute as graphicsDrawRoundRectService } from "./Graphics/service/GraphicsDrawRoundRectService";
8
+ import { execute as graphicsToNumberArrayService } from "./Graphics/service/GraphicsToNumberArrayService";
9
+ import { $getArray, $poolArray, $clamp, $convertColorStringToNumber } from "./DisplayObjectUtil";
10
+ /**
11
+ * @description Graphics クラスには、ベクターシェイプの作成に使用できる一連のメソッドがあります。
12
+ * 描画をサポートする表示オブジェクトには、Sprite および Shape オブジェクトがあります。
13
+ * これらの各クラスには、Graphics オブジェクトである graphics プロパティがあります。
14
+ * 以下は、簡単に使用できるように用意されているヘルパー関数の一例です。
15
+ * drawRect()、drawRoundRect()、drawCircle()、および drawEllipse()。
16
+ *
17
+ * The Graphics class contains a set of methods that you can use to create a vector shape.
18
+ * Display objects that support drawing include Sprite and Shape objects.
19
+ * Each of these classes includes a graphics property that is a Graphics object.
20
+ * The following are among those helper functions provided for ease of use:
21
+ * drawRect(), drawRoundRect(), drawCircle(), and drawEllipse().
22
+ *
23
+ * @class
24
+ * @memberOf next2d.display
25
+ */
26
+ export class Graphics {
27
+ /**
28
+ * @constructor
29
+ * @public
30
+ */
31
+ constructor() {
32
+ /**
33
+ * @description グラフィックの確認フラグ
34
+ * Graphic confirmation flag
35
+ *
36
+ * @type {boolean}
37
+ * @default false
38
+ * @public
39
+ */
40
+ Object.defineProperty(this, "isConfirmed", {
41
+ enumerable: true,
42
+ configurable: true,
43
+ writable: true,
44
+ value: void 0
45
+ });
46
+ /**
47
+ * @description グラフィックの最小x座標
48
+ * Minimum x coordinate of graphic
49
+ *
50
+ * @type {number}
51
+ * @default Number.MAX_VALUE
52
+ * @public
53
+ */
54
+ Object.defineProperty(this, "xMin", {
55
+ enumerable: true,
56
+ configurable: true,
57
+ writable: true,
58
+ value: void 0
59
+ });
60
+ /**
61
+ * @description グラフィックの最小y座標
62
+ * Minimum y coordinate of graphic
63
+ *
64
+ * @type {number}
65
+ * @default Number.MAX_VALUE
66
+ * @public
67
+ */
68
+ Object.defineProperty(this, "yMin", {
69
+ enumerable: true,
70
+ configurable: true,
71
+ writable: true,
72
+ value: void 0
73
+ });
74
+ /**
75
+ * @description グラフィックの最大x座標
76
+ * Maximum x coordinate of graphic
77
+ *
78
+ * @type {number}
79
+ * @default -Number.MAX_VALUE
80
+ * @public
81
+ */
82
+ Object.defineProperty(this, "xMax", {
83
+ enumerable: true,
84
+ configurable: true,
85
+ writable: true,
86
+ value: void 0
87
+ });
88
+ /**
89
+ * @description グラフィックの最大y座標
90
+ * Maximum y coordinate of graphic
91
+ *
92
+ * @type {number}
93
+ * @default -Number.MAX_VALUE
94
+ * @public
95
+ */
96
+ Object.defineProperty(this, "yMax", {
97
+ enumerable: true,
98
+ configurable: true,
99
+ writable: true,
100
+ value: void 0
101
+ });
102
+ /**
103
+ * @description グラフィックのコマンド配列
104
+ * Graphic command array
105
+ *
106
+ * @type {array}
107
+ * @default null
108
+ * @public
109
+ */
110
+ Object.defineProperty(this, "$recodes", {
111
+ enumerable: true,
112
+ configurable: true,
113
+ writable: true,
114
+ value: void 0
115
+ });
116
+ /**
117
+ * @type {Float32Array}
118
+ * @default null
119
+ * @private
120
+ */
121
+ Object.defineProperty(this, "_$buffer", {
122
+ enumerable: true,
123
+ configurable: true,
124
+ writable: true,
125
+ value: void 0
126
+ });
127
+ /**
128
+ * @type {number}
129
+ * @default 0
130
+ * @private
131
+ */
132
+ Object.defineProperty(this, "_$maxAlpha", {
133
+ enumerable: true,
134
+ configurable: true,
135
+ writable: true,
136
+ value: void 0
137
+ });
138
+ /**
139
+ * @type {boolean}
140
+ * @default false
141
+ * @private
142
+ */
143
+ Object.defineProperty(this, "_$isBeginning", {
144
+ enumerable: true,
145
+ configurable: true,
146
+ writable: true,
147
+ value: void 0
148
+ });
149
+ /**
150
+ * @type {number}
151
+ * @default 0
152
+ * @private
153
+ */
154
+ Object.defineProperty(this, "_$positionX", {
155
+ enumerable: true,
156
+ configurable: true,
157
+ writable: true,
158
+ value: void 0
159
+ });
160
+ /**
161
+ * @type {number}
162
+ * @default 0
163
+ * @private
164
+ */
165
+ Object.defineProperty(this, "_$positionY", {
166
+ enumerable: true,
167
+ configurable: true,
168
+ writable: true,
169
+ value: void 0
170
+ });
171
+ /**
172
+ * @type {boolean}
173
+ * @default false
174
+ * @private
175
+ */
176
+ Object.defineProperty(this, "_$hasFillEnabled", {
177
+ enumerable: true,
178
+ configurable: true,
179
+ writable: true,
180
+ value: void 0
181
+ });
182
+ /**
183
+ * @type {number}
184
+ * @default 0
185
+ * @private
186
+ */
187
+ Object.defineProperty(this, "_$fillType", {
188
+ enumerable: true,
189
+ configurable: true,
190
+ writable: true,
191
+ value: void 0
192
+ });
193
+ /**
194
+ * @type {number}
195
+ * @default 0
196
+ * @private
197
+ */
198
+ Object.defineProperty(this, "_$fillColor", {
199
+ enumerable: true,
200
+ configurable: true,
201
+ writable: true,
202
+ value: void 0
203
+ });
204
+ /**
205
+ * @type {GraphicsGradientFill}
206
+ * @default null
207
+ * @private
208
+ */
209
+ Object.defineProperty(this, "_$fillGradient", {
210
+ enumerable: true,
211
+ configurable: true,
212
+ writable: true,
213
+ value: void 0
214
+ });
215
+ /**
216
+ * @type {GraphicsBitmapFill}
217
+ * @default null
218
+ * @private
219
+ */
220
+ Object.defineProperty(this, "_$fillBitmap", {
221
+ enumerable: true,
222
+ configurable: true,
223
+ writable: true,
224
+ value: void 0
225
+ });
226
+ /**
227
+ * @type {array}
228
+ * @default null
229
+ * @private
230
+ */
231
+ Object.defineProperty(this, "_$fills", {
232
+ enumerable: true,
233
+ configurable: true,
234
+ writable: true,
235
+ value: void 0
236
+ });
237
+ /**
238
+ * @type {boolean}
239
+ * @default false
240
+ * @private
241
+ */
242
+ Object.defineProperty(this, "_$hasLineEnabled", {
243
+ enumerable: true,
244
+ configurable: true,
245
+ writable: true,
246
+ value: void 0
247
+ });
248
+ /**
249
+ * @type {number}
250
+ * @default 0
251
+ * @private
252
+ */
253
+ Object.defineProperty(this, "_$lineType", {
254
+ enumerable: true,
255
+ configurable: true,
256
+ writable: true,
257
+ value: void 0
258
+ });
259
+ /**
260
+ * @type {number}
261
+ * @default 0
262
+ * @private
263
+ */
264
+ Object.defineProperty(this, "_$lineColor", {
265
+ enumerable: true,
266
+ configurable: true,
267
+ writable: true,
268
+ value: void 0
269
+ });
270
+ /**
271
+ * @type {GraphicsGradientFill}
272
+ * @default null
273
+ * @private
274
+ */
275
+ Object.defineProperty(this, "_$lineGradient", {
276
+ enumerable: true,
277
+ configurable: true,
278
+ writable: true,
279
+ value: void 0
280
+ });
281
+ /**
282
+ * @type {string}
283
+ * @default "round"
284
+ * @private
285
+ */
286
+ Object.defineProperty(this, "_$joints", {
287
+ enumerable: true,
288
+ configurable: true,
289
+ writable: true,
290
+ value: void 0
291
+ });
292
+ /**
293
+ * @type {number}
294
+ * @default 0
295
+ * @private
296
+ */
297
+ Object.defineProperty(this, "_$miterLimit", {
298
+ enumerable: true,
299
+ configurable: true,
300
+ writable: true,
301
+ value: void 0
302
+ });
303
+ /**
304
+ * @type {string}
305
+ * @default "none"
306
+ * @private
307
+ */
308
+ Object.defineProperty(this, "_$caps", {
309
+ enumerable: true,
310
+ configurable: true,
311
+ writable: true,
312
+ value: void 0
313
+ });
314
+ /**
315
+ * @type {number}
316
+ * @default 1
317
+ * @private
318
+ */
319
+ Object.defineProperty(this, "_$lineWidth", {
320
+ enumerable: true,
321
+ configurable: true,
322
+ writable: true,
323
+ value: void 0
324
+ });
325
+ /**
326
+ * @type {array}
327
+ * @default null
328
+ * @private
329
+ */
330
+ Object.defineProperty(this, "_$lines", {
331
+ enumerable: true,
332
+ configurable: true,
333
+ writable: true,
334
+ value: void 0
335
+ });
336
+ this.isConfirmed = false;
337
+ this.xMin = Number.MAX_VALUE;
338
+ this.yMin = Number.MAX_VALUE;
339
+ this.xMax = -Number.MAX_VALUE;
340
+ this.yMax = -Number.MAX_VALUE;
341
+ // private
342
+ this.$recodes = null;
343
+ this._$buffer = null;
344
+ this._$positionX = 0;
345
+ this._$positionY = 0;
346
+ this._$maxAlpha = 0;
347
+ this._$isBeginning = false;
348
+ // fill
349
+ this._$fills = null;
350
+ this._$hasFillEnabled = false;
351
+ this._$fillType = 0;
352
+ this._$fillGradient = null;
353
+ this._$fillBitmap = null;
354
+ this._$fillColor = 0;
355
+ // stroke
356
+ this._$caps = "none";
357
+ this._$lineWidth = 1;
358
+ this._$lines = null;
359
+ this._$hasLineEnabled = false;
360
+ this._$lineType = 0;
361
+ this._$lineGradient = null;
362
+ this._$joints = "round";
363
+ this._$miterLimit = 0;
364
+ this._$lineColor = 0;
365
+ }
366
+ /**
367
+ * @description 描画コマンド、MoveToの識別番号
368
+ * Drawing command, MoveTo identification number
369
+ *
370
+ * @return {number}
371
+ * @const
372
+ * @static
373
+ */
374
+ static get MOVE_TO() {
375
+ return 0;
376
+ }
377
+ /**
378
+ * @description 描画コマンド、2次ベジェ曲線の識別番号
379
+ * Drawing command, 2nd Bezier curve identification number
380
+ *
381
+ * @return {number}
382
+ * @const
383
+ * @static
384
+ */
385
+ static get CURVE_TO() {
386
+ return 1;
387
+ }
388
+ /**
389
+ * @description 描画コマンド、直線の識別番号
390
+ * Drawing command, straight line identification number
391
+ *
392
+ * @return {number}
393
+ * @const
394
+ * @static
395
+ */
396
+ static get LINE_TO() {
397
+ return 2;
398
+ }
399
+ /**
400
+ * @description 描画コマンド、3次ベジェ曲線の識別番号
401
+ * Drawing command, 3rd Bezier curve identification number
402
+ *
403
+ * @return {number}
404
+ * @const
405
+ * @static
406
+ */
407
+ static get CUBIC() {
408
+ return 3;
409
+ }
410
+ /**
411
+ * @description 描画コマンド、円弧の識別番号
412
+ * Drawing command, arc identification number
413
+ *
414
+ * @return {number}
415
+ * @const
416
+ * @static
417
+ */
418
+ static get ARC() {
419
+ return 4;
420
+ }
421
+ /**
422
+ * @description 描画コマンド、塗りの識別番号
423
+ * Drawing command, fill identification number
424
+ *
425
+ * @return {number}
426
+ * @const
427
+ * @static
428
+ */
429
+ static get FILL_STYLE() {
430
+ return 5;
431
+ }
432
+ /**
433
+ * @description 描画コマンド、線の識別番号
434
+ * Drawing command, line identification number
435
+ *
436
+ * @return {number}
437
+ * @const
438
+ * @static
439
+ */
440
+ static get STROKE_STYLE() {
441
+ return 6;
442
+ }
443
+ /**
444
+ * @description 描画コマンド、塗りの終了の識別番号
445
+ * Drawing command, fill end identification number
446
+ *
447
+ * @return {number}
448
+ * @const
449
+ * @static
450
+ */
451
+ static get END_FILL() {
452
+ return 7;
453
+ }
454
+ /**
455
+ * @description 描画コマンド、線の終了の識別番号
456
+ * Drawing command, line end identification number
457
+ *
458
+ * @return {number}
459
+ * @const
460
+ * @static
461
+ */
462
+ static get END_STROKE() {
463
+ return 8;
464
+ }
465
+ /**
466
+ * @description 描画コマンド、描画開始の識別番号
467
+ * Drawing command, drawing start identification number
468
+ *
469
+ * @return {number}
470
+ * @const
471
+ * @static
472
+ */
473
+ static get BEGIN_PATH() {
474
+ return 9;
475
+ }
476
+ /**
477
+ * @description 描画コマンド、塗りのグラデーション開始の識別番号
478
+ * Drawing command, gradient fill start identification number
479
+ *
480
+ * @return {number}
481
+ * @const
482
+ * @static
483
+ */
484
+ static get GRADIENT_FILL() {
485
+ return 10;
486
+ }
487
+ /**
488
+ * @description 描画コマンド、線のグラデーション開始の識別番号
489
+ * Drawing command, gradient line start identification number
490
+ *
491
+ * @return {number}
492
+ * @const
493
+ * @static
494
+ */
495
+ static get GRADIENT_STROKE() {
496
+ return 11;
497
+ }
498
+ /**
499
+ * @description 描画コマンド、描画結合の識別番号
500
+ * Drawing command, drawing join identification number
501
+ *
502
+ * @return {number}
503
+ * @const
504
+ * @static
505
+ */
506
+ static get CLOSE_PATH() {
507
+ return 12;
508
+ }
509
+ /**
510
+ * @description 描画コマンド、Bitmapの塗りの識別番号
511
+ * Drawing command, Bitmap fill identification number
512
+ *
513
+ * @return {number}
514
+ * @const
515
+ * @static
516
+ */
517
+ static get BITMAP_FILL() {
518
+ return 13;
519
+ }
520
+ /**
521
+ * @description 描画コマンド、Bitmapの線の識別番号
522
+ * Drawing command, Bitmap line identification number
523
+ *
524
+ * @return {number}
525
+ * @const
526
+ * @static
527
+ */
528
+ static get BITMAP_STROKE() {
529
+ return 14;
530
+ }
531
+ /**
532
+ * @description 描画コマンドが実行可能かを返却
533
+ * Returns whether the drawing command can be executed
534
+ *
535
+ * @type {boolean}
536
+ * @readonly
537
+ * @public
538
+ */
539
+ get isDrawable() {
540
+ if (!this._$isBeginning || !this._$maxAlpha) {
541
+ return false;
542
+ }
543
+ const width = Math.abs(this.xMax - this.xMin);
544
+ const height = Math.abs(this.yMax - this.yMin);
545
+ return width > 0 && height > 0;
546
+ }
547
+ /**
548
+ * @description 描画領域をビットマップイメージで塗りつぶします。
549
+ * Fills a drawing area with a bitmap image.
550
+ *
551
+ * @param {BitmapData} bitmap_data
552
+ * @param {Matrix} [matrix=null]
553
+ * @param {boolean} [repeat=true]
554
+ * @param {boolean} [smooth=false]
555
+ * @return {Graphics}
556
+ * @method
557
+ * @public
558
+ */
559
+ beginBitmapFill(bitmap_data, matrix = null, repeat = true, smooth = false) {
560
+ // end fill
561
+ if (this._$hasFillEnabled) {
562
+ this.endFill();
563
+ }
564
+ if (!this._$fills) {
565
+ this._$fills = $getArray();
566
+ }
567
+ // start
568
+ this._$maxAlpha = 1;
569
+ this._$hasFillEnabled = true;
570
+ this._$isBeginning = true;
571
+ // beginPath
572
+ this._$fills.push(Graphics.BEGIN_PATH);
573
+ this._$fillType = Graphics.BITMAP_FILL;
574
+ this._$fillBitmap = new GraphicsBitmapFill(bitmap_data, matrix, repeat, smooth);
575
+ return this;
576
+ }
577
+ /**
578
+ * @description 描画のときに他の Graphics メソッド(lineTo() や drawCircle() など)
579
+ * に対する今後の呼び出しに使用する単純な一色塗りを指定します。
580
+ * Specifies a simple one-color fill that subsequent calls
581
+ * to other Graphics methods (such as lineTo() or drawCircle()) use when drawing.
582
+ *
583
+ * @param {string|number} [color=0]
584
+ * @param {number} [alpha=1.0]
585
+ * @return {Graphics}
586
+ * @method
587
+ * @public
588
+ */
589
+ beginFill(color = 0, alpha = 1) {
590
+ // end fill
591
+ if (this._$hasFillEnabled) {
592
+ this.endFill();
593
+ }
594
+ if (!this._$fills) {
595
+ this._$fills = $getArray();
596
+ }
597
+ // valid
598
+ if (typeof color === "string") {
599
+ color = $convertColorStringToNumber(color);
600
+ }
601
+ color = $clamp(color, 0, 0xffffff, 0);
602
+ alpha = $clamp(alpha, 0, 1, 1);
603
+ // setup
604
+ this._$maxAlpha = Math.max(this._$maxAlpha, alpha);
605
+ this._$hasFillEnabled = true;
606
+ this._$isBeginning = true;
607
+ // beginPath
608
+ this._$fills.push(Graphics.BEGIN_PATH);
609
+ this._$fillType = Graphics.FILL_STYLE;
610
+ // Color Int 32bit(RGBA)
611
+ const red = color >>> 16 & 0xff;
612
+ const green = color >>> 8 & 0xff;
613
+ const blue = color & 0xff;
614
+ this._$fillColor = red << 24 | green << 16 | blue << 8 | alpha * 255;
615
+ return this;
616
+ }
617
+ /**
618
+ * @description Graphics の他のメソッド(lineTo()、drawCircle() など)に対する、
619
+ * オブジェクトの後続の呼び出しに使用するグラデーション塗りを指定します。
620
+ * Specifies a gradient fill used by subsequent calls
621
+ * to other Graphics methods (such as lineTo() or drawCircle()) for the object.
622
+ *
623
+ * @param {string} type
624
+ * @param {array} colors
625
+ * @param {array} alphas
626
+ * @param {array} ratios
627
+ * @param {Matrix} [matrix=null]
628
+ * @param {string} [spread_method=SpreadMethod.PAD]
629
+ * @param {string} [interpolation_method=InterpolationMethod.RGB]
630
+ * @param {number} [focal_point_ratio=0]
631
+ * @return {Graphics}
632
+ * @method
633
+ * @public
634
+ */
635
+ beginGradientFill(type, colors, alphas, ratios, matrix = null, spread_method = "pad", interpolation_method = "rgb", focal_point_ratio = 0) {
636
+ if (this._$hasFillEnabled) {
637
+ this.endFill();
638
+ }
639
+ if (!this._$fills) {
640
+ this._$fills = $getArray();
641
+ }
642
+ // setup
643
+ for (let idx = 0; idx < alphas.length; ++idx) {
644
+ this._$maxAlpha = Math.max(this._$maxAlpha, alphas[idx]);
645
+ }
646
+ this._$hasFillEnabled = true;
647
+ this._$isBeginning = true;
648
+ // beginPath
649
+ this._$fills.push(Graphics.BEGIN_PATH);
650
+ this._$fillType = Graphics.GRADIENT_FILL;
651
+ this._$fillGradient = new GraphicsGradientFill(type, colors, alphas, ratios, matrix, spread_method, interpolation_method, focal_point_ratio);
652
+ return this;
653
+ }
654
+ /**
655
+ * @description この Graphics オブジェクトに描画されているグラフィックをクリアし、
656
+ * 塗りと線のスタイルの設定をリセットします。
657
+ * Clears the graphics that were drawn to this Graphics object,
658
+ * and resets fill and line style settings.
659
+ *
660
+ * @return {Graphics}
661
+ * @method
662
+ * @public
663
+ */
664
+ clear() {
665
+ // param clear
666
+ this._$maxAlpha = 0;
667
+ this._$isBeginning = false;
668
+ this._$positionX = 0;
669
+ this._$positionY = 0;
670
+ // fill
671
+ this._$fillType = 0;
672
+ this._$fillGradient = null;
673
+ this._$fillBitmap = null;
674
+ this._$fillColor = 0;
675
+ this._$hasFillEnabled = false;
676
+ // stroke
677
+ this._$caps = "none";
678
+ this._$lineWidth = 1;
679
+ this._$lineType = 0;
680
+ this._$lineGradient = null;
681
+ this._$joints = "round";
682
+ this._$miterLimit = 0;
683
+ this._$lineColor = 0;
684
+ this._$hasLineEnabled = false;
685
+ // bounds size
686
+ this.xMin = Number.MAX_VALUE;
687
+ this.xMax = -Number.MAX_VALUE;
688
+ this.yMin = Number.MAX_VALUE;
689
+ this.yMax = -Number.MAX_VALUE;
690
+ // init array
691
+ if (this.$recodes) {
692
+ $poolArray(this.$recodes);
693
+ }
694
+ if (this._$fills) {
695
+ $poolArray(this._$fills);
696
+ }
697
+ if (this._$lines) {
698
+ $poolArray(this._$lines);
699
+ }
700
+ this._$buffer = null;
701
+ this.$recodes = null;
702
+ this._$fills = null;
703
+ this._$lines = null;
704
+ return this;
705
+ }
706
+ /**
707
+ * @description すべての描画コマンドをソース Graphics オブジェクトから、呼び出し Graphics オブジェクトにコピーします。
708
+ * Copies all of drawing commands from the source Graphics object into the calling Graphics object.
709
+ *
710
+ * @return {Graphics}
711
+ * @method
712
+ * @public
713
+ */
714
+ clone() {
715
+ const graphics = new Graphics();
716
+ graphics.copyFrom(this);
717
+ return graphics;
718
+ }
719
+ /**
720
+ * @description すべての描画コマンドをソース Graphics オブジェクトから、呼び出し Graphics オブジェクトにコピーします。
721
+ * Copies all of drawing commands from the source Graphics object into the calling Graphics object.
722
+ *
723
+ * @param {Graphics} graphics
724
+ * @return {void}
725
+ * @method
726
+ * @public
727
+ */
728
+ copyFrom(graphics) {
729
+ if (graphics._$fillGradient) {
730
+ this._$fillGradient = graphics._$fillGradient.clone();
731
+ }
732
+ if (graphics._$fillBitmap) {
733
+ this._$fillBitmap = graphics._$fillBitmap.clone();
734
+ }
735
+ // fill
736
+ this._$hasFillEnabled = graphics._$hasFillEnabled;
737
+ this._$fillType = graphics._$fillType;
738
+ this._$fillColor = graphics._$fillColor;
739
+ if (graphics._$lineGradient) {
740
+ this._$lineGradient = graphics._$lineGradient.clone();
741
+ }
742
+ // stroke
743
+ this._$hasLineEnabled = graphics._$hasLineEnabled;
744
+ this._$lineType = graphics._$lineType;
745
+ this._$caps = graphics._$caps;
746
+ this._$joints = graphics._$joints;
747
+ this._$miterLimit = graphics._$miterLimit;
748
+ this._$lineWidth = graphics._$lineWidth;
749
+ this._$lineColor = graphics._$lineColor;
750
+ // bounds
751
+ this.xMin = graphics.xMin;
752
+ this.xMax = graphics.xMax;
753
+ this.yMin = graphics.yMin;
754
+ this.yMax = graphics.yMax;
755
+ // params
756
+ this._$maxAlpha = graphics._$maxAlpha;
757
+ this._$positionX = graphics._$positionX;
758
+ this._$positionY = graphics._$positionY;
759
+ this._$isBeginning = graphics._$isBeginning;
760
+ // path params
761
+ if (graphics._$fills) {
762
+ this._$fills = graphics._$fills.slice(0);
763
+ }
764
+ if (graphics._$lines) {
765
+ this._$lines = graphics._$lines.slice(0);
766
+ }
767
+ if (graphics.$recodes) {
768
+ this.$recodes = graphics.$recodes.slice(0);
769
+ }
770
+ this._$buffer = null;
771
+ }
772
+ /**
773
+ * @description 現在の描画位置から指定されたアンカーポイントに 3 次ベジェ曲線を描画します。
774
+ * Draws a cubic Bezier curve from the current drawing position to the specified anchor point.
775
+ *
776
+ * @param {number} control_x1
777
+ * @param {number} control_y1
778
+ * @param {number} control_x2
779
+ * @param {number} control_y2
780
+ * @param {number} anchor_x
781
+ * @param {number} anchor_y
782
+ * @return {Graphics}
783
+ * @method
784
+ * @public
785
+ */
786
+ cubicCurveTo(control_x1, control_y1, control_x2, control_y2, anchor_x, anchor_y) {
787
+ anchor_x = +anchor_x || 0;
788
+ anchor_y = +anchor_y || 0;
789
+ if (this._$positionX === anchor_x
790
+ && this._$positionY === anchor_y) {
791
+ return this;
792
+ }
793
+ control_x1 = +control_x1 || 0;
794
+ control_y1 = +control_y1 || 0;
795
+ control_x2 = +control_x2 || 0;
796
+ control_y2 = +control_y2 || 0;
797
+ // calc bounds
798
+ graphicsCalcBoundsUseCase(this, this._$hasLineEnabled, this._$positionX, this._$positionY, this._$lineWidth, this._$caps, control_x1, control_y1, control_x2, control_y2, anchor_x, anchor_y);
799
+ // marge path
800
+ graphicsMargePathService(this, this._$hasFillEnabled, this._$hasLineEnabled, this._$fills, this._$lines, Graphics.CUBIC, control_x1, control_y1, control_x2, control_y2, anchor_x, anchor_y);
801
+ this._$positionX = anchor_x;
802
+ this._$positionY = anchor_y;
803
+ return this;
804
+ }
805
+ /**
806
+ * @description (controlX, controlY) で指定されたコントロールポイントを使用し、
807
+ * 現在の描画位置から (anchorX, anchorY) まで、現在の線のスタイルで 2 次ベジェ曲線を描画します。
808
+ * Draws a quadratic Bezier curve using the current line style from
809
+ * the current drawing position to (anchorX, anchorY)
810
+ * and using the control point that (controlX, controlY) specifies.
811
+ *
812
+ * @param {number} control_x
813
+ * @param {number} control_y
814
+ * @param {number} anchor_x
815
+ * @param {number} anchor_y
816
+ * @return {Graphics}
817
+ * @method
818
+ * @public
819
+ */
820
+ curveTo(control_x, control_y, anchor_x, anchor_y) {
821
+ anchor_x = +anchor_x || 0;
822
+ anchor_y = +anchor_y || 0;
823
+ if (this._$positionX === anchor_x
824
+ && this._$positionY === anchor_y) {
825
+ return this;
826
+ }
827
+ control_x = +control_x || 0;
828
+ control_y = +control_y || 0;
829
+ // calc bounds
830
+ graphicsCalcBoundsUseCase(this, this._$hasLineEnabled, this._$positionX, this._$positionY, this._$lineWidth, this._$caps, control_x, control_y, anchor_x, anchor_y);
831
+ // marge path
832
+ graphicsMargePathService(this, this._$hasFillEnabled, this._$hasLineEnabled, this._$fills, this._$lines, Graphics.CURVE_TO, control_x, control_y, anchor_x, anchor_y);
833
+ this._$positionX = anchor_x;
834
+ this._$positionY = anchor_y;
835
+ return this;
836
+ }
837
+ /**
838
+ * @description 円を描画します。
839
+ * Draws a circle.
840
+ *
841
+ * @param {number} x
842
+ * @param {number} y
843
+ * @param {number} radius
844
+ * @return {Graphics}
845
+ * @method
846
+ * @public
847
+ */
848
+ drawCircle(x, y, radius) {
849
+ x = +x || 0;
850
+ y = +y || 0;
851
+ radius = +radius || 0;
852
+ radius = Math.round(radius);
853
+ // calc bounds
854
+ graphicsCalcBoundsUseCase(this, this._$hasLineEnabled, this._$positionX, this._$positionY, this._$lineWidth, this._$caps, x - radius, y - radius, x + radius, y + radius);
855
+ // marge path
856
+ graphicsMargePathService(this, this._$hasFillEnabled, this._$hasLineEnabled, this._$fills, this._$lines, Graphics.MOVE_TO, x + radius, y, Graphics.ARC, x, y, radius);
857
+ this._$positionX = x;
858
+ this._$positionY = y;
859
+ return this;
860
+ }
861
+ /**
862
+ * @description 楕円を描画します。
863
+ * Draws an ellipse.
864
+ *
865
+ * @param {number} x
866
+ * @param {number} y
867
+ * @param {number} width
868
+ * @param {number} height
869
+ * @return {Graphics}
870
+ * @method
871
+ * @public
872
+ */
873
+ drawEllipse(x, y, width, height) {
874
+ return graphicsDrawEllipseService(this, x, y, width, height);
875
+ }
876
+ /**
877
+ * @description 矩形を描画します。
878
+ * Draws a rectangle.
879
+ *
880
+ * @param {number} x
881
+ * @param {number} y
882
+ * @param {number} width
883
+ * @param {number} height
884
+ * @return {Graphics}
885
+ * @method
886
+ * @public
887
+ */
888
+ drawRect(x, y, width, height) {
889
+ return graphicsDrawRectService(this, x, y, width, height);
890
+ }
891
+ /**
892
+ * @description 角丸矩形を描画します。
893
+ * Draws a rounded rectangle.
894
+ *
895
+ * @param {number} x
896
+ * @param {number} y
897
+ * @param {number} width
898
+ * @param {number} height
899
+ * @param {number} ellipse_width
900
+ * @param {number} [ellipse_height=NaN]
901
+ * @return {Graphics}
902
+ * @method
903
+ * @public
904
+ */
905
+ drawRoundRect(x, y, width, height, ellipse_width, ellipse_height = NaN) {
906
+ return graphicsDrawRoundRectService(this, x, y, width, height, ellipse_width, ellipse_height);
907
+ }
908
+ /**
909
+ * @description beginFill()、beginGradientFill()、または beginBitmapFill() メソッドへの
910
+ * 最後の呼び出し以降に追加された線と曲線に塗りを適用します。
911
+ * Applies a fill to the lines and curves that were added since
912
+ * the last call to the beginFill(), beginGradientFill(),
913
+ * or beginBitmapFill() method.
914
+ *
915
+ * @return {Graphics}
916
+ * @method
917
+ * @public
918
+ */
919
+ endFill() {
920
+ if (!this._$hasFillEnabled || !this._$fills || 8 > this._$fills.length) {
921
+ return this;
922
+ }
923
+ if (!this.$recodes) {
924
+ this.$recodes = $getArray();
925
+ }
926
+ if (this._$fills[2] !== this._$fills[this._$fills.length - 2]
927
+ || this._$fills[3] !== this._$fills[this._$fills.length - 1]) {
928
+ this._$fills.push(Graphics.LINE_TO, this._$fills[2], this._$fills[3]);
929
+ }
930
+ this.$recodes.push(...this._$fills);
931
+ $poolArray(this._$fills);
932
+ this._$fills = null;
933
+ // fill
934
+ switch (this._$fillType) {
935
+ case Graphics.FILL_STYLE:
936
+ this.$recodes.push(this._$fillType, this._$fillColor >>> 24 & 0xff, this._$fillColor >>> 16 & 0xff, this._$fillColor >>> 8 & 0xff, this._$fillColor & 0xff, Graphics.END_FILL);
937
+ break;
938
+ case Graphics.GRADIENT_FILL:
939
+ if (this._$fillGradient) {
940
+ this.$recodes.push(this._$fillType, ...this._$fillGradient.toArray());
941
+ }
942
+ break;
943
+ case Graphics.BITMAP_FILL:
944
+ if (this._$fillBitmap) {
945
+ this.$recodes.push(this._$fillType, ...this._$fillBitmap.toArray());
946
+ }
947
+ break;
948
+ }
949
+ // reset
950
+ this._$fillType = 0;
951
+ this._$fillColor = 0;
952
+ this._$fillGradient = null;
953
+ this._$fillBitmap = null;
954
+ this._$hasFillEnabled = false;
955
+ return this;
956
+ }
957
+ /**
958
+ * @description lineStyle()、または lineGradientStyle() メソッドへの
959
+ * 最後の呼び出し以降に追加された線と曲線に塗りを適用します。
960
+ * Applies a fill to the lines and curves that were added since
961
+ * the last call to the beginFill() or beginGradientFill() method.
962
+ *
963
+ * @return {Graphics}
964
+ * @method
965
+ * @public
966
+ */
967
+ endLine() {
968
+ if (!this._$hasLineEnabled || !this._$lines) {
969
+ return this;
970
+ }
971
+ if (!this.$recodes) {
972
+ this.$recodes = $getArray();
973
+ }
974
+ this.$recodes.push(...this._$lines);
975
+ // clear
976
+ $poolArray(this._$lines);
977
+ this._$lines = null;
978
+ // fill
979
+ switch (this._$lineType) {
980
+ case Graphics.STROKE_STYLE:
981
+ this.$recodes.push(this._$lineType, this._$lineWidth, this._$caps, this._$joints, this._$miterLimit, this._$lineColor >>> 24 & 0xff, this._$lineColor >>> 16 & 0xff, this._$lineColor >>> 8 & 0xff, this._$lineColor & 0xff, Graphics.END_STROKE);
982
+ break;
983
+ case Graphics.GRADIENT_STROKE:
984
+ if (this._$lineGradient) {
985
+ this.$recodes.push(this._$lineType, this._$lineWidth, this._$caps, this._$joints, this._$miterLimit, ...this._$lineGradient.toArray());
986
+ }
987
+ break;
988
+ case Graphics.BITMAP_STROKE:
989
+ if (this._$fillBitmap) {
990
+ this.$recodes.push(this._$lineType, this._$lineWidth, this._$caps, this._$joints, this._$miterLimit, ...this._$fillBitmap.toArray());
991
+ }
992
+ break;
993
+ }
994
+ // reset
995
+ this._$lineType = 0;
996
+ this._$lineWidth = 0;
997
+ this._$lineGradient = null;
998
+ this._$lineColor = 0;
999
+ this._$caps = "none";
1000
+ this._$joints = "round";
1001
+ this._$miterLimit = 0;
1002
+ this._$hasLineEnabled = false;
1003
+ return this;
1004
+ }
1005
+ /**
1006
+ * @description 線の描画で、線として使用するビットマップを指定します。
1007
+ * Specifies a bitmap to use for the line stroke when drawing lines.
1008
+ *
1009
+ * @param {BitmapData} bitmap_data
1010
+ * @param {Matrix} [matrix=null]
1011
+ * @param {boolean} [repeat=true]
1012
+ * @param {boolean} [smooth=false]
1013
+ * @return {Graphics}
1014
+ * @method
1015
+ * @public
1016
+ */
1017
+ lineBitmapStyle(bitmap_data, matrix = null, repeat = true, smooth = false) {
1018
+ if (!this._$hasLineEnabled) {
1019
+ return this;
1020
+ }
1021
+ if (!this._$lines) {
1022
+ this._$lines = $getArray();
1023
+ }
1024
+ // start
1025
+ this._$maxAlpha = 1;
1026
+ this._$hasLineEnabled = true;
1027
+ this._$isBeginning = true;
1028
+ // beginPath
1029
+ this._$lines.push(Graphics.BEGIN_PATH);
1030
+ this._$lineType = Graphics.BITMAP_STROKE;
1031
+ this._$fillBitmap = new GraphicsBitmapFill(bitmap_data, matrix, repeat, smooth);
1032
+ return this;
1033
+ }
1034
+ /**
1035
+ * @description 線の描画で使用するグラデーションを指定します。
1036
+ * Specifies a gradient to use for the stroke when drawing lines.
1037
+ *
1038
+ * @param {string} type
1039
+ * @param {array} colors
1040
+ * @param {array} alphas
1041
+ * @param {array} ratios
1042
+ * @param {Matrix} [matrix=null]
1043
+ * @param {string} [spread_method=SpreadMethod.PAD]
1044
+ * @param {string} [interpolation_method=InterpolationMethod.RGB]
1045
+ * @param {number} [focal_point_ratio=0]
1046
+ * @return {Graphics}
1047
+ * @method
1048
+ * @public
1049
+ */
1050
+ lineGradientStyle(type, colors, alphas, ratios, matrix = null, spread_method = "pad", interpolation_method = "rgb", focal_point_ratio = 0) {
1051
+ if (!this._$hasLineEnabled) {
1052
+ return this;
1053
+ }
1054
+ if (!this._$lines) {
1055
+ this._$lines = $getArray();
1056
+ }
1057
+ // setup
1058
+ for (let idx = 0; idx < alphas.length; ++idx) {
1059
+ this._$maxAlpha = Math.max(this._$maxAlpha, alphas[idx]);
1060
+ }
1061
+ // beginPath
1062
+ this._$lines.push(Graphics.BEGIN_PATH);
1063
+ this._$lineType = Graphics.GRADIENT_STROKE;
1064
+ this._$lineGradient = new GraphicsGradientFill(type, colors, alphas, ratios, matrix, spread_method, interpolation_method, focal_point_ratio);
1065
+ return this;
1066
+ }
1067
+ /**
1068
+ * @description lineTo() メソッドや drawCircle() メソッドなど、
1069
+ * Graphics のメソッドの後続の呼び出しに使用する線スタイルを指定します。
1070
+ * Specifies a line style used for subsequent calls
1071
+ * to Graphics methods such as the lineTo() method
1072
+ * or the drawCircle() method.
1073
+ *
1074
+ * @param {number} [thickness=NaN]
1075
+ * @param {number|string} [color=0]
1076
+ * @param {number} [alpha=1]
1077
+ * @param {string} [caps=CapsStyle.NONE]
1078
+ * @param {string} [joints=JointStyle.ROUND]
1079
+ * @param {number} [miter_limit=3]
1080
+ * @return {Graphics}
1081
+ * @method
1082
+ * @public
1083
+ */
1084
+ lineStyle(thickness = 1, color = 0, alpha = 1, caps = "round", joints = "round", miter_limit = 3) {
1085
+ if (this._$hasLineEnabled) {
1086
+ this.endLine();
1087
+ }
1088
+ if (!this._$lines) {
1089
+ this._$lines = $getArray();
1090
+ }
1091
+ // setup
1092
+ this._$maxAlpha = Math.max(this._$maxAlpha, alpha);
1093
+ this._$hasLineEnabled = true;
1094
+ this._$isBeginning = true;
1095
+ // beginPath
1096
+ if (this._$positionX || this._$positionY) {
1097
+ this._$lines.push(Graphics.BEGIN_PATH, Graphics.MOVE_TO, this._$positionX, this._$positionY);
1098
+ }
1099
+ else {
1100
+ this._$lines.push(Graphics.BEGIN_PATH);
1101
+ }
1102
+ // color
1103
+ this._$lineType = Graphics.STROKE_STYLE;
1104
+ // valid
1105
+ if (typeof color === "string") {
1106
+ color = $convertColorStringToNumber(color);
1107
+ }
1108
+ color = $clamp(color, 0, 0xffffff, 0);
1109
+ alpha = $clamp(alpha, 0, 1, 1);
1110
+ // Color Int 32bit(RGBA)
1111
+ const red = color >>> 16 & 0xff;
1112
+ const green = color >>> 8 & 0xff;
1113
+ const blue = color & 0xff;
1114
+ this._$lineColor = red << 24 | green << 16 | blue << 8 | alpha * 255;
1115
+ // param
1116
+ this._$lineWidth = thickness;
1117
+ this._$caps = `${caps}`;
1118
+ this._$joints = `${joints}`;
1119
+ // set miter limit
1120
+ if (this._$joints === "miter") {
1121
+ this._$miterLimit = miter_limit;
1122
+ }
1123
+ return this;
1124
+ }
1125
+ /**
1126
+ * @description 現在の描画位置から (x, y) まで、現在の線のスタイルを使用して線を描画します。
1127
+ * その後で、現在の描画位置は (x, y) に設定されます。
1128
+ * Draws a line using the current line style from the current drawing position to (x, y);
1129
+ * the current drawing position is then set to (x, y).
1130
+ *
1131
+ * @param {number} x
1132
+ * @param {number} y
1133
+ * @returns {Graphics}
1134
+ * @method
1135
+ * @public
1136
+ */
1137
+ lineTo(x, y) {
1138
+ x = +x || 0;
1139
+ y = +y || 0;
1140
+ if (this._$positionX === x && this._$positionY === y) {
1141
+ return this;
1142
+ }
1143
+ // calc bounds
1144
+ graphicsCalcBoundsUseCase(this, this._$hasLineEnabled, this._$positionX, this._$positionY, this._$lineWidth, this._$caps, x, y);
1145
+ // marge path
1146
+ graphicsMargePathService(this, this._$hasFillEnabled, this._$hasLineEnabled, this._$fills, this._$lines, Graphics.LINE_TO, x, y);
1147
+ this._$positionX = x;
1148
+ this._$positionY = y;
1149
+ return this;
1150
+ }
1151
+ /**
1152
+ * @description 現在の描画位置を (x, y) に移動します。
1153
+ * Moves the current drawing position to (x, y).
1154
+ *
1155
+ * @param {number} x
1156
+ * @param {number} y
1157
+ * @returns {Graphics}
1158
+ * @method
1159
+ * @public
1160
+ */
1161
+ moveTo(x, y) {
1162
+ x = +x || 0;
1163
+ y = +y || 0;
1164
+ this._$positionX = x;
1165
+ this._$positionY = y;
1166
+ // calc bounds
1167
+ graphicsCalcBoundsUseCase(this, this._$hasLineEnabled, this._$positionX, this._$positionY, this._$lineWidth, this._$caps, x, y);
1168
+ let duplication = false;
1169
+ if (this._$hasFillEnabled && this._$fills) {
1170
+ const isMove = this._$fills[this._$fills.length - 3] === Graphics.MOVE_TO;
1171
+ if (isMove) {
1172
+ duplication = true;
1173
+ this._$fills[this._$fills.length - 2] = x;
1174
+ this._$fills[this._$fills.length - 1] = y;
1175
+ }
1176
+ }
1177
+ if (this._$hasLineEnabled && this._$lines) {
1178
+ const isMove = this._$lines[this._$lines.length - 3] === Graphics.MOVE_TO;
1179
+ if (isMove) {
1180
+ duplication = true;
1181
+ this._$lines[this._$lines.length - 2] = x;
1182
+ this._$lines[this._$lines.length - 1] = y;
1183
+ }
1184
+ }
1185
+ // marge path
1186
+ if (!duplication) {
1187
+ graphicsMargePathService(this, this._$hasFillEnabled, this._$hasLineEnabled, this._$fills, this._$lines, Graphics.MOVE_TO, x, y);
1188
+ }
1189
+ return this;
1190
+ }
1191
+ /**
1192
+ * @description この Graphics オブジェクトに描画されているパス情報をFloat32Arrayで返却
1193
+ * Returns the path information drawn to this Graphics object in Float32Array.
1194
+ *
1195
+ * @member {Float32Array}
1196
+ * @method
1197
+ * @public
1198
+ */
1199
+ get buffer() {
1200
+ if (this.isConfirmed && this._$buffer) {
1201
+ return this._$buffer;
1202
+ }
1203
+ // fixed logic
1204
+ if (this._$hasLineEnabled) {
1205
+ this.endLine();
1206
+ }
1207
+ // fixed logic
1208
+ if (this._$hasFillEnabled) {
1209
+ this.endFill();
1210
+ }
1211
+ const array = graphicsToNumberArrayService(this.$recodes);
1212
+ this._$buffer = new Float32Array(array);
1213
+ $poolArray(array);
1214
+ // レコードの確定フラグを更新
1215
+ this.isConfirmed = true;
1216
+ return this._$buffer;
1217
+ }
1218
+ set buffer(buffer) {
1219
+ this._$buffer = buffer;
1220
+ this.isConfirmed = true;
1221
+ this._$isBeginning = true;
1222
+ this._$maxAlpha = 1;
1223
+ }
1224
+ }