safex-webgl 1.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 (910) hide show
  1. package/.prettierrc +6 -0
  2. package/@types/index.d.ts +36 -0
  3. package/README.md +152 -0
  4. package/bun.lock +353 -0
  5. package/dist/actions/Action.d.ts +27 -0
  6. package/dist/actions/Action.d.ts.map +1 -0
  7. package/dist/actions/Action.js +62 -0
  8. package/dist/actions/Action.js.map +1 -0
  9. package/dist/actions/ActionBezier.d.ts +121 -0
  10. package/dist/actions/ActionBezier.d.ts.map +1 -0
  11. package/dist/actions/ActionBezier.js +221 -0
  12. package/dist/actions/ActionBezier.js.map +1 -0
  13. package/dist/actions/ActionBlink.d.ts +62 -0
  14. package/dist/actions/ActionBlink.d.ts.map +1 -0
  15. package/dist/actions/ActionBlink.js +96 -0
  16. package/dist/actions/ActionBlink.js.map +1 -0
  17. package/dist/actions/ActionCatmullRom.d.ts +242 -0
  18. package/dist/actions/ActionCatmullRom.d.ts.map +1 -0
  19. package/dist/actions/ActionCatmullRom.js +436 -0
  20. package/dist/actions/ActionCatmullRom.js.map +1 -0
  21. package/dist/actions/ActionFade.d.ts +126 -0
  22. package/dist/actions/ActionFade.d.ts.map +1 -0
  23. package/dist/actions/ActionFade.js +190 -0
  24. package/dist/actions/ActionFade.js.map +1 -0
  25. package/dist/actions/ActionInstant.d.ts +237 -0
  26. package/dist/actions/ActionInstant.d.ts.map +1 -0
  27. package/dist/actions/ActionInstant.js +386 -0
  28. package/dist/actions/ActionInstant.js.map +1 -0
  29. package/dist/actions/ActionInterval.d.ts +132 -0
  30. package/dist/actions/ActionInterval.d.ts.map +1 -0
  31. package/dist/actions/ActionInterval.js +254 -0
  32. package/dist/actions/ActionInterval.js.map +1 -0
  33. package/dist/actions/ActionJump.d.ts +146 -0
  34. package/dist/actions/ActionJump.d.ts.map +1 -0
  35. package/dist/actions/ActionJump.js +239 -0
  36. package/dist/actions/ActionJump.js.map +1 -0
  37. package/dist/actions/ActionMove.d.ts +73 -0
  38. package/dist/actions/ActionMove.d.ts.map +1 -0
  39. package/dist/actions/ActionMove.js +164 -0
  40. package/dist/actions/ActionMove.js.map +1 -0
  41. package/dist/actions/ActionRotate.d.ts +137 -0
  42. package/dist/actions/ActionRotate.d.ts.map +1 -0
  43. package/dist/actions/ActionRotate.js +214 -0
  44. package/dist/actions/ActionRotate.js.map +1 -0
  45. package/dist/actions/ActionScale.d.ts +110 -0
  46. package/dist/actions/ActionScale.d.ts.map +1 -0
  47. package/dist/actions/ActionScale.js +157 -0
  48. package/dist/actions/ActionScale.js.map +1 -0
  49. package/dist/actions/ActionSkew.d.ts +120 -0
  50. package/dist/actions/ActionSkew.d.ts.map +1 -0
  51. package/dist/actions/ActionSkew.js +185 -0
  52. package/dist/actions/ActionSkew.js.map +1 -0
  53. package/dist/actions/ActionTint.d.ts +132 -0
  54. package/dist/actions/ActionTint.d.ts.map +1 -0
  55. package/dist/actions/ActionTint.js +193 -0
  56. package/dist/actions/ActionTint.js.map +1 -0
  57. package/dist/actions/Animate.d.ts +77 -0
  58. package/dist/actions/Animate.d.ts.map +1 -0
  59. package/dist/actions/Animate.js +177 -0
  60. package/dist/actions/Animate.js.map +1 -0
  61. package/dist/actions/DelayTime.d.ts +95 -0
  62. package/dist/actions/DelayTime.d.ts.map +1 -0
  63. package/dist/actions/DelayTime.js +145 -0
  64. package/dist/actions/DelayTime.js.map +1 -0
  65. package/dist/actions/FiniteTimeAction.d.ts +11 -0
  66. package/dist/actions/FiniteTimeAction.d.ts.map +1 -0
  67. package/dist/actions/FiniteTimeAction.js +24 -0
  68. package/dist/actions/FiniteTimeAction.js.map +1 -0
  69. package/dist/actions/Follow.d.ts +23 -0
  70. package/dist/actions/Follow.d.ts.map +1 -0
  71. package/dist/actions/Follow.js +98 -0
  72. package/dist/actions/Follow.js.map +1 -0
  73. package/dist/actions/Repeat.d.ts +151 -0
  74. package/dist/actions/Repeat.d.ts.map +1 -0
  75. package/dist/actions/Repeat.js +276 -0
  76. package/dist/actions/Repeat.js.map +1 -0
  77. package/dist/actions/Sequence.d.ts +77 -0
  78. package/dist/actions/Sequence.d.ts.map +1 -0
  79. package/dist/actions/Sequence.js +190 -0
  80. package/dist/actions/Sequence.js.map +1 -0
  81. package/dist/actions/Spawn.d.ts +63 -0
  82. package/dist/actions/Spawn.d.ts.map +1 -0
  83. package/dist/actions/Spawn.js +146 -0
  84. package/dist/actions/Spawn.js.map +1 -0
  85. package/dist/actions/Speed.d.ts +19 -0
  86. package/dist/actions/Speed.d.ts.map +1 -0
  87. package/dist/actions/Speed.js +57 -0
  88. package/dist/actions/Speed.js.map +1 -0
  89. package/dist/actions/TargetedAction.d.ts +67 -0
  90. package/dist/actions/TargetedAction.d.ts.map +1 -0
  91. package/dist/actions/TargetedAction.js +99 -0
  92. package/dist/actions/TargetedAction.js.map +1 -0
  93. package/dist/actions/easing/ActionEase.d.ts +133 -0
  94. package/dist/actions/easing/ActionEase.d.ts.map +1 -0
  95. package/dist/actions/easing/ActionEase.js +184 -0
  96. package/dist/actions/easing/ActionEase.js.map +1 -0
  97. package/dist/actions/easing/Back.d.ts +174 -0
  98. package/dist/actions/easing/Back.d.ts.map +1 -0
  99. package/dist/actions/easing/Back.js +227 -0
  100. package/dist/actions/easing/Back.js.map +1 -0
  101. package/dist/actions/easing/Bezier.d.ts +94 -0
  102. package/dist/actions/easing/Bezier.d.ts.map +1 -0
  103. package/dist/actions/easing/Bezier.js +124 -0
  104. package/dist/actions/easing/Bezier.js.map +1 -0
  105. package/dist/actions/easing/Bounce.d.ts +203 -0
  106. package/dist/actions/easing/Bounce.d.ts.map +1 -0
  107. package/dist/actions/easing/Bounce.js +288 -0
  108. package/dist/actions/easing/Bounce.js.map +1 -0
  109. package/dist/actions/easing/Circle.d.ts +177 -0
  110. package/dist/actions/easing/Circle.d.ts.map +1 -0
  111. package/dist/actions/easing/Circle.js +220 -0
  112. package/dist/actions/easing/Circle.js.map +1 -0
  113. package/dist/actions/easing/Cubic.d.ts +165 -0
  114. package/dist/actions/easing/Cubic.d.ts.map +1 -0
  115. package/dist/actions/easing/Cubic.js +209 -0
  116. package/dist/actions/easing/Cubic.js.map +1 -0
  117. package/dist/actions/easing/Elastic.d.ts +269 -0
  118. package/dist/actions/easing/Elastic.d.ts.map +1 -0
  119. package/dist/actions/easing/Elastic.js +358 -0
  120. package/dist/actions/easing/Elastic.js.map +1 -0
  121. package/dist/actions/easing/Exponential.d.ts +181 -0
  122. package/dist/actions/easing/Exponential.d.ts.map +1 -0
  123. package/dist/actions/easing/Exponential.js +214 -0
  124. package/dist/actions/easing/Exponential.js.map +1 -0
  125. package/dist/actions/easing/InOut.d.ts +191 -0
  126. package/dist/actions/easing/InOut.d.ts.map +1 -0
  127. package/dist/actions/easing/InOut.js +254 -0
  128. package/dist/actions/easing/InOut.js.map +1 -0
  129. package/dist/actions/easing/Quartic.d.ts +232 -0
  130. package/dist/actions/easing/Quartic.d.ts.map +1 -0
  131. package/dist/actions/easing/Quartic.js +313 -0
  132. package/dist/actions/easing/Quartic.js.map +1 -0
  133. package/dist/actions/easing/Quintic.d.ts +168 -0
  134. package/dist/actions/easing/Quintic.d.ts.map +1 -0
  135. package/dist/actions/easing/Quintic.js +212 -0
  136. package/dist/actions/easing/Quintic.js.map +1 -0
  137. package/dist/actions/easing/Sine.d.ts +176 -0
  138. package/dist/actions/easing/Sine.d.ts.map +1 -0
  139. package/dist/actions/easing/Sine.js +206 -0
  140. package/dist/actions/easing/Sine.js.map +1 -0
  141. package/dist/actions/index.d.ts +16 -0
  142. package/dist/actions/index.d.ts.map +1 -0
  143. package/dist/actions/index.js +16 -0
  144. package/dist/actions/index.js.map +1 -0
  145. package/dist/audio/Audio.d.ts +47 -0
  146. package/dist/audio/Audio.d.ts.map +1 -0
  147. package/dist/audio/Audio.js +255 -0
  148. package/dist/audio/Audio.js.map +1 -0
  149. package/dist/audio/engine.d.ts +171 -0
  150. package/dist/audio/engine.d.ts.map +1 -0
  151. package/dist/audio/engine.js +556 -0
  152. package/dist/audio/engine.js.map +1 -0
  153. package/dist/audio/index.d.ts +3 -0
  154. package/dist/audio/index.d.ts.map +1 -0
  155. package/dist/audio/index.js +3 -0
  156. package/dist/audio/index.js.map +1 -0
  157. package/dist/boot.d.ts +80 -0
  158. package/dist/boot.d.ts.map +1 -0
  159. package/dist/boot.js +468 -0
  160. package/dist/boot.js.map +1 -0
  161. package/dist/clipping-nodes/ClippingNode.d.ts +114 -0
  162. package/dist/clipping-nodes/ClippingNode.d.ts.map +1 -0
  163. package/dist/clipping-nodes/ClippingNode.js +177 -0
  164. package/dist/clipping-nodes/ClippingNode.js.map +1 -0
  165. package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.d.ts +25 -0
  166. package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.d.ts.map +1 -0
  167. package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.js +157 -0
  168. package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.js.map +1 -0
  169. package/dist/core/ActionManager.d.ts +56 -0
  170. package/dist/core/ActionManager.d.ts.map +1 -0
  171. package/dist/core/ActionManager.js +253 -0
  172. package/dist/core/ActionManager.js.map +1 -0
  173. package/dist/core/Configuration.d.ts +108 -0
  174. package/dist/core/Configuration.d.ts.map +1 -0
  175. package/dist/core/Configuration.js +232 -0
  176. package/dist/core/Configuration.js.map +1 -0
  177. package/dist/core/Director.d.ts +130 -0
  178. package/dist/core/Director.d.ts.map +1 -0
  179. package/dist/core/Director.js +580 -0
  180. package/dist/core/Director.js.map +1 -0
  181. package/dist/core/DrawingPrimitivesWebGL.d.ts +32 -0
  182. package/dist/core/DrawingPrimitivesWebGL.d.ts.map +1 -0
  183. package/dist/core/DrawingPrimitivesWebGL.js +273 -0
  184. package/dist/core/DrawingPrimitivesWebGL.js.map +1 -0
  185. package/dist/core/Scheduler.d.ts +110 -0
  186. package/dist/core/Scheduler.d.ts.map +1 -0
  187. package/dist/core/Scheduler.js +687 -0
  188. package/dist/core/Scheduler.js.map +1 -0
  189. package/dist/core/base-nodes/BaseNodesPropertyDefine.d.ts +2 -0
  190. package/dist/core/base-nodes/BaseNodesPropertyDefine.d.ts.map +1 -0
  191. package/dist/core/base-nodes/BaseNodesPropertyDefine.js +37 -0
  192. package/dist/core/base-nodes/BaseNodesPropertyDefine.js.map +1 -0
  193. package/dist/core/base-nodes/CustomRenderCmd.d.ts +9 -0
  194. package/dist/core/base-nodes/CustomRenderCmd.d.ts.map +1 -0
  195. package/dist/core/base-nodes/CustomRenderCmd.js +16 -0
  196. package/dist/core/base-nodes/CustomRenderCmd.js.map +1 -0
  197. package/dist/core/base-nodes/Node.d.ts +285 -0
  198. package/dist/core/base-nodes/Node.d.ts.map +1 -0
  199. package/dist/core/base-nodes/Node.js +1112 -0
  200. package/dist/core/base-nodes/Node.js.map +1 -0
  201. package/dist/core/base-nodes/NodeRenderCmd.d.ts +65 -0
  202. package/dist/core/base-nodes/NodeRenderCmd.d.ts.map +1 -0
  203. package/dist/core/base-nodes/NodeRenderCmd.js +460 -0
  204. package/dist/core/base-nodes/NodeRenderCmd.js.map +1 -0
  205. package/dist/core/base-nodes/NodeWebGLRenderCmd.d.ts +17 -0
  206. package/dist/core/base-nodes/NodeWebGLRenderCmd.d.ts.map +1 -0
  207. package/dist/core/base-nodes/NodeWebGLRenderCmd.js +29 -0
  208. package/dist/core/base-nodes/NodeWebGLRenderCmd.js.map +1 -0
  209. package/dist/core/cocoa/AffineTransform.d.ts +201 -0
  210. package/dist/core/cocoa/AffineTransform.d.ts.map +1 -0
  211. package/dist/core/cocoa/AffineTransform.js +260 -0
  212. package/dist/core/cocoa/AffineTransform.js.map +1 -0
  213. package/dist/core/cocoa/Geometry.d.ts +176 -0
  214. package/dist/core/cocoa/Geometry.d.ts.map +1 -0
  215. package/dist/core/cocoa/Geometry.js +237 -0
  216. package/dist/core/cocoa/Geometry.js.map +1 -0
  217. package/dist/core/event-manager/Event.d.ts +57 -0
  218. package/dist/core/event-manager/Event.d.ts.map +1 -0
  219. package/dist/core/event-manager/Event.js +69 -0
  220. package/dist/core/event-manager/Event.js.map +1 -0
  221. package/dist/core/event-manager/EventCustom.d.ts +22 -0
  222. package/dist/core/event-manager/EventCustom.d.ts.map +1 -0
  223. package/dist/core/event-manager/EventCustom.js +31 -0
  224. package/dist/core/event-manager/EventCustom.js.map +1 -0
  225. package/dist/core/event-manager/EventExtension.d.ts +33 -0
  226. package/dist/core/event-manager/EventExtension.d.ts.map +1 -0
  227. package/dist/core/event-manager/EventExtension.js +80 -0
  228. package/dist/core/event-manager/EventExtension.js.map +1 -0
  229. package/dist/core/event-manager/EventFocus.d.ts +17 -0
  230. package/dist/core/event-manager/EventFocus.d.ts.map +1 -0
  231. package/dist/core/event-manager/EventFocus.js +21 -0
  232. package/dist/core/event-manager/EventFocus.js.map +1 -0
  233. package/dist/core/event-manager/EventHelper.d.ts +8 -0
  234. package/dist/core/event-manager/EventHelper.d.ts.map +1 -0
  235. package/dist/core/event-manager/EventHelper.js +92 -0
  236. package/dist/core/event-manager/EventHelper.js.map +1 -0
  237. package/dist/core/event-manager/EventListener.d.ts +53 -0
  238. package/dist/core/event-manager/EventListener.d.ts.map +1 -0
  239. package/dist/core/event-manager/EventListener.js +95 -0
  240. package/dist/core/event-manager/EventListener.js.map +1 -0
  241. package/dist/core/event-manager/EventListenerCustom.d.ts +11 -0
  242. package/dist/core/event-manager/EventListenerCustom.d.ts.map +1 -0
  243. package/dist/core/event-manager/EventListenerCustom.js +37 -0
  244. package/dist/core/event-manager/EventListenerCustom.js.map +1 -0
  245. package/dist/core/event-manager/EventListenerFocus.d.ts +10 -0
  246. package/dist/core/event-manager/EventListenerFocus.d.ts.map +1 -0
  247. package/dist/core/event-manager/EventListenerFocus.js +28 -0
  248. package/dist/core/event-manager/EventListenerFocus.js.map +1 -0
  249. package/dist/core/event-manager/EventListenerMouse.d.ts +13 -0
  250. package/dist/core/event-manager/EventListenerMouse.d.ts.map +1 -0
  251. package/dist/core/event-manager/EventListenerMouse.js +49 -0
  252. package/dist/core/event-manager/EventListenerMouse.js.map +1 -0
  253. package/dist/core/event-manager/EventListenerTouchAllAtOnce.d.ts +12 -0
  254. package/dist/core/event-manager/EventListenerTouchAllAtOnce.d.ts.map +1 -0
  255. package/dist/core/event-manager/EventListenerTouchAllAtOnce.js +28 -0
  256. package/dist/core/event-manager/EventListenerTouchAllAtOnce.js.map +1 -0
  257. package/dist/core/event-manager/EventListenerTouchOneByOne.d.ts +16 -0
  258. package/dist/core/event-manager/EventListenerTouchOneByOne.d.ts.map +1 -0
  259. package/dist/core/event-manager/EventListenerTouchOneByOne.js +38 -0
  260. package/dist/core/event-manager/EventListenerTouchOneByOne.js.map +1 -0
  261. package/dist/core/event-manager/EventListenerVector.d.ts +15 -0
  262. package/dist/core/event-manager/EventListenerVector.d.ts.map +1 -0
  263. package/dist/core/event-manager/EventListenerVector.js +38 -0
  264. package/dist/core/event-manager/EventListenerVector.js.map +1 -0
  265. package/dist/core/event-manager/EventManager.d.ts +140 -0
  266. package/dist/core/event-manager/EventManager.d.ts.map +1 -0
  267. package/dist/core/event-manager/EventManager.js +907 -0
  268. package/dist/core/event-manager/EventManager.js.map +1 -0
  269. package/dist/core/event-manager/EventMouse.d.ts +173 -0
  270. package/dist/core/event-manager/EventMouse.d.ts.map +1 -0
  271. package/dist/core/event-manager/EventMouse.js +200 -0
  272. package/dist/core/event-manager/EventMouse.js.map +1 -0
  273. package/dist/core/event-manager/EventTouch.d.ts +24 -0
  274. package/dist/core/event-manager/EventTouch.d.ts.map +1 -0
  275. package/dist/core/event-manager/EventTouch.js +33 -0
  276. package/dist/core/event-manager/EventTouch.js.map +1 -0
  277. package/dist/core/event-manager/Touch.d.ts +60 -0
  278. package/dist/core/event-manager/Touch.d.ts.map +1 -0
  279. package/dist/core/event-manager/Touch.js +94 -0
  280. package/dist/core/event-manager/Touch.js.map +1 -0
  281. package/dist/core/event-manager/index.d.ts +6 -0
  282. package/dist/core/event-manager/index.d.ts.map +1 -0
  283. package/dist/core/event-manager/index.js +6 -0
  284. package/dist/core/event-manager/index.js.map +1 -0
  285. package/dist/core/index.d.ts +16 -0
  286. package/dist/core/index.d.ts.map +1 -0
  287. package/dist/core/index.js +16 -0
  288. package/dist/core/index.js.map +1 -0
  289. package/dist/core/kazmath/gl/mat4stack.d.ts +5 -0
  290. package/dist/core/kazmath/gl/mat4stack.d.ts.map +1 -0
  291. package/dist/core/kazmath/gl/mat4stack.js +53 -0
  292. package/dist/core/kazmath/gl/mat4stack.js.map +1 -0
  293. package/dist/core/kazmath/gl/matrix.d.ts +21 -0
  294. package/dist/core/kazmath/gl/matrix.d.ts.map +1 -0
  295. package/dist/core/kazmath/gl/matrix.js +121 -0
  296. package/dist/core/kazmath/gl/matrix.js.map +1 -0
  297. package/dist/core/kazmath/index.d.ts +7 -0
  298. package/dist/core/kazmath/index.d.ts.map +1 -0
  299. package/dist/core/kazmath/index.js +7 -0
  300. package/dist/core/kazmath/index.js.map +1 -0
  301. package/dist/core/kazmath/mat3.d.ts +45 -0
  302. package/dist/core/kazmath/mat3.d.ts.map +1 -0
  303. package/dist/core/kazmath/mat3.js +297 -0
  304. package/dist/core/kazmath/mat3.js.map +1 -0
  305. package/dist/core/kazmath/mat4.d.ts +175 -0
  306. package/dist/core/kazmath/mat4.d.ts.map +1 -0
  307. package/dist/core/kazmath/mat4.func.d.ts +44 -0
  308. package/dist/core/kazmath/mat4.func.d.ts.map +1 -0
  309. package/dist/core/kazmath/mat4.func.js +210 -0
  310. package/dist/core/kazmath/mat4.func.js.map +1 -0
  311. package/dist/core/kazmath/mat4.js +671 -0
  312. package/dist/core/kazmath/mat4.js.map +1 -0
  313. package/dist/core/kazmath/plane.d.ts +24 -0
  314. package/dist/core/kazmath/plane.d.ts.map +1 -0
  315. package/dist/core/kazmath/plane.js +96 -0
  316. package/dist/core/kazmath/plane.js.map +1 -0
  317. package/dist/core/kazmath/quaternion.d.ts +135 -0
  318. package/dist/core/kazmath/quaternion.d.ts.map +1 -0
  319. package/dist/core/kazmath/quaternion.js +407 -0
  320. package/dist/core/kazmath/quaternion.js.map +1 -0
  321. package/dist/core/kazmath/utility.d.ts +8 -0
  322. package/dist/core/kazmath/utility.d.ts.map +1 -0
  323. package/dist/core/kazmath/utility.js +14 -0
  324. package/dist/core/kazmath/utility.js.map +1 -0
  325. package/dist/core/kazmath/vec3.d.ts +26 -0
  326. package/dist/core/kazmath/vec3.d.ts.map +1 -0
  327. package/dist/core/kazmath/vec3.js +170 -0
  328. package/dist/core/kazmath/vec3.js.map +1 -0
  329. package/dist/core/kazmath/vec4.d.ts +22 -0
  330. package/dist/core/kazmath/vec4.d.ts.map +1 -0
  331. package/dist/core/kazmath/vec4.js +136 -0
  332. package/dist/core/kazmath/vec4.js.map +1 -0
  333. package/dist/core/labelttf/LabelTTF.d.ts +310 -0
  334. package/dist/core/labelttf/LabelTTF.d.ts.map +1 -0
  335. package/dist/core/labelttf/LabelTTF.js +818 -0
  336. package/dist/core/labelttf/LabelTTF.js.map +1 -0
  337. package/dist/core/labelttf/LabelTTFPropertyDefine.d.ts +2 -0
  338. package/dist/core/labelttf/LabelTTFPropertyDefine.d.ts.map +1 -0
  339. package/dist/core/labelttf/LabelTTFPropertyDefine.js +27 -0
  340. package/dist/core/labelttf/LabelTTFPropertyDefine.js.map +1 -0
  341. package/dist/core/labelttf/LabelTTFWebGLRenderCmd.d.ts +37 -0
  342. package/dist/core/labelttf/LabelTTFWebGLRenderCmd.d.ts.map +1 -0
  343. package/dist/core/labelttf/LabelTTFWebGLRenderCmd.js +367 -0
  344. package/dist/core/labelttf/LabelTTFWebGLRenderCmd.js.map +1 -0
  345. package/dist/core/layers/Layer.d.ts +35 -0
  346. package/dist/core/layers/Layer.d.ts.map +1 -0
  347. package/dist/core/layers/Layer.js +93 -0
  348. package/dist/core/layers/Layer.js.map +1 -0
  349. package/dist/core/layers/LayerColor.d.ts +61 -0
  350. package/dist/core/layers/LayerColor.d.ts.map +1 -0
  351. package/dist/core/layers/LayerColor.js +144 -0
  352. package/dist/core/layers/LayerColor.js.map +1 -0
  353. package/dist/core/layers/LayerGradient.d.ts +196 -0
  354. package/dist/core/layers/LayerGradient.d.ts.map +1 -0
  355. package/dist/core/layers/LayerGradient.js +482 -0
  356. package/dist/core/layers/LayerGradient.js.map +1 -0
  357. package/dist/core/layers/LayerMultiplex.d.ts +47 -0
  358. package/dist/core/layers/LayerMultiplex.d.ts.map +1 -0
  359. package/dist/core/layers/LayerMultiplex.js +87 -0
  360. package/dist/core/layers/LayerMultiplex.js.map +1 -0
  361. package/dist/core/layers/LayerWebGLRenderCmd.d.ts +26 -0
  362. package/dist/core/layers/LayerWebGLRenderCmd.d.ts.map +1 -0
  363. package/dist/core/layers/LayerWebGLRenderCmd.js +100 -0
  364. package/dist/core/layers/LayerWebGLRenderCmd.js.map +1 -0
  365. package/dist/core/layers/index.d.ts +5 -0
  366. package/dist/core/layers/index.d.ts.map +1 -0
  367. package/dist/core/layers/index.js +5 -0
  368. package/dist/core/layers/index.js.map +1 -0
  369. package/dist/core/platform/BlendFunc.d.ts +30 -0
  370. package/dist/core/platform/BlendFunc.d.ts.map +1 -0
  371. package/dist/core/platform/BlendFunc.js +50 -0
  372. package/dist/core/platform/BlendFunc.js.map +1 -0
  373. package/dist/core/platform/Color.d.ts +31 -0
  374. package/dist/core/platform/Color.d.ts.map +1 -0
  375. package/dist/core/platform/Color.js +71 -0
  376. package/dist/core/platform/Color.js.map +1 -0
  377. package/dist/core/platform/Common.d.ts +157 -0
  378. package/dist/core/platform/Common.d.ts.map +1 -0
  379. package/dist/core/platform/Common.js +180 -0
  380. package/dist/core/platform/Common.js.map +1 -0
  381. package/dist/core/platform/Config.d.ts +230 -0
  382. package/dist/core/platform/Config.d.ts.map +1 -0
  383. package/dist/core/platform/Config.js +231 -0
  384. package/dist/core/platform/Config.js.map +1 -0
  385. package/dist/core/platform/Dictionary.d.ts +16 -0
  386. package/dist/core/platform/Dictionary.d.ts.map +1 -0
  387. package/dist/core/platform/Dictionary.js +65 -0
  388. package/dist/core/platform/Dictionary.js.map +1 -0
  389. package/dist/core/platform/EGLView/ContainerStrategy.d.ts +30 -0
  390. package/dist/core/platform/EGLView/ContainerStrategy.d.ts.map +1 -0
  391. package/dist/core/platform/EGLView/ContainerStrategy.js +121 -0
  392. package/dist/core/platform/EGLView/ContainerStrategy.js.map +1 -0
  393. package/dist/core/platform/EGLView/ContentStrategy.d.ts +56 -0
  394. package/dist/core/platform/EGLView/ContentStrategy.d.ts.map +1 -0
  395. package/dist/core/platform/EGLView/ContentStrategy.js +117 -0
  396. package/dist/core/platform/EGLView/ContentStrategy.js.map +1 -0
  397. package/dist/core/platform/EGLView/EGLInstance.d.ts +8 -0
  398. package/dist/core/platform/EGLView/EGLInstance.d.ts.map +1 -0
  399. package/dist/core/platform/EGLView/EGLInstance.js +16 -0
  400. package/dist/core/platform/EGLView/EGLInstance.js.map +1 -0
  401. package/dist/core/platform/EGLView/ResolutionPolicy.d.ts +99 -0
  402. package/dist/core/platform/EGLView/ResolutionPolicy.d.ts.map +1 -0
  403. package/dist/core/platform/EGLView/ResolutionPolicy.js +116 -0
  404. package/dist/core/platform/EGLView/ResolutionPolicy.js.map +1 -0
  405. package/dist/core/platform/EGLView.d.ts +204 -0
  406. package/dist/core/platform/EGLView.d.ts.map +1 -0
  407. package/dist/core/platform/EGLView.js +669 -0
  408. package/dist/core/platform/EGLView.js.map +1 -0
  409. package/dist/core/platform/FontDefinition.d.ts +47 -0
  410. package/dist/core/platform/FontDefinition.d.ts.map +1 -0
  411. package/dist/core/platform/FontDefinition.js +59 -0
  412. package/dist/core/platform/FontDefinition.js.map +1 -0
  413. package/dist/core/platform/InputManager.d.ts +149 -0
  414. package/dist/core/platform/InputManager.d.ts.map +1 -0
  415. package/dist/core/platform/InputManager.js +558 -0
  416. package/dist/core/platform/InputManager.js.map +1 -0
  417. package/dist/core/platform/Loaders.d.ts +4 -0
  418. package/dist/core/platform/Loaders.d.ts.map +1 -0
  419. package/dist/core/platform/Loaders.js +141 -0
  420. package/dist/core/platform/Loaders.js.map +1 -0
  421. package/dist/core/platform/Macro.d.ts +634 -0
  422. package/dist/core/platform/Macro.d.ts.map +1 -0
  423. package/dist/core/platform/Macro.js +763 -0
  424. package/dist/core/platform/Macro.js.map +1 -0
  425. package/dist/core/platform/SAXParser.d.ts +44 -0
  426. package/dist/core/platform/SAXParser.d.ts.map +1 -0
  427. package/dist/core/platform/SAXParser.js +122 -0
  428. package/dist/core/platform/SAXParser.js.map +1 -0
  429. package/dist/core/platform/Types.d.ts +188 -0
  430. package/dist/core/platform/Types.d.ts.map +1 -0
  431. package/dist/core/platform/Types.js +425 -0
  432. package/dist/core/platform/Types.js.map +1 -0
  433. package/dist/core/platform/VisibleRect.d.ts +38 -0
  434. package/dist/core/platform/VisibleRect.d.ts.map +1 -0
  435. package/dist/core/platform/VisibleRect.js +66 -0
  436. package/dist/core/platform/VisibleRect.js.map +1 -0
  437. package/dist/core/platform/index.d.ts +7 -0
  438. package/dist/core/platform/index.d.ts.map +1 -0
  439. package/dist/core/platform/index.js +7 -0
  440. package/dist/core/platform/index.js.map +1 -0
  441. package/dist/core/platform/miniFramework.d.ts +28 -0
  442. package/dist/core/platform/miniFramework.d.ts.map +1 -0
  443. package/dist/core/platform/miniFramework.js +245 -0
  444. package/dist/core/platform/miniFramework.js.map +1 -0
  445. package/dist/core/platform/types/Quad2.d.ts +30 -0
  446. package/dist/core/platform/types/Quad2.d.ts.map +1 -0
  447. package/dist/core/platform/types/Quad2.js +62 -0
  448. package/dist/core/platform/types/Quad2.js.map +1 -0
  449. package/dist/core/platform/types/Quad3.d.ts +18 -0
  450. package/dist/core/platform/types/Quad3.d.ts.map +1 -0
  451. package/dist/core/platform/types/Quad3.js +30 -0
  452. package/dist/core/platform/types/Quad3.js.map +1 -0
  453. package/dist/core/platform/types/Tex2F.d.ts +20 -0
  454. package/dist/core/platform/types/Tex2F.d.ts.map +1 -0
  455. package/dist/core/platform/types/Tex2F.js +33 -0
  456. package/dist/core/platform/types/Tex2F.js.map +1 -0
  457. package/dist/core/platform/types/Vertex2F.d.ts +12 -0
  458. package/dist/core/platform/types/Vertex2F.d.ts.map +1 -0
  459. package/dist/core/platform/types/Vertex2F.js +25 -0
  460. package/dist/core/platform/types/Vertex2F.js.map +1 -0
  461. package/dist/core/platform/types/Vertex3F.d.ts +14 -0
  462. package/dist/core/platform/types/Vertex3F.d.ts.map +1 -0
  463. package/dist/core/platform/types/Vertex3F.js +31 -0
  464. package/dist/core/platform/types/Vertex3F.js.map +1 -0
  465. package/dist/core/platform/types/WebGLColor.d.ts +17 -0
  466. package/dist/core/platform/types/WebGLColor.d.ts.map +1 -0
  467. package/dist/core/platform/types/WebGLColor.js +40 -0
  468. package/dist/core/platform/types/WebGLColor.js.map +1 -0
  469. package/dist/core/renderer/GlobalVertexBuffer.d.ts +19 -0
  470. package/dist/core/renderer/GlobalVertexBuffer.d.ts.map +1 -0
  471. package/dist/core/renderer/GlobalVertexBuffer.js +99 -0
  472. package/dist/core/renderer/GlobalVertexBuffer.js.map +1 -0
  473. package/dist/core/renderer/RendererWebGL.d.ts +47 -0
  474. package/dist/core/renderer/RendererWebGL.d.ts.map +1 -0
  475. package/dist/core/renderer/RendererWebGL.js +389 -0
  476. package/dist/core/renderer/RendererWebGL.js.map +1 -0
  477. package/dist/core/scenes/Scene.d.ts +6 -0
  478. package/dist/core/scenes/Scene.d.ts.map +1 -0
  479. package/dist/core/scenes/Scene.js +12 -0
  480. package/dist/core/scenes/Scene.js.map +1 -0
  481. package/dist/core/sprites/Animation.d.ts +147 -0
  482. package/dist/core/sprites/Animation.d.ts.map +1 -0
  483. package/dist/core/sprites/Animation.js +277 -0
  484. package/dist/core/sprites/Animation.js.map +1 -0
  485. package/dist/core/sprites/AnimationCache.d.ts +37 -0
  486. package/dist/core/sprites/AnimationCache.d.ts.map +1 -0
  487. package/dist/core/sprites/AnimationCache.js +159 -0
  488. package/dist/core/sprites/AnimationCache.js.map +1 -0
  489. package/dist/core/sprites/Sprite.d.ts +104 -0
  490. package/dist/core/sprites/Sprite.d.ts.map +1 -0
  491. package/dist/core/sprites/Sprite.js +388 -0
  492. package/dist/core/sprites/Sprite.js.map +1 -0
  493. package/dist/core/sprites/SpriteBatchNode.d.ts +194 -0
  494. package/dist/core/sprites/SpriteBatchNode.d.ts.map +1 -0
  495. package/dist/core/sprites/SpriteBatchNode.js +332 -0
  496. package/dist/core/sprites/SpriteBatchNode.js.map +1 -0
  497. package/dist/core/sprites/SpriteFrame.d.ts +47 -0
  498. package/dist/core/sprites/SpriteFrame.d.ts.map +1 -0
  499. package/dist/core/sprites/SpriteFrame.js +223 -0
  500. package/dist/core/sprites/SpriteFrame.js.map +1 -0
  501. package/dist/core/sprites/SpriteFrameCache.d.ts +102 -0
  502. package/dist/core/sprites/SpriteFrameCache.d.ts.map +1 -0
  503. package/dist/core/sprites/SpriteFrameCache.js +333 -0
  504. package/dist/core/sprites/SpriteFrameCache.js.map +1 -0
  505. package/dist/core/sprites/SpriteLoadManager.d.ts +8 -0
  506. package/dist/core/sprites/SpriteLoadManager.d.ts.map +1 -0
  507. package/dist/core/sprites/SpriteLoadManager.js +37 -0
  508. package/dist/core/sprites/SpriteLoadManager.js.map +1 -0
  509. package/dist/core/sprites/SpriteWebGLRenderCmd.d.ts +35 -0
  510. package/dist/core/sprites/SpriteWebGLRenderCmd.d.ts.map +1 -0
  511. package/dist/core/sprites/SpriteWebGLRenderCmd.js +286 -0
  512. package/dist/core/sprites/SpriteWebGLRenderCmd.js.map +1 -0
  513. package/dist/core/sprites/SpritesPropertyDefine.d.ts +2 -0
  514. package/dist/core/sprites/SpritesPropertyDefine.d.ts.map +1 -0
  515. package/dist/core/sprites/SpritesPropertyDefine.js +19 -0
  516. package/dist/core/sprites/SpritesPropertyDefine.js.map +1 -0
  517. package/dist/core/support/PointExtension.d.ts +296 -0
  518. package/dist/core/support/PointExtension.d.ts.map +1 -0
  519. package/dist/core/support/PointExtension.js +443 -0
  520. package/dist/core/support/PointExtension.js.map +1 -0
  521. package/dist/core/support/Vertex.d.ts +24 -0
  522. package/dist/core/support/Vertex.d.ts.map +1 -0
  523. package/dist/core/support/Vertex.js +120 -0
  524. package/dist/core/support/Vertex.js.map +1 -0
  525. package/dist/core/utils/BinaryLoader.d.ts +9 -0
  526. package/dist/core/utils/BinaryLoader.d.ts.map +1 -0
  527. package/dist/core/utils/BinaryLoader.js +116 -0
  528. package/dist/core/utils/BinaryLoader.js.map +1 -0
  529. package/dist/core/utils/Profiler.d.ts +13 -0
  530. package/dist/core/utils/Profiler.d.ts.map +1 -0
  531. package/dist/core/utils/Profiler.js +140 -0
  532. package/dist/core/utils/Profiler.js.map +1 -0
  533. package/dist/helper/AsyncPool.d.ts +22 -0
  534. package/dist/helper/AsyncPool.d.ts.map +1 -0
  535. package/dist/helper/AsyncPool.js +101 -0
  536. package/dist/helper/AsyncPool.js.map +1 -0
  537. package/dist/helper/Base64.d.ts +29 -0
  538. package/dist/helper/Base64.d.ts.map +1 -0
  539. package/dist/helper/Base64.js +71 -0
  540. package/dist/helper/Base64.js.map +1 -0
  541. package/dist/helper/Debugger.d.ts +179 -0
  542. package/dist/helper/Debugger.d.ts.map +1 -0
  543. package/dist/helper/Debugger.js +250 -0
  544. package/dist/helper/Debugger.js.map +1 -0
  545. package/dist/helper/ZipUtils.d.ts +2 -0
  546. package/dist/helper/ZipUtils.d.ts.map +1 -0
  547. package/dist/helper/ZipUtils.js +20 -0
  548. package/dist/helper/ZipUtils.js.map +1 -0
  549. package/dist/helper/async.d.ts +49 -0
  550. package/dist/helper/async.d.ts.map +1 -0
  551. package/dist/helper/async.js +95 -0
  552. package/dist/helper/async.js.map +1 -0
  553. package/dist/helper/checkType.d.ts +8 -0
  554. package/dist/helper/checkType.d.ts.map +1 -0
  555. package/dist/helper/checkType.js +31 -0
  556. package/dist/helper/checkType.js.map +1 -0
  557. package/dist/helper/engine.d.ts +6 -0
  558. package/dist/helper/engine.d.ts.map +1 -0
  559. package/dist/helper/engine.js +115 -0
  560. package/dist/helper/engine.js.map +1 -0
  561. package/dist/helper/getset.d.ts +2 -0
  562. package/dist/helper/getset.d.ts.map +1 -0
  563. package/dist/helper/getset.js +51 -0
  564. package/dist/helper/getset.js.map +1 -0
  565. package/dist/helper/global.d.ts +6 -0
  566. package/dist/helper/global.d.ts.map +1 -0
  567. package/dist/helper/global.js +6 -0
  568. package/dist/helper/global.js.map +1 -0
  569. package/dist/helper/index.d.ts +3 -0
  570. package/dist/helper/index.d.ts.map +1 -0
  571. package/dist/helper/index.js +3 -0
  572. package/dist/helper/index.js.map +1 -0
  573. package/dist/helper/loader.d.ts +102 -0
  574. package/dist/helper/loader.d.ts.map +1 -0
  575. package/dist/helper/loader.js +447 -0
  576. package/dist/helper/loader.js.map +1 -0
  577. package/dist/helper/path.d.ts +12 -0
  578. package/dist/helper/path.d.ts.map +1 -0
  579. package/dist/helper/path.js +75 -0
  580. package/dist/helper/path.js.map +1 -0
  581. package/dist/helper/string.d.ts +2 -0
  582. package/dist/helper/string.d.ts.map +1 -0
  583. package/dist/helper/string.js +32 -0
  584. package/dist/helper/string.js.map +1 -0
  585. package/dist/helper/sys.d.ts +446 -0
  586. package/dist/helper/sys.d.ts.map +1 -0
  587. package/dist/helper/sys.js +691 -0
  588. package/dist/helper/sys.js.map +1 -0
  589. package/dist/index.d.ts +11 -0
  590. package/dist/index.d.ts.map +1 -0
  591. package/dist/index.js +11 -0
  592. package/dist/index.js.map +1 -0
  593. package/dist/motion-streak/MotionStreak.d.ts +56 -0
  594. package/dist/motion-streak/MotionStreak.d.ts.map +1 -0
  595. package/dist/motion-streak/MotionStreak.js +301 -0
  596. package/dist/motion-streak/MotionStreak.js.map +1 -0
  597. package/dist/motion-streak/MotionStreakWebGLRenderCmd.d.ts +9 -0
  598. package/dist/motion-streak/MotionStreakWebGLRenderCmd.d.ts.map +1 -0
  599. package/dist/motion-streak/MotionStreakWebGLRenderCmd.js +52 -0
  600. package/dist/motion-streak/MotionStreakWebGLRenderCmd.js.map +1 -0
  601. package/dist/motion-streak/index.d.ts +2 -0
  602. package/dist/motion-streak/index.d.ts.map +1 -0
  603. package/dist/motion-streak/index.js +2 -0
  604. package/dist/motion-streak/index.js.map +1 -0
  605. package/dist/particle/PNGReader.d.ts +30 -0
  606. package/dist/particle/PNGReader.d.ts.map +1 -0
  607. package/dist/particle/PNGReader.js +304 -0
  608. package/dist/particle/PNGReader.js.map +1 -0
  609. package/dist/particle/Particle.d.ts +27 -0
  610. package/dist/particle/Particle.d.ts.map +1 -0
  611. package/dist/particle/Particle.js +50 -0
  612. package/dist/particle/Particle.js.map +1 -0
  613. package/dist/particle/ParticleBatchNode.d.ts +163 -0
  614. package/dist/particle/ParticleBatchNode.d.ts.map +1 -0
  615. package/dist/particle/ParticleBatchNode.js +447 -0
  616. package/dist/particle/ParticleBatchNode.js.map +1 -0
  617. package/dist/particle/ParticleBatchNodeWebGLRenderCmd.d.ts +8 -0
  618. package/dist/particle/ParticleBatchNodeWebGLRenderCmd.d.ts.map +1 -0
  619. package/dist/particle/ParticleBatchNodeWebGLRenderCmd.js +33 -0
  620. package/dist/particle/ParticleBatchNodeWebGLRenderCmd.js.map +1 -0
  621. package/dist/particle/ParticleSystem.d.ts +941 -0
  622. package/dist/particle/ParticleSystem.d.ts.map +1 -0
  623. package/dist/particle/ParticleSystem.js +2017 -0
  624. package/dist/particle/ParticleSystem.js.map +1 -0
  625. package/dist/particle/ParticleSystemWebGLRenderCmd.d.ts +29 -0
  626. package/dist/particle/ParticleSystemWebGLRenderCmd.d.ts.map +1 -0
  627. package/dist/particle/ParticleSystemWebGLRenderCmd.js +346 -0
  628. package/dist/particle/ParticleSystemWebGLRenderCmd.js.map +1 -0
  629. package/dist/particle/TIFFReader.d.ts +138 -0
  630. package/dist/particle/TIFFReader.d.ts.map +1 -0
  631. package/dist/particle/TIFFReader.js +596 -0
  632. package/dist/particle/TIFFReader.js.map +1 -0
  633. package/dist/particle/examples/ParticleFire.d.ts +60 -0
  634. package/dist/particle/examples/ParticleFire.d.ts.map +1 -0
  635. package/dist/particle/examples/ParticleFire.js +188 -0
  636. package/dist/particle/examples/ParticleFire.js.map +1 -0
  637. package/dist/particle/examples/ParticleGalaxy.d.ts +60 -0
  638. package/dist/particle/examples/ParticleGalaxy.d.ts.map +1 -0
  639. package/dist/particle/examples/ParticleGalaxy.js +199 -0
  640. package/dist/particle/examples/ParticleGalaxy.js.map +1 -0
  641. package/dist/particle/examples/ParticleSmoke.d.ts +60 -0
  642. package/dist/particle/examples/ParticleSmoke.d.ts.map +1 -0
  643. package/dist/particle/examples/ParticleSmoke.js +195 -0
  644. package/dist/particle/examples/ParticleSmoke.js.map +1 -0
  645. package/dist/particle/examples/ParticleSpiral.d.ts +38 -0
  646. package/dist/particle/examples/ParticleSpiral.d.ts.map +1 -0
  647. package/dist/particle/examples/ParticleSpiral.js +130 -0
  648. package/dist/particle/examples/ParticleSpiral.js.map +1 -0
  649. package/dist/particle/examples/index.d.ts +5 -0
  650. package/dist/particle/examples/index.d.ts.map +1 -0
  651. package/dist/particle/examples/index.js +5 -0
  652. package/dist/particle/examples/index.js.map +1 -0
  653. package/dist/particle/index.d.ts +2 -0
  654. package/dist/particle/index.d.ts.map +1 -0
  655. package/dist/particle/index.js +2 -0
  656. package/dist/particle/index.js.map +1 -0
  657. package/dist/polyfills.d.ts +34 -0
  658. package/dist/polyfills.d.ts.map +1 -0
  659. package/dist/polyfills.js +102 -0
  660. package/dist/polyfills.js.map +1 -0
  661. package/dist/progress-timer/ActionProgressTimer.d.ts +118 -0
  662. package/dist/progress-timer/ActionProgressTimer.d.ts.map +1 -0
  663. package/dist/progress-timer/ActionProgressTimer.js +173 -0
  664. package/dist/progress-timer/ActionProgressTimer.js.map +1 -0
  665. package/dist/progress-timer/ProgressTimer.d.ts +143 -0
  666. package/dist/progress-timer/ProgressTimer.d.ts.map +1 -0
  667. package/dist/progress-timer/ProgressTimer.js +228 -0
  668. package/dist/progress-timer/ProgressTimer.js.map +1 -0
  669. package/dist/progress-timer/ProgressTimerWebGLRenderCmd.d.ts +56 -0
  670. package/dist/progress-timer/ProgressTimerWebGLRenderCmd.d.ts.map +1 -0
  671. package/dist/progress-timer/ProgressTimerWebGLRenderCmd.js +445 -0
  672. package/dist/progress-timer/ProgressTimerWebGLRenderCmd.js.map +1 -0
  673. package/dist/progress-timer/index.d.ts +3 -0
  674. package/dist/progress-timer/index.d.ts.map +1 -0
  675. package/dist/progress-timer/index.js +3 -0
  676. package/dist/progress-timer/index.js.map +1 -0
  677. package/dist/render-texture/RenderTexture.d.ts +226 -0
  678. package/dist/render-texture/RenderTexture.d.ts.map +1 -0
  679. package/dist/render-texture/RenderTexture.js +332 -0
  680. package/dist/render-texture/RenderTexture.js.map +1 -0
  681. package/dist/render-texture/RenderTextureWebGLRenderCmd.d.ts +28 -0
  682. package/dist/render-texture/RenderTextureWebGLRenderCmd.d.ts.map +1 -0
  683. package/dist/render-texture/RenderTextureWebGLRenderCmd.js +276 -0
  684. package/dist/render-texture/RenderTextureWebGLRenderCmd.js.map +1 -0
  685. package/dist/render-texture/index.d.ts +2 -0
  686. package/dist/render-texture/index.d.ts.map +1 -0
  687. package/dist/render-texture/index.js +2 -0
  688. package/dist/render-texture/index.js.map +1 -0
  689. package/dist/shaders/GLProgram.d.ts +288 -0
  690. package/dist/shaders/GLProgram.d.ts.map +1 -0
  691. package/dist/shaders/GLProgram.js +794 -0
  692. package/dist/shaders/GLProgram.js.map +1 -0
  693. package/dist/shaders/GLProgramState.d.ts +58 -0
  694. package/dist/shaders/GLProgramState.d.ts.map +1 -0
  695. package/dist/shaders/GLProgramState.js +255 -0
  696. package/dist/shaders/GLProgramState.js.map +1 -0
  697. package/dist/shaders/GLStateCache.d.ts +97 -0
  698. package/dist/shaders/GLStateCache.d.ts.map +1 -0
  699. package/dist/shaders/GLStateCache.js +255 -0
  700. package/dist/shaders/GLStateCache.js.map +1 -0
  701. package/dist/shaders/ShaderCache.d.ts +111 -0
  702. package/dist/shaders/ShaderCache.d.ts.map +1 -0
  703. package/dist/shaders/ShaderCache.js +273 -0
  704. package/dist/shaders/ShaderCache.js.map +1 -0
  705. package/dist/shaders/Shaders.d.ts +84 -0
  706. package/dist/shaders/Shaders.d.ts.map +1 -0
  707. package/dist/shaders/Shaders.js +250 -0
  708. package/dist/shaders/Shaders.js.map +1 -0
  709. package/dist/shaders/index.d.ts +5 -0
  710. package/dist/shaders/index.d.ts.map +1 -0
  711. package/dist/shaders/index.js +5 -0
  712. package/dist/shaders/index.js.map +1 -0
  713. package/dist/shape-nodes/DrawNode.d.ts +61 -0
  714. package/dist/shape-nodes/DrawNode.d.ts.map +1 -0
  715. package/dist/shape-nodes/DrawNode.js +597 -0
  716. package/dist/shape-nodes/DrawNode.js.map +1 -0
  717. package/dist/shape-nodes/DrawNodeWebGLRenderCmd.d.ts +11 -0
  718. package/dist/shape-nodes/DrawNodeWebGLRenderCmd.d.ts.map +1 -0
  719. package/dist/shape-nodes/DrawNodeWebGLRenderCmd.js +27 -0
  720. package/dist/shape-nodes/DrawNodeWebGLRenderCmd.js.map +1 -0
  721. package/dist/text-input/IMEDispatcher.d.ts +180 -0
  722. package/dist/text-input/IMEDispatcher.d.ts.map +1 -0
  723. package/dist/text-input/IMEDispatcher.js +454 -0
  724. package/dist/text-input/IMEDispatcher.js.map +1 -0
  725. package/dist/text-input/TextFieldTTF.d.ts +219 -0
  726. package/dist/text-input/TextFieldTTF.d.ts.map +1 -0
  727. package/dist/text-input/TextFieldTTF.js +381 -0
  728. package/dist/text-input/TextFieldTTF.js.map +1 -0
  729. package/dist/textures/Texture2D.d.ts +10 -0
  730. package/dist/textures/Texture2D.d.ts.map +1 -0
  731. package/dist/textures/Texture2D.js +10 -0
  732. package/dist/textures/Texture2D.js.map +1 -0
  733. package/dist/textures/TextureAtlas.d.ts +204 -0
  734. package/dist/textures/TextureAtlas.d.ts.map +1 -0
  735. package/dist/textures/TextureAtlas.js +602 -0
  736. package/dist/textures/TextureAtlas.js.map +1 -0
  737. package/dist/textures/TextureCache.d.ts +147 -0
  738. package/dist/textures/TextureCache.d.ts.map +1 -0
  739. package/dist/textures/TextureCache.js +327 -0
  740. package/dist/textures/TextureCache.js.map +1 -0
  741. package/dist/textures/TexturesPropertyDefine.d.ts +2 -0
  742. package/dist/textures/TexturesPropertyDefine.d.ts.map +1 -0
  743. package/dist/textures/TexturesPropertyDefine.js +39 -0
  744. package/dist/textures/TexturesPropertyDefine.js.map +1 -0
  745. package/dist/textures/TexturesWebGL.d.ts +349 -0
  746. package/dist/textures/TexturesWebGL.d.ts.map +1 -0
  747. package/dist/textures/TexturesWebGL.js +765 -0
  748. package/dist/textures/TexturesWebGL.js.map +1 -0
  749. package/dist/textures/WebGLTextureCache.d.ts +2 -0
  750. package/dist/textures/WebGLTextureCache.d.ts.map +1 -0
  751. package/dist/textures/WebGLTextureCache.js +79 -0
  752. package/dist/textures/WebGLTextureCache.js.map +1 -0
  753. package/dist/textures/index.d.ts +3 -0
  754. package/dist/textures/index.d.ts.map +1 -0
  755. package/dist/textures/index.js +3 -0
  756. package/dist/textures/index.js.map +1 -0
  757. package/dist/tilemap/TGAlib.d.ts +103 -0
  758. package/dist/tilemap/TGAlib.d.ts.map +1 -0
  759. package/dist/tilemap/TGAlib.js +338 -0
  760. package/dist/tilemap/TGAlib.js.map +1 -0
  761. package/dist/tilemap/TMXLayer.d.ts +225 -0
  762. package/dist/tilemap/TMXLayer.d.ts.map +1 -0
  763. package/dist/tilemap/TMXLayer.js +694 -0
  764. package/dist/tilemap/TMXLayer.js.map +1 -0
  765. package/dist/tilemap/TMXLayerInfo.d.ts +42 -0
  766. package/dist/tilemap/TMXLayerInfo.d.ts.map +1 -0
  767. package/dist/tilemap/TMXLayerInfo.js +57 -0
  768. package/dist/tilemap/TMXLayerInfo.js.map +1 -0
  769. package/dist/tilemap/TMXLayerWebGLRenderCmd.d.ts +17 -0
  770. package/dist/tilemap/TMXLayerWebGLRenderCmd.d.ts.map +1 -0
  771. package/dist/tilemap/TMXLayerWebGLRenderCmd.js +209 -0
  772. package/dist/tilemap/TMXLayerWebGLRenderCmd.js.map +1 -0
  773. package/dist/tilemap/TMXMapInfo.d.ts +210 -0
  774. package/dist/tilemap/TMXMapInfo.d.ts.map +1 -0
  775. package/dist/tilemap/TMXMapInfo.js +614 -0
  776. package/dist/tilemap/TMXMapInfo.js.map +1 -0
  777. package/dist/tilemap/TMXObjectGroup.d.ts +70 -0
  778. package/dist/tilemap/TMXObjectGroup.d.ts.map +1 -0
  779. package/dist/tilemap/TMXObjectGroup.js +106 -0
  780. package/dist/tilemap/TMXObjectGroup.js.map +1 -0
  781. package/dist/tilemap/TMXTiledMap.d.ts +163 -0
  782. package/dist/tilemap/TMXTiledMap.d.ts.map +1 -0
  783. package/dist/tilemap/TMXTiledMap.js +347 -0
  784. package/dist/tilemap/TMXTiledMap.js.map +1 -0
  785. package/dist/tilemap/TMXTilesetInfo.d.ts +38 -0
  786. package/dist/tilemap/TMXTilesetInfo.d.ts.map +1 -0
  787. package/dist/tilemap/TMXTilesetInfo.js +59 -0
  788. package/dist/tilemap/TMXTilesetInfo.js.map +1 -0
  789. package/dist/tilemap/TMXXMLParser.d.ts +52 -0
  790. package/dist/tilemap/TMXXMLParser.d.ts.map +1 -0
  791. package/dist/tilemap/TMXXMLParser.js +52 -0
  792. package/dist/tilemap/TMXXMLParser.js.map +1 -0
  793. package/dist/tilemap/index.d.ts +4 -0
  794. package/dist/tilemap/index.d.ts.map +1 -0
  795. package/dist/tilemap/index.js +4 -0
  796. package/dist/tilemap/index.js.map +1 -0
  797. package/dist/ui/base/FocusNavigationController.d.ts +12 -0
  798. package/dist/ui/base/FocusNavigationController.d.ts.map +1 -0
  799. package/dist/ui/base/FocusNavigationController.js +54 -0
  800. package/dist/ui/base/FocusNavigationController.js.map +1 -0
  801. package/dist/ui/base/ProtectedNode.d.ts +66 -0
  802. package/dist/ui/base/ProtectedNode.d.ts.map +1 -0
  803. package/dist/ui/base/ProtectedNode.js +248 -0
  804. package/dist/ui/base/ProtectedNode.js.map +1 -0
  805. package/dist/ui/base/ProtectedNodeWebGLRenderCmd.d.ts +13 -0
  806. package/dist/ui/base/ProtectedNodeWebGLRenderCmd.d.ts.map +1 -0
  807. package/dist/ui/base/ProtectedNodeWebGLRenderCmd.js +136 -0
  808. package/dist/ui/base/ProtectedNodeWebGLRenderCmd.js.map +1 -0
  809. package/dist/ui/base/UIHelper.d.ts +48 -0
  810. package/dist/ui/base/UIHelper.d.ts.map +1 -0
  811. package/dist/ui/base/UIHelper.js +128 -0
  812. package/dist/ui/base/UIHelper.js.map +1 -0
  813. package/dist/ui/base/UIScale9Sprite.d.ts +224 -0
  814. package/dist/ui/base/UIScale9Sprite.d.ts.map +1 -0
  815. package/dist/ui/base/UIScale9Sprite.js +825 -0
  816. package/dist/ui/base/UIScale9Sprite.js.map +1 -0
  817. package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.d.ts +15 -0
  818. package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.d.ts.map +1 -0
  819. package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.js +119 -0
  820. package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.js.map +1 -0
  821. package/dist/ui/base/UIWidget.d.ts +794 -0
  822. package/dist/ui/base/UIWidget.d.ts.map +1 -0
  823. package/dist/ui/base/UIWidget.js +1634 -0
  824. package/dist/ui/base/UIWidget.js.map +1 -0
  825. package/dist/ui/base/UIWidgetRenderCmd.d.ts +9 -0
  826. package/dist/ui/base/UIWidgetRenderCmd.d.ts.map +1 -0
  827. package/dist/ui/base/UIWidgetRenderCmd.js +41 -0
  828. package/dist/ui/base/UIWidgetRenderCmd.js.map +1 -0
  829. package/dist/ui/index.d.ts +9 -0
  830. package/dist/ui/index.d.ts.map +1 -0
  831. package/dist/ui/index.js +9 -0
  832. package/dist/ui/index.js.map +1 -0
  833. package/dist/ui/layout/UILayout.d.ts +486 -0
  834. package/dist/ui/layout/UILayout.d.ts.map +1 -0
  835. package/dist/ui/layout/UILayout.js +1430 -0
  836. package/dist/ui/layout/UILayout.js.map +1 -0
  837. package/dist/ui/layout/UILayoutParameter.d.ts +344 -0
  838. package/dist/ui/layout/UILayoutParameter.d.ts.map +1 -0
  839. package/dist/ui/layout/UILayoutParameter.js +444 -0
  840. package/dist/ui/layout/UILayoutParameter.js.map +1 -0
  841. package/dist/ui/layout/UILayoutWebGLRenderCmd.d.ts +30 -0
  842. package/dist/ui/layout/UILayoutWebGLRenderCmd.d.ts.map +1 -0
  843. package/dist/ui/layout/UILayoutWebGLRenderCmd.js +136 -0
  844. package/dist/ui/layout/UILayoutWebGLRenderCmd.js.map +1 -0
  845. package/dist/ui/layout/constant.d.ts +30 -0
  846. package/dist/ui/layout/constant.d.ts.map +1 -0
  847. package/dist/ui/layout/constant.js +31 -0
  848. package/dist/ui/layout/constant.js.map +1 -0
  849. package/dist/ui/widget/UIButton.d.ts +248 -0
  850. package/dist/ui/widget/UIButton.d.ts.map +1 -0
  851. package/dist/ui/widget/UIButton.js +727 -0
  852. package/dist/ui/widget/UIButton.js.map +1 -0
  853. package/dist/ui/widget/UIRichText.d.ts +216 -0
  854. package/dist/ui/widget/UIRichText.d.ts.map +1 -0
  855. package/dist/ui/widget/UIRichText.js +549 -0
  856. package/dist/ui/widget/UIRichText.js.map +1 -0
  857. package/dist/ui/widget/UIScrollView.d.ts +547 -0
  858. package/dist/ui/widget/UIScrollView.d.ts.map +1 -0
  859. package/dist/ui/widget/UIScrollView.js +1544 -0
  860. package/dist/ui/widget/UIScrollView.js.map +1 -0
  861. package/dist/ui/widget/UIScrollViewBar.d.ts +101 -0
  862. package/dist/ui/widget/UIScrollViewBar.d.ts.map +1 -0
  863. package/dist/ui/widget/UIScrollViewBar.js +277 -0
  864. package/dist/ui/widget/UIScrollViewBar.js.map +1 -0
  865. package/dist/ui/widget/UIScrollViewWebGLRenderCmd.d.ts +10 -0
  866. package/dist/ui/widget/UIScrollViewWebGLRenderCmd.d.ts.map +1 -0
  867. package/dist/ui/widget/UIScrollViewWebGLRenderCmd.js +42 -0
  868. package/dist/ui/widget/UIScrollViewWebGLRenderCmd.js.map +1 -0
  869. package/dist/ui/widget/UISlider.d.ts +229 -0
  870. package/dist/ui/widget/UISlider.d.ts.map +1 -0
  871. package/dist/ui/widget/UISlider.js +667 -0
  872. package/dist/ui/widget/UISlider.js.map +1 -0
  873. package/dist/ui/widget/UIText.d.ts +90 -0
  874. package/dist/ui/widget/UIText.d.ts.map +1 -0
  875. package/dist/ui/widget/UIText.js +325 -0
  876. package/dist/ui/widget/UIText.js.map +1 -0
  877. package/dist/ui/widget/UITextField.d.ts +282 -0
  878. package/dist/ui/widget/UITextField.d.ts.map +1 -0
  879. package/dist/ui/widget/UITextField.js +549 -0
  880. package/dist/ui/widget/UITextField.js.map +1 -0
  881. package/dist/ui/widget/UITextFieldRenderer.d.ts +41 -0
  882. package/dist/ui/widget/UITextFieldRenderer.d.ts.map +1 -0
  883. package/dist/ui/widget/UITextFieldRenderer.js +150 -0
  884. package/dist/ui/widget/UITextFieldRenderer.js.map +1 -0
  885. package/eslint.config.ts +59 -0
  886. package/index.html +22 -0
  887. package/package.json +38 -0
  888. package/res/Button.mp3 +0 -0
  889. package/res/SmallSun.plist +108 -0
  890. package/res/Spiral.plist +102 -0
  891. package/res/base.png +0 -0
  892. package/res/button.png +0 -0
  893. package/res/button_plus.png +0 -0
  894. package/res/ortho-test1.png +0 -0
  895. package/res/orthogonal-test1.tmx +9 -0
  896. package/res/orthogonal-test1.tsx +4 -0
  897. package/res/particle.png +0 -0
  898. package/res/sliderThumb.png +0 -0
  899. package/res/sliderTrack.png +0 -0
  900. package/res/streak.png +0 -0
  901. package/res/ui.plist +578 -0
  902. package/res/ui.png +0 -0
  903. package/res/vite.svg +1 -0
  904. package/test/ActionScene.ts +15 -0
  905. package/test/DemoScene.ts +108 -0
  906. package/test/GraphicsTest.ts +17 -0
  907. package/test/ParticleScene.ts +24 -0
  908. package/test/TiledMapScene.ts +14 -0
  909. package/test/index.ts +28 -0
  910. package/vite.config.ts +13 -0
@@ -0,0 +1,694 @@
1
+ import { game, renderer } from '../boot';
2
+ import { p, pointPixelsToPoints, rectPixelsToPoints, SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST, Size, sizePixelsToPoints, Sprite, UNIFORM_ALPHA_TEST_VALUE_S, } from '../core';
3
+ import { SpriteBatchNode } from '../core/sprites/SpriteBatchNode';
4
+ import { log } from '../helper/Debugger';
5
+ import { _renderType } from '../helper/engine';
6
+ import { defineGetterSetter } from '../helper/getset';
7
+ import { shaderCache } from '../shaders/ShaderCache';
8
+ import { textureCache } from '../textures';
9
+ import { TMXLayerWebGLRenderCmd } from './TMXLayerWebGLRenderCmd';
10
+ import { TMX_ORIENTATION_HEX, TMX_ORIENTATION_ISO, TMX_ORIENTATION_ORTHO } from './TMXTiledMap';
11
+ import { TMX_TILE_DIAGONAL_FLAG, TMX_TILE_FLIPPED_ALL, TMX_TILE_FLIPPED_MASK, TMX_TILE_HORIZONTAL_FLAG, TMX_TILE_VERTICAL_FLAG, } from './TMXXMLParser';
12
+ /**
13
+ * <p>TMXLayer represents the TMX layer. </p>
14
+ *
15
+ * <p>It is a subclass of SpriteBatchNode. By default the tiles are rendered using a TextureAtlas. <br />
16
+ * If you modify a tile on runtime, then, that tile will become a Sprite, otherwise no Sprite objects are created. <br />
17
+ * The benefits of using Sprite objects as tiles are: <br />
18
+ * - tiles (Sprite) can be rotated/scaled/moved with a nice API </p>
19
+ *
20
+ * <p>If the layer contains a property named "vertexz" with an integer (in can be positive or negative), <br />
21
+ * then all the tiles belonging to the layer will use that value as their OpenGL vertex Z for depth. </p>
22
+ *
23
+ * <p>On the other hand, if the "vertexz" property has the "automatic" value, then the tiles will use an automatic vertex Z value. <br />
24
+ * Also before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawing them. The used alpha func will be: </p>
25
+ *
26
+ * glAlphaFunc( GL_GREATER, value ) <br />
27
+ *
28
+ * <p>"value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer. <br />
29
+ * The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a different value, like 0.5.</p>
30
+ * @class
31
+ * @extends SpriteBatchNode
32
+ *
33
+ * @property {Array} tiles - Tiles for layer
34
+ * @property {TMXTilesetInfo} tileset - Tileset for layer
35
+ * @property {Number} layerOrientation - Layer orientation
36
+ * @property {Array} properties - Properties from the layer. They can be added using tilemap editors
37
+ * @property {String} layerName - Name of the layer
38
+ * @property {Number} layerWidth - Width of the layer
39
+ * @property {Number} layerHeight - Height of the layer
40
+ * @property {Number} tileWidth - Width of a tile
41
+ * @property {Number} tileHeight - Height of a tile
42
+ */
43
+ export class TMXLayer extends SpriteBatchNode {
44
+ tiles = null;
45
+ tileset = null;
46
+ layerOrientation = null;
47
+ properties = null;
48
+ layerName = '';
49
+ _textures = null;
50
+ _texGrids = null;
51
+ _spriteTiles = null;
52
+ //size of the layer in tiles
53
+ _layerSize = null;
54
+ _mapTileSize = null;
55
+ //TMX Layer supports opacity
56
+ _opacity = 255;
57
+ _minGID = null;
58
+ _maxGID = null;
59
+ //Only used when vertexZ is used
60
+ _vertexZvalue = null;
61
+ _useAutomaticVertexZ = null;
62
+ //used for optimization
63
+ _reusedTile = null;
64
+ _atlasIndexArray = null;
65
+ //used for retina display
66
+ _contentScaleFactor = null;
67
+ _className = 'TMXLayer';
68
+ /**
69
+ * Creates a TMXLayer with an tile set info, a layer info and a map info <br/>
70
+ * Constructor of TMXLayer
71
+ * @param {TMXTilesetInfo} tilesetInfo
72
+ * @param {TMXLayerInfo} layerInfo
73
+ * @param {TMXMapInfo} mapInfo
74
+ */
75
+ constructor(tilesetInfo, layerInfo, mapInfo) {
76
+ super();
77
+ // this._descendants = []
78
+ this._layerSize = Size(0, 0);
79
+ this._mapTileSize = Size(0, 0);
80
+ this._spriteTiles = {};
81
+ if (mapInfo !== undefined)
82
+ this.initWithTilesetInfo(tilesetInfo, layerInfo, mapInfo);
83
+ }
84
+ _createRenderCmd() {
85
+ return new TMXLayerWebGLRenderCmd(this);
86
+ }
87
+ _fillTextureGrids(tileset, texId) {
88
+ const tex = this._textures[texId];
89
+ if (!tex.isLoaded()) {
90
+ tex.addEventListener('load', () => {
91
+ this._fillTextureGrids(tileset, texId);
92
+ }, this);
93
+ return;
94
+ }
95
+ if (!tileset.imageSize.width || !tileset.imageSize.height) {
96
+ tileset.imageSize.width = tex.width;
97
+ tileset.imageSize.height = tex.height;
98
+ }
99
+ const tw = tileset._tileSize.width;
100
+ const th = tileset._tileSize.height;
101
+ const imageW = tex._contentSize.width;
102
+ const imageH = tex._contentSize.height;
103
+ const spacing = tileset.spacing;
104
+ const margin = tileset.margin;
105
+ const cols = Math.floor((imageW - margin * 2 + spacing) / (tw + spacing));
106
+ const rows = Math.floor((imageH - margin * 2 + spacing) / (th + spacing));
107
+ const count = rows * cols;
108
+ let gid = tileset.firstGid;
109
+ const maxGid = tileset.firstGid + count;
110
+ const grids = this._texGrids;
111
+ let grid;
112
+ let override = grids[gid] ? true : false;
113
+ for (; gid < maxGid; ++gid) {
114
+ // Avoid overlapping
115
+ if (override && !grids[gid]) {
116
+ override = false;
117
+ }
118
+ if (!override && grids[gid]) {
119
+ break;
120
+ }
121
+ grid = {
122
+ texId: texId,
123
+ x: 0,
124
+ y: 0,
125
+ width: tw,
126
+ height: th,
127
+ t: 0,
128
+ l: 0,
129
+ r: 0,
130
+ b: 0,
131
+ };
132
+ tileset.rectForGID(gid, grid);
133
+ grid.t = grid.y / imageH;
134
+ grid.l = grid.x / imageW;
135
+ grid.r = (grid.x + grid.width) / imageW;
136
+ grid.b = (grid.y + grid.height) / imageH;
137
+ grids[gid] = grid;
138
+ }
139
+ }
140
+ /**
141
+ * Initializes a TMXLayer with a tileset info, a layer info and a map info
142
+ * @param {TMXTilesetInfo} tilesetInfo
143
+ * @param {TMXLayerInfo} layerInfo
144
+ * @param {TMXMapInfo} mapInfo
145
+ * @return {Boolean}
146
+ */
147
+ initWithTilesetInfo(tilesetInfo, layerInfo, mapInfo) {
148
+ const size = layerInfo._layerSize;
149
+ const totalNumberOfTiles = (size.width * size.height) | 0;
150
+ // layerInfo
151
+ this.layerName = layerInfo.name;
152
+ this.tiles = layerInfo._tiles;
153
+ this.properties = layerInfo.properties;
154
+ this._layerSize = size;
155
+ this._minGID = layerInfo._minGID;
156
+ this._maxGID = layerInfo._maxGID;
157
+ this._opacity = layerInfo._opacity;
158
+ // tilesetInfo
159
+ this.tileset = tilesetInfo;
160
+ // mapInfo
161
+ this.layerOrientation = mapInfo.orientation;
162
+ this._mapTileSize = mapInfo.getTileSize();
163
+ const tilesets = mapInfo._tilesets;
164
+ if (tilesets) {
165
+ this._textures = [];
166
+ this._texGrids = [];
167
+ const len = tilesets.length;
168
+ for (let i = 0; i < len; ++i) {
169
+ const tileset = tilesets[i];
170
+ const tex = textureCache.addImage(tileset.sourceImage);
171
+ this._textures.push(tex);
172
+ this._fillTextureGrids(tileset, i);
173
+ if (tileset === tilesetInfo) {
174
+ this._texture = tex;
175
+ }
176
+ }
177
+ }
178
+ // offset (after layer orientation is set);
179
+ const offset = this._calculateLayerOffset(layerInfo.offset);
180
+ this.setPosition(pointPixelsToPoints(offset));
181
+ // Parse cocos2d properties
182
+ this._parseInternalProperties();
183
+ this.setContentSize(sizePixelsToPoints(Size(this._layerSize.width * this._mapTileSize.width, this._layerSize.height * this._mapTileSize.height)));
184
+ this._useAutomaticVertexZ = false;
185
+ this._vertexZvalue = 0;
186
+ return true;
187
+ }
188
+ /**
189
+ * Gets layer size.
190
+ * @return {Size}
191
+ */
192
+ getLayerSize() {
193
+ return Size(this._layerSize.width, this._layerSize.height);
194
+ }
195
+ /**
196
+ * Set layer size
197
+ * @param {Size} Var
198
+ */
199
+ setLayerSize(Var) {
200
+ this._layerSize.width = Var.width;
201
+ this._layerSize.height = Var.height;
202
+ }
203
+ _getLayerWidth() {
204
+ return this._layerSize.width;
205
+ }
206
+ _setLayerWidth(width) {
207
+ this._layerSize.width = width;
208
+ }
209
+ _getLayerHeight() {
210
+ return this._layerSize.height;
211
+ }
212
+ _setLayerHeight(height) {
213
+ this._layerSize.height = height;
214
+ }
215
+ /**
216
+ * Size of the map's tile (could be different from the tile's size)
217
+ * @return {Size}
218
+ */
219
+ getMapTileSize() {
220
+ return Size(this._mapTileSize.width, this._mapTileSize.height);
221
+ }
222
+ /**
223
+ * Set the map tile size.
224
+ * @param {Size} Var
225
+ */
226
+ setMapTileSize(Var) {
227
+ this._mapTileSize.width = Var.width;
228
+ this._mapTileSize.height = Var.height;
229
+ }
230
+ _getTileWidth() {
231
+ return this._mapTileSize.width;
232
+ }
233
+ _setTileWidth(width) {
234
+ this._mapTileSize.width = width;
235
+ }
236
+ _getTileHeight() {
237
+ return this._mapTileSize.height;
238
+ }
239
+ _setTileHeight(height) {
240
+ this._mapTileSize.height = height;
241
+ }
242
+ /**
243
+ * Pointer to the map of tiles
244
+ * @return {Array}
245
+ */
246
+ getTiles() {
247
+ return this.tiles;
248
+ }
249
+ /**
250
+ * Pointer to the map of tiles
251
+ * @param {Array} Var
252
+ */
253
+ setTiles(Var) {
254
+ this.tiles = Var;
255
+ }
256
+ /**
257
+ * Tile set information for the layer
258
+ * @return {TMXTilesetInfo}
259
+ */
260
+ getTileset() {
261
+ return this.tileset;
262
+ }
263
+ /**
264
+ * Tile set information for the layer
265
+ * @param {TMXTilesetInfo} Var
266
+ */
267
+ setTileset(Var) {
268
+ this.tileset = Var;
269
+ }
270
+ /**
271
+ * Layer orientation, which is the same as the map orientation
272
+ * @return {Number}
273
+ */
274
+ getLayerOrientation() {
275
+ return this.layerOrientation;
276
+ }
277
+ /**
278
+ * Layer orientation, which is the same as the map orientation
279
+ * @param {Number} Var
280
+ */
281
+ setLayerOrientation(Var) {
282
+ this.layerOrientation = Var;
283
+ }
284
+ /**
285
+ * properties from the layer. They can be added using Tiled
286
+ * @return {Array}
287
+ */
288
+ getProperties() {
289
+ return this.properties;
290
+ }
291
+ /**
292
+ * properties from the layer. They can be added using Tiled
293
+ * @param {Array} Var
294
+ */
295
+ setProperties(Var) {
296
+ this.properties = Var;
297
+ }
298
+ /**
299
+ * Return the value for the specific property name
300
+ * @param {String} propertyName
301
+ * @return {*}
302
+ */
303
+ getProperty(propertyName) {
304
+ return this.properties[propertyName];
305
+ }
306
+ /**
307
+ * Gets the layer name
308
+ * @return {String}
309
+ */
310
+ getLayerName() {
311
+ return this.layerName;
312
+ }
313
+ /**
314
+ * Set the layer name
315
+ * @param {String} layerName
316
+ */
317
+ setLayerName(layerName) {
318
+ this.layerName = layerName;
319
+ }
320
+ /**
321
+ * <p>Dealloc the map that contains the tile position from memory. <br />
322
+ * Unless you want to know at runtime the tiles positions, you can safely call this method. <br />
323
+ * If you are going to call layer.getTileGIDAt() then, don't release the map</p>
324
+ */
325
+ releaseMap() {
326
+ this._spriteTiles = {};
327
+ }
328
+ /**
329
+ * <p>Returns the tile (Sprite) at a given a tile coordinate. <br/>
330
+ * The returned Sprite will be already added to the TMXLayer. Don't add it again.<br/>
331
+ * The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc. <br/>
332
+ * You can remove either by calling: <br/>
333
+ * - layer.removeChild(sprite, cleanup); <br/>
334
+ * - or layer.removeTileAt(ccp(x,y)); </p>
335
+ * @param {Point|Number} pos or x
336
+ * @param {Number} [y]
337
+ * @return {Sprite}
338
+ */
339
+ getTileAt(pos, y) {
340
+ if (pos === undefined) {
341
+ throw new Error('TMXLayer.getTileAt(): pos should be non-null');
342
+ }
343
+ let x = pos;
344
+ if (y === undefined) {
345
+ x = pos.x;
346
+ y = pos.y;
347
+ }
348
+ if (x >= this._layerSize.width || y >= this._layerSize.height || x < 0 || y < 0) {
349
+ throw new Error('TMXLayer.getTileAt(): invalid position');
350
+ }
351
+ if (!this.tiles) {
352
+ log('TMXLayer.getTileAt(): TMXLayer: the tiles map has been released');
353
+ return null;
354
+ }
355
+ let tile = null;
356
+ const gid = this.getTileGIDAt(x, y);
357
+ // if GID == 0, then no tile is present
358
+ if (gid === 0) {
359
+ return tile;
360
+ }
361
+ const z = 0 | (x + y * this._layerSize.width);
362
+ tile = this._spriteTiles[z];
363
+ // tile not created yet. create it
364
+ if (!tile) {
365
+ let rect = this._texGrids[gid];
366
+ const tex = this._textures[rect.texId];
367
+ rect = rectPixelsToPoints(rect);
368
+ tile = new Sprite(tex, rect);
369
+ tile.setPosition(this.getPositionAt(x, y));
370
+ const vertexZ = this._vertexZForPos(x, y);
371
+ tile.setVertexZ(vertexZ);
372
+ tile.setAnchorPoint(0, 0);
373
+ tile.setOpacity(this._opacity);
374
+ this.addChild(tile, vertexZ, z);
375
+ }
376
+ return tile;
377
+ }
378
+ /**
379
+ * Returns the tile gid at a given tile coordinate. <br />
380
+ * if it returns 0, it means that the tile is empty. <br />
381
+ * This method requires the the tile map has not been previously released (eg. don't call layer.releaseMap())<br />
382
+ * @param {Point|Number} pos or x
383
+ * @param {Number} [y]
384
+ * @return {Number}
385
+ */
386
+ getTileGIDAt(pos, y) {
387
+ if (pos === undefined) {
388
+ throw new Error('TMXLayer.getTileGIDAt(): pos should be non-null');
389
+ }
390
+ let x = pos;
391
+ if (y === undefined) {
392
+ x = pos.x;
393
+ y = pos.y;
394
+ }
395
+ if (x >= this._layerSize.width || y >= this._layerSize.height || x < 0 || y < 0) {
396
+ throw new Error('TMXLayer.getTileGIDAt(): invalid position');
397
+ }
398
+ if (!this.tiles) {
399
+ log('TMXLayer.getTileGIDAt(): TMXLayer: the tiles map has been released');
400
+ return null;
401
+ }
402
+ const idx = 0 | (x + y * this._layerSize.width);
403
+ // Bits on the far end of the 32-bit global tile ID are used for tile flags
404
+ const tile = this.tiles[idx];
405
+ return (tile & TMX_TILE_FLIPPED_MASK) >>> 0;
406
+ }
407
+ /**
408
+ * <p>Sets the tile gid (gid = tile global id) at a given tile coordinate.<br />
409
+ * The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor . Tileset Mgr +1.<br />
410
+ * If a tile is already placed at that position, then it will be removed.</p>
411
+ * @param {Number} gid
412
+ * @param {Point|Number} posOrX position or x
413
+ * @param {Number} flagsOrY flags or y
414
+ * @param {Number} [flags]
415
+ */
416
+ setTileGID(gid, posOrX, flagsOrY, flags) {
417
+ if (posOrX === undefined) {
418
+ throw new Error('TMXLayer.setTileGID(): pos should be non-null');
419
+ }
420
+ let pos;
421
+ if (flags !== undefined) {
422
+ pos = p(posOrX, flagsOrY);
423
+ }
424
+ else {
425
+ pos = posOrX;
426
+ flags = flagsOrY;
427
+ }
428
+ if (pos.x >= this._layerSize.width || pos.y >= this._layerSize.height || pos.x < 0 || pos.y < 0) {
429
+ throw new Error('TMXLayer.setTileGID(): invalid position');
430
+ }
431
+ if (!this.tiles) {
432
+ log('TMXLayer.setTileGID(): TMXLayer: the tiles map has been released');
433
+ return;
434
+ }
435
+ if (gid !== 0 && gid < this.tileset.firstGid) {
436
+ log(`TMXLayer.setTileGID(): invalid gid:${gid}`);
437
+ return;
438
+ }
439
+ flags = flags || 0;
440
+ const currentFlags = this.getTileFlagsAt(pos);
441
+ const currentGID = this.getTileGIDAt(pos);
442
+ if (currentGID !== gid || currentFlags !== flags) {
443
+ const gidAndFlags = (gid | flags) >>> 0;
444
+ // setting gid=0 is equal to remove the tile
445
+ if (gid === 0)
446
+ this.removeTileAt(pos);
447
+ else if (currentGID === 0)
448
+ // empty tile. create a new one
449
+ this._updateTileForGID(gidAndFlags, pos);
450
+ else {
451
+ // modifying an existing tile with a non-empty tile
452
+ const z = pos.x + pos.y * this._layerSize.width;
453
+ const sprite = this.getChildByTag(z);
454
+ if (sprite) {
455
+ let rect = this._texGrids[gid];
456
+ const tex = this._textures[rect.texId];
457
+ rect = rectPixelsToPoints(rect);
458
+ sprite.setTexture(tex);
459
+ sprite.setTextureRect(rect, false);
460
+ if (flags != null)
461
+ this._setupTileSprite(sprite, pos, gidAndFlags);
462
+ this.tiles[z] = gidAndFlags;
463
+ }
464
+ else {
465
+ this._updateTileForGID(gidAndFlags, pos);
466
+ }
467
+ }
468
+ }
469
+ }
470
+ addChild(child, localZOrder, tag) {
471
+ super.addChild(child, localZOrder, tag);
472
+ if (tag !== undefined) {
473
+ this._spriteTiles[tag] = child;
474
+ child._vertexZ = this._vertexZ + (renderer.assignedZStep * tag) / this.tiles.length;
475
+ // child._renderCmd._needDraw = false;
476
+ }
477
+ }
478
+ removeChild(child, cleanup) {
479
+ if (this._spriteTiles[child.tag]) {
480
+ this._spriteTiles[child.tag] = null;
481
+ // child._renderCmd._needDraw = true;
482
+ }
483
+ super.removeChild(child, cleanup);
484
+ }
485
+ /**
486
+ * lipped tiles can be changed dynamically
487
+ * @param {Point|Number} pos or x
488
+ * @param {Number} [y]
489
+ * @return {Number}
490
+ */
491
+ getTileFlagsAt(pos, y) {
492
+ if (!pos)
493
+ throw new Error('TMXLayer.getTileFlagsAt(): pos should be non-null');
494
+ if (y !== undefined)
495
+ pos = p(pos, y);
496
+ if (pos.x >= this._layerSize.width || pos.y >= this._layerSize.height || pos.x < 0 || pos.y < 0)
497
+ throw new Error('TMXLayer.getTileFlagsAt(): invalid position');
498
+ if (!this.tiles) {
499
+ log('TMXLayer.getTileFlagsAt(): TMXLayer: the tiles map has been released');
500
+ return null;
501
+ }
502
+ const idx = 0 | (pos.x + pos.y * this._layerSize.width);
503
+ // Bits on the far end of the 32-bit global tile ID are used for tile flags
504
+ const tile = this.tiles[idx];
505
+ return (tile & TMX_TILE_FLIPPED_ALL) >>> 0;
506
+ }
507
+ /**
508
+ * Removes a tile at given tile coordinate
509
+ * @param {Point|Number} pos position or x
510
+ * @param {Number} [y]
511
+ */
512
+ removeTileAt(pos, y) {
513
+ if (!pos) {
514
+ throw new Error('TMXLayer.removeTileAt(): pos should be non-null');
515
+ }
516
+ if (y !== undefined) {
517
+ pos = p(pos, y);
518
+ }
519
+ if (pos.x >= this._layerSize.width || pos.y >= this._layerSize.height || pos.x < 0 || pos.y < 0) {
520
+ throw new Error('TMXLayer.removeTileAt(): invalid position');
521
+ }
522
+ if (!this.tiles) {
523
+ log('TMXLayer.removeTileAt(): TMXLayer: the tiles map has been released');
524
+ return;
525
+ }
526
+ const gid = this.getTileGIDAt(pos);
527
+ if (gid !== 0) {
528
+ const z = 0 | (pos.x + pos.y * this._layerSize.width);
529
+ // remove tile from GID map
530
+ this.tiles[z] = 0;
531
+ // remove it from sprites and/or texture atlas
532
+ const sprite = this._spriteTiles[z];
533
+ if (sprite) {
534
+ this.removeChild(sprite, true);
535
+ }
536
+ }
537
+ }
538
+ /**
539
+ * Returns the position in pixels of a given tile coordinate
540
+ * @param {Point|Number} pos position or x
541
+ * @param {Number} [y]
542
+ * @return {Point}
543
+ */
544
+ getPositionAt(pos, y) {
545
+ if (y !== undefined)
546
+ pos = p(pos, y);
547
+ let ret = p(0, 0);
548
+ switch (this.layerOrientation) {
549
+ case TMX_ORIENTATION_ORTHO:
550
+ ret = this._positionForOrthoAt(pos);
551
+ break;
552
+ case TMX_ORIENTATION_ISO:
553
+ ret = this._positionForIsoAt(pos);
554
+ break;
555
+ case TMX_ORIENTATION_HEX:
556
+ ret = this._positionForHexAt(pos);
557
+ break;
558
+ }
559
+ return pointPixelsToPoints(ret);
560
+ }
561
+ _positionForIsoAt(pos) {
562
+ return p((this._mapTileSize.width / 2) * (this._layerSize.width + pos.x - pos.y - 1), (this._mapTileSize.height / 2) * (this._layerSize.height * 2 - pos.x - pos.y - 2));
563
+ }
564
+ _positionForOrthoAt(pos) {
565
+ return p(pos.x * this._mapTileSize.width, (this._layerSize.height - pos.y - 1) * this._mapTileSize.height);
566
+ }
567
+ _positionForHexAt(pos) {
568
+ const diffY = pos.x % 2 === 1 ? -this._mapTileSize.height / 2 : 0;
569
+ return p((pos.x * this._mapTileSize.width * 3) / 4, (this._layerSize.height - pos.y - 1) * this._mapTileSize.height + diffY);
570
+ }
571
+ _calculateLayerOffset(pos) {
572
+ let ret = p(0, 0);
573
+ switch (this.layerOrientation) {
574
+ case TMX_ORIENTATION_ORTHO:
575
+ ret = p(pos.x * this._mapTileSize.width, -pos.y * this._mapTileSize.height);
576
+ break;
577
+ case TMX_ORIENTATION_ISO:
578
+ ret = p((this._mapTileSize.width / 2) * (pos.x - pos.y), (this._mapTileSize.height / 2) * (-pos.x - pos.y));
579
+ break;
580
+ case TMX_ORIENTATION_HEX:
581
+ if (pos.x !== 0 || pos.y !== 0)
582
+ log('offset for hexagonal map not implemented yet');
583
+ break;
584
+ }
585
+ return ret;
586
+ }
587
+ _updateTileForGID(gid, pos) {
588
+ if (!this._texGrids[gid]) {
589
+ return;
590
+ }
591
+ const idx = 0 | (pos.x + pos.y * this._layerSize.width);
592
+ if (idx < this.tiles.length) {
593
+ this.tiles[idx] = gid;
594
+ }
595
+ }
596
+ //The layer recognizes some special properties, like cc_vertez
597
+ _parseInternalProperties() {
598
+ // if cc_vertex=automatic, then tiles will be rendered using vertexz
599
+ const vertexz = this.getProperty('cc_vertexz');
600
+ if (vertexz) {
601
+ if (vertexz === 'automatic') {
602
+ this._useAutomaticVertexZ = true;
603
+ const alphaFuncVal = this.getProperty('cc_alpha_func');
604
+ let alphaFuncValue = 0;
605
+ if (alphaFuncVal)
606
+ alphaFuncValue = parseFloat(alphaFuncVal);
607
+ if (_renderType === game.RENDER_TYPE_WEBGL) {
608
+ //todo: need move to WebGL render cmd
609
+ ;
610
+ this.shaderProgram = shaderCache.programForKey(SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST);
611
+ this.shaderProgram.use();
612
+ this.shaderProgram.setUniformLocationWith1f(UNIFORM_ALPHA_TEST_VALUE_S, alphaFuncValue);
613
+ }
614
+ }
615
+ else
616
+ this._vertexZvalue = parseInt(vertexz, 10);
617
+ }
618
+ }
619
+ _setupTileSprite(sprite, pos, gid) {
620
+ const z = pos.x + pos.y * this._layerSize.width;
621
+ const posInPixel = this.getPositionAt(pos);
622
+ sprite.setPosition(posInPixel);
623
+ sprite.setVertexZ(this._vertexZForPos(pos));
624
+ sprite.setAnchorPoint(0, 0);
625
+ sprite.setOpacity(this._opacity);
626
+ sprite.setFlippedX(false);
627
+ sprite.setFlippedY(false);
628
+ sprite.setRotation(0.0);
629
+ // Rotation in tiled is achieved using 3 flipped states, flipping across the horizontal, vertical, and diagonal axes of the tiles.
630
+ if ((gid & TMX_TILE_DIAGONAL_FLAG) >>> 0) {
631
+ // put the anchor in the middle for ease of rotation.
632
+ sprite.setAnchorPoint(0.5, 0.5);
633
+ sprite.setPosition(posInPixel.x + sprite.width / 2, posInPixel.y + sprite.height / 2);
634
+ const flag = (gid & ((TMX_TILE_HORIZONTAL_FLAG | TMX_TILE_VERTICAL_FLAG) >>> 0)) >>> 0;
635
+ // handle the 4 diagonally flipped states.
636
+ if (flag === TMX_TILE_HORIZONTAL_FLAG)
637
+ sprite.setRotation(90);
638
+ else if (flag === TMX_TILE_VERTICAL_FLAG)
639
+ sprite.setRotation(270);
640
+ else if (flag === (TMX_TILE_VERTICAL_FLAG | TMX_TILE_HORIZONTAL_FLAG) >>> 0) {
641
+ sprite.setRotation(90);
642
+ sprite.setFlippedX(true);
643
+ }
644
+ else {
645
+ sprite.setRotation(270);
646
+ sprite.setFlippedX(true);
647
+ }
648
+ }
649
+ else {
650
+ if ((gid & TMX_TILE_HORIZONTAL_FLAG) >>> 0) {
651
+ sprite.setFlippedX(true);
652
+ }
653
+ if ((gid & TMX_TILE_VERTICAL_FLAG) >>> 0) {
654
+ sprite.setFlippedY(true);
655
+ }
656
+ }
657
+ }
658
+ _vertexZForPos(x, y) {
659
+ if (y === undefined) {
660
+ y = x.y;
661
+ x = x.x;
662
+ }
663
+ let ret = 0;
664
+ let maxVal;
665
+ if (this._useAutomaticVertexZ) {
666
+ switch (this.layerOrientation) {
667
+ case TMX_ORIENTATION_ISO:
668
+ maxVal = this._layerSize.width + this._layerSize.height;
669
+ ret = -(maxVal - (x + y));
670
+ break;
671
+ case TMX_ORIENTATION_ORTHO:
672
+ ret = -(this._layerSize.height - y);
673
+ break;
674
+ case TMX_ORIENTATION_HEX:
675
+ log('TMX Hexa zOrder not supported');
676
+ break;
677
+ default:
678
+ log('TMX invalid value');
679
+ break;
680
+ }
681
+ }
682
+ else {
683
+ ret = this._vertexZvalue;
684
+ }
685
+ return ret;
686
+ }
687
+ }
688
+ const _p = TMXLayer.prototype;
689
+ // Extended properties
690
+ defineGetterSetter(_p, 'layerWidth', _p._getLayerWidth, _p._setLayerWidth);
691
+ defineGetterSetter(_p, 'layerHeight', _p._getLayerHeight, _p._setLayerHeight);
692
+ defineGetterSetter(_p, 'tileWidth', _p._getTileWidth, _p._setTileWidth);
693
+ defineGetterSetter(_p, 'tileHeight', _p._getTileHeight, _p._setTileHeight);
694
+ //# sourceMappingURL=TMXLayer.js.map