excalibur 0.28.3 → 0.28.4

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 (482) hide show
  1. package/.gitattributes +63 -63
  2. package/CHANGELOG.md +2003 -1955
  3. package/LICENSE.md +25 -25
  4. package/README.md +134 -134
  5. package/STYLEGUIDE.md +136 -136
  6. package/build/dist/Actions/Action/ActionSequence.js +31 -0
  7. package/build/dist/Actions/Action/ActionSequence.js.map +1 -0
  8. package/build/dist/Actions/Action/Blink.js +54 -0
  9. package/build/dist/Actions/Action/Blink.js.map +1 -0
  10. package/build/dist/Actions/Action/CallMethod.js +21 -0
  11. package/build/dist/Actions/Action/CallMethod.js.map +1 -0
  12. package/build/dist/Actions/Action/Delay.js +26 -0
  13. package/build/dist/Actions/Action/Delay.js.map +1 -0
  14. package/build/dist/Actions/Action/Die.js +22 -0
  15. package/build/dist/Actions/Action/Die.js.map +1 -0
  16. package/build/dist/Actions/Action/EaseBy.js +70 -0
  17. package/build/dist/Actions/Action/EaseBy.js.map +1 -0
  18. package/build/dist/Actions/Action/EaseTo.js +69 -0
  19. package/build/dist/Actions/Action/EaseTo.js.map +1 -0
  20. package/build/dist/Actions/Action/Fade.js +48 -0
  21. package/build/dist/Actions/Action/Fade.js.map +1 -0
  22. package/build/dist/Actions/Action/Follow.js +56 -0
  23. package/build/dist/Actions/Action/Follow.js.map +1 -0
  24. package/build/dist/Actions/Action/Meet.js +54 -0
  25. package/build/dist/Actions/Action/Meet.js.map +1 -0
  26. package/build/dist/Actions/Action/MoveBy.js +48 -0
  27. package/build/dist/Actions/Action/MoveBy.js.map +1 -0
  28. package/build/dist/Actions/Action/MoveTo.js +41 -0
  29. package/build/dist/Actions/Action/MoveTo.js.map +1 -0
  30. package/build/dist/Actions/Action/ParallelActions.js +23 -0
  31. package/build/dist/Actions/Action/ParallelActions.js.map +1 -0
  32. package/build/dist/Actions/Action/Repeat.js +31 -0
  33. package/build/dist/Actions/Action/Repeat.js.map +1 -0
  34. package/build/dist/Actions/Action/RepeatForever.js +37 -0
  35. package/build/dist/Actions/Action/RepeatForever.js.map +1 -0
  36. package/build/dist/Actions/Action/RotateBy.js +95 -0
  37. package/build/dist/Actions/Action/RotateBy.js.map +1 -0
  38. package/build/dist/Actions/Action/RotateTo.js +91 -0
  39. package/build/dist/Actions/Action/RotateTo.js.map +1 -0
  40. package/build/dist/Actions/Action/ScaleBy.js +46 -0
  41. package/build/dist/Actions/Action/ScaleBy.js.map +1 -0
  42. package/build/dist/Actions/Action/ScaleTo.js +58 -0
  43. package/build/dist/Actions/Action/ScaleTo.js.map +1 -0
  44. package/build/dist/Actions/Action.js +2 -0
  45. package/build/dist/Actions/Action.js.map +1 -0
  46. package/build/dist/Actions/ActionContext.js +322 -0
  47. package/build/dist/Actions/ActionContext.js.map +1 -0
  48. package/build/dist/Actions/ActionQueue.js +87 -0
  49. package/build/dist/Actions/ActionQueue.js.map +1 -0
  50. package/build/dist/Actions/Actionable.js +2 -0
  51. package/build/dist/Actions/Actionable.js.map +1 -0
  52. package/build/dist/Actions/ActionsComponent.js +195 -0
  53. package/build/dist/Actions/ActionsComponent.js.map +1 -0
  54. package/build/dist/Actions/ActionsSystem.js +30 -0
  55. package/build/dist/Actions/ActionsSystem.js.map +1 -0
  56. package/build/dist/Actions/Index.js +26 -0
  57. package/build/dist/Actions/Index.js.map +1 -0
  58. package/build/dist/Actions/RotationType.js +27 -0
  59. package/build/dist/Actions/RotationType.js.map +1 -0
  60. package/build/dist/Actor.js +629 -0
  61. package/build/dist/Actor.js.map +1 -0
  62. package/build/dist/Camera.js +660 -0
  63. package/build/dist/Camera.js.map +1 -0
  64. package/build/dist/Collision/BoundingBox.js +415 -0
  65. package/build/dist/Collision/BoundingBox.js.map +1 -0
  66. package/build/dist/Collision/ColliderComponent.js +202 -0
  67. package/build/dist/Collision/ColliderComponent.js.map +1 -0
  68. package/build/dist/Collision/Colliders/CircleCollider.js +226 -0
  69. package/build/dist/Collision/Colliders/CircleCollider.js.map +1 -0
  70. package/build/dist/Collision/Colliders/ClosestLineJumpTable.js +211 -0
  71. package/build/dist/Collision/Colliders/ClosestLineJumpTable.js.map +1 -0
  72. package/build/dist/Collision/Colliders/Collider.js +32 -0
  73. package/build/dist/Collision/Colliders/Collider.js.map +1 -0
  74. package/build/dist/Collision/Colliders/CollisionJumpTable.js +300 -0
  75. package/build/dist/Collision/Colliders/CollisionJumpTable.js.map +1 -0
  76. package/build/dist/Collision/Colliders/EdgeCollider.js +229 -0
  77. package/build/dist/Collision/Colliders/EdgeCollider.js.map +1 -0
  78. package/build/dist/Collision/Colliders/PolygonCollider.js +556 -0
  79. package/build/dist/Collision/Colliders/PolygonCollider.js.map +1 -0
  80. package/build/dist/Collision/Colliders/SeparatingAxis.js +67 -0
  81. package/build/dist/Collision/Colliders/SeparatingAxis.js.map +1 -0
  82. package/build/dist/Collision/Colliders/Shape.js +99 -0
  83. package/build/dist/Collision/Colliders/Shape.js.map +1 -0
  84. package/build/dist/Collision/CollisionType.js +33 -0
  85. package/build/dist/Collision/CollisionType.js.map +1 -0
  86. package/build/dist/Collision/Detection/CollisionContact.js +51 -0
  87. package/build/dist/Collision/Detection/CollisionContact.js.map +1 -0
  88. package/build/dist/Collision/Detection/CollisionProcessor.js +2 -0
  89. package/build/dist/Collision/Detection/CollisionProcessor.js.map +1 -0
  90. package/build/dist/Collision/Detection/DynamicTree.js +442 -0
  91. package/build/dist/Collision/Detection/DynamicTree.js.map +1 -0
  92. package/build/dist/Collision/Detection/Pair.js +92 -0
  93. package/build/dist/Collision/Detection/Pair.js.map +1 -0
  94. package/build/dist/Collision/Detection/QuadTree.js +193 -0
  95. package/build/dist/Collision/Detection/QuadTree.js.map +1 -0
  96. package/build/dist/Collision/Group/CollisionGroup.js +3 -3
  97. package/build/dist/Collision/Integrator.js +25 -0
  98. package/build/dist/Collision/Integrator.js.map +1 -0
  99. package/build/dist/Collision/MotionSystem.js +35 -0
  100. package/build/dist/Collision/MotionSystem.js.map +1 -0
  101. package/build/dist/Collision/Physics.js +163 -0
  102. package/build/dist/Collision/Physics.js.map +1 -0
  103. package/build/dist/Collision/PhysicsWorld.js +10 -0
  104. package/build/dist/Collision/PhysicsWorld.js.map +1 -0
  105. package/build/dist/Collision/Side.js +51 -0
  106. package/build/dist/Collision/Side.js.map +1 -0
  107. package/build/dist/Collision/Solver/ArcadeSolver.js +154 -0
  108. package/build/dist/Collision/Solver/ArcadeSolver.js.map +1 -0
  109. package/build/dist/Collision/Solver/ContactConstraintPoint.js +87 -0
  110. package/build/dist/Collision/Solver/ContactConstraintPoint.js.map +1 -0
  111. package/build/dist/Collision/Solver/RealisticSolver.js +293 -0
  112. package/build/dist/Collision/Solver/RealisticSolver.js.map +1 -0
  113. package/build/dist/Collision/Solver/Solver.js +2 -0
  114. package/build/dist/Collision/Solver/Solver.js.map +1 -0
  115. package/build/dist/Color.js +417 -0
  116. package/build/dist/Color.js.map +1 -0
  117. package/build/dist/Configurable.js +32 -0
  118. package/build/dist/Configurable.js.map +1 -0
  119. package/build/dist/Debug/Debug.d.ts +11 -0
  120. package/build/dist/Debug/Debug.js +385 -0
  121. package/build/dist/Debug/Debug.js.map +1 -0
  122. package/build/dist/Debug/DebugFlags.js +40 -0
  123. package/build/dist/Debug/DebugFlags.js.map +1 -0
  124. package/build/dist/Debug/DebugSystem.js +263 -0
  125. package/build/dist/Debug/DebugSystem.js.map +1 -0
  126. package/build/dist/Debug/index.js +4 -0
  127. package/build/dist/Debug/index.js.map +1 -0
  128. package/build/dist/Deprecated.js +2 -0
  129. package/build/dist/Deprecated.js.map +1 -0
  130. package/build/dist/Engine.js +986 -0
  131. package/build/dist/Engine.js.map +1 -0
  132. package/build/dist/EntityComponentSystem/Component.js +65 -0
  133. package/build/dist/EntityComponentSystem/Component.js.map +1 -0
  134. package/build/dist/EntityComponentSystem/Components/MotionComponent.js +33 -0
  135. package/build/dist/EntityComponentSystem/Components/MotionComponent.js.map +1 -0
  136. package/build/dist/EntityComponentSystem/Components/TransformComponent.js +107 -0
  137. package/build/dist/EntityComponentSystem/Components/TransformComponent.js.map +1 -0
  138. package/build/dist/EntityComponentSystem/Entity.js +487 -0
  139. package/build/dist/EntityComponentSystem/Entity.js.map +1 -0
  140. package/build/dist/EntityComponentSystem/EntityManager.js +137 -0
  141. package/build/dist/EntityComponentSystem/EntityManager.js.map +1 -0
  142. package/build/dist/EntityComponentSystem/Query.js +90 -0
  143. package/build/dist/EntityComponentSystem/Query.js.map +1 -0
  144. package/build/dist/EntityComponentSystem/QueryManager.js +90 -0
  145. package/build/dist/EntityComponentSystem/QueryManager.js.map +1 -0
  146. package/build/dist/EntityComponentSystem/System.js +76 -0
  147. package/build/dist/EntityComponentSystem/System.js.map +1 -0
  148. package/build/dist/EntityComponentSystem/SystemManager.js +104 -0
  149. package/build/dist/EntityComponentSystem/SystemManager.js.map +1 -0
  150. package/build/dist/EntityComponentSystem/Util.js +5 -0
  151. package/build/dist/EntityComponentSystem/Util.js.map +1 -0
  152. package/build/dist/EntityComponentSystem/World.js +55 -0
  153. package/build/dist/EntityComponentSystem/World.js.map +1 -0
  154. package/build/dist/EntityComponentSystem/index.js +11 -0
  155. package/build/dist/EntityComponentSystem/index.js.map +1 -0
  156. package/build/dist/EventDispatcher.js +122 -0
  157. package/build/dist/EventDispatcher.js.map +1 -0
  158. package/build/dist/EventEmitter.js +86 -0
  159. package/build/dist/EventEmitter.js.map +1 -0
  160. package/build/dist/Events/ExEvent.js +12 -0
  161. package/build/dist/Events/ExEvent.js.map +1 -0
  162. package/build/dist/Events/MediaEvents.js +75 -0
  163. package/build/dist/Events/MediaEvents.js.map +1 -0
  164. package/build/dist/Events/PointerEvents.js +52 -0
  165. package/build/dist/Events/PointerEvents.js.map +1 -0
  166. package/build/dist/Events.js +473 -0
  167. package/build/dist/Events.js.map +1 -0
  168. package/build/dist/Flags.js +67 -0
  169. package/build/dist/Flags.js.map +1 -0
  170. package/build/dist/Graphics/Animation.js +344 -0
  171. package/build/dist/Graphics/Animation.js.map +1 -0
  172. package/build/dist/Graphics/Canvas.js +38 -0
  173. package/build/dist/Graphics/Canvas.js.map +1 -0
  174. package/build/dist/Graphics/Circle.js +48 -0
  175. package/build/dist/Graphics/Circle.js.map +1 -0
  176. package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js +2 -0
  177. package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js.map +1 -0
  178. package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js +237 -0
  179. package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js.map +1 -0
  180. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.d.ts +1 -0
  181. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js +481 -0
  182. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js.map +1 -0
  183. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.frag.glsl +52 -52
  184. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js +174 -0
  185. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js.map +1 -0
  186. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.vert.glsl +37 -37
  187. package/build/dist/Graphics/Context/debug-text.js +47 -0
  188. package/build/dist/Graphics/Context/debug-text.js.map +1 -0
  189. package/build/dist/Graphics/Context/draw-call.js +16 -0
  190. package/build/dist/Graphics/Context/draw-call.js.map +1 -0
  191. package/build/dist/Graphics/Context/image-renderer/image-renderer.frag.glsl +32 -32
  192. package/build/dist/Graphics/Context/image-renderer/image-renderer.js +246 -0
  193. package/build/dist/Graphics/Context/image-renderer/image-renderer.js.map +1 -0
  194. package/build/dist/Graphics/Context/image-renderer/image-renderer.vert.glsl +32 -32
  195. package/build/dist/Graphics/Context/line-renderer/line-fragment.glsl +10 -10
  196. package/build/dist/Graphics/Context/line-renderer/line-renderer.js +90 -0
  197. package/build/dist/Graphics/Context/line-renderer/line-renderer.js.map +1 -0
  198. package/build/dist/Graphics/Context/line-renderer/line-vertex.glsl +14 -14
  199. package/build/dist/Graphics/Context/material-renderer/material-renderer.js +23 -2
  200. package/build/dist/Graphics/Context/material-renderer/material-renderer.js.map +1 -1
  201. package/build/dist/Graphics/Context/material.d.ts +2 -0
  202. package/build/dist/Graphics/Context/material.js +72 -0
  203. package/build/dist/Graphics/Context/material.js.map +1 -0
  204. package/build/dist/Graphics/Context/point-renderer/point-fragment.glsl +19 -19
  205. package/build/dist/Graphics/Context/point-renderer/point-renderer.js +91 -0
  206. package/build/dist/Graphics/Context/point-renderer/point-renderer.js.map +1 -0
  207. package/build/dist/Graphics/Context/point-renderer/point-vertex.glsl +11 -11
  208. package/build/dist/Graphics/Context/quad-index-buffer.js +67 -0
  209. package/build/dist/Graphics/Context/quad-index-buffer.js.map +1 -0
  210. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.frag.glsl +85 -85
  211. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js +305 -0
  212. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js.map +1 -0
  213. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.vert.glsl +42 -42
  214. package/build/dist/Graphics/Context/render-source.js +16 -0
  215. package/build/dist/Graphics/Context/render-source.js.map +1 -0
  216. package/build/dist/Graphics/Context/render-target.js +65 -0
  217. package/build/dist/Graphics/Context/render-target.js.map +1 -0
  218. package/build/dist/Graphics/Context/renderer.js +2 -0
  219. package/build/dist/Graphics/Context/renderer.js.map +1 -0
  220. package/build/dist/Graphics/Context/screen-pass-painter/screen-fragment.glsl +13 -13
  221. package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js +56 -0
  222. package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js.map +1 -0
  223. package/build/dist/Graphics/Context/screen-pass-painter/screen-vertex.glsl +11 -11
  224. package/build/dist/Graphics/Context/state-stack.js +37 -0
  225. package/build/dist/Graphics/Context/state-stack.js.map +1 -0
  226. package/build/dist/Graphics/Context/texture-loader.js +109 -0
  227. package/build/dist/Graphics/Context/texture-loader.js.map +1 -0
  228. package/build/dist/Graphics/Context/transform-stack.js +30 -0
  229. package/build/dist/Graphics/Context/transform-stack.js.map +1 -0
  230. package/build/dist/Graphics/Context/vertex-buffer.js +53 -0
  231. package/build/dist/Graphics/Context/vertex-buffer.js.map +1 -0
  232. package/build/dist/Graphics/Context/webgl-util.js +79 -0
  233. package/build/dist/Graphics/Context/webgl-util.js.map +1 -0
  234. package/build/dist/Graphics/DebugGraphicsComponent.d.ts +3 -2
  235. package/build/dist/Graphics/DebugGraphicsComponent.js +16 -0
  236. package/build/dist/Graphics/DebugGraphicsComponent.js.map +1 -0
  237. package/build/dist/Graphics/Filtering.js +17 -0
  238. package/build/dist/Graphics/Filtering.js.map +1 -0
  239. package/build/dist/Graphics/Font.js +148 -0
  240. package/build/dist/Graphics/Font.js.map +1 -0
  241. package/build/dist/Graphics/FontCache.d.ts +1 -0
  242. package/build/dist/Graphics/FontCache.js +80 -0
  243. package/build/dist/Graphics/FontCache.js.map +1 -0
  244. package/build/dist/Graphics/FontCommon.js +109 -0
  245. package/build/dist/Graphics/FontCommon.js.map +1 -0
  246. package/build/dist/Graphics/FontTextInstance.js +230 -0
  247. package/build/dist/Graphics/FontTextInstance.js.map +1 -0
  248. package/build/dist/Graphics/Graphic.js +208 -0
  249. package/build/dist/Graphics/Graphic.js.map +1 -0
  250. package/build/dist/Graphics/GraphicsComponent.js +336 -0
  251. package/build/dist/Graphics/GraphicsComponent.js.map +1 -0
  252. package/build/dist/Graphics/GraphicsDiagnostics.js +9 -0
  253. package/build/dist/Graphics/GraphicsDiagnostics.js.map +1 -0
  254. package/build/dist/Graphics/GraphicsGroup.js +69 -0
  255. package/build/dist/Graphics/GraphicsGroup.js.map +1 -0
  256. package/build/dist/Graphics/GraphicsSystem.js +210 -0
  257. package/build/dist/Graphics/GraphicsSystem.js.map +1 -0
  258. package/build/dist/Graphics/ImageSource.js +124 -0
  259. package/build/dist/Graphics/ImageSource.js.map +1 -0
  260. package/build/dist/Graphics/Line.js +45 -0
  261. package/build/dist/Graphics/Line.js.map +1 -0
  262. package/build/dist/Graphics/OffscreenSystem.js +64 -0
  263. package/build/dist/Graphics/OffscreenSystem.js.map +1 -0
  264. package/build/dist/Graphics/ParallaxComponent.js +11 -0
  265. package/build/dist/Graphics/ParallaxComponent.js.map +1 -0
  266. package/build/dist/Graphics/Polygon.js +59 -0
  267. package/build/dist/Graphics/Polygon.js.map +1 -0
  268. package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js +7 -0
  269. package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js.map +1 -0
  270. package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js +52 -0
  271. package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js.map +1 -0
  272. package/build/dist/Graphics/PostProcessor/PostProcessor.js +2 -0
  273. package/build/dist/Graphics/PostProcessor/PostProcessor.js.map +1 -0
  274. package/build/dist/Graphics/PostProcessor/ScreenShader.js +59 -0
  275. package/build/dist/Graphics/PostProcessor/ScreenShader.js.map +1 -0
  276. package/build/dist/Graphics/PostProcessor/color-blind-fragment.glsl +64 -64
  277. package/build/dist/Graphics/Raster.js +215 -0
  278. package/build/dist/Graphics/Raster.js.map +1 -0
  279. package/build/dist/Graphics/Rectangle.js +29 -0
  280. package/build/dist/Graphics/Rectangle.js.map +1 -0
  281. package/build/dist/Graphics/Sprite.js +82 -0
  282. package/build/dist/Graphics/Sprite.js.map +1 -0
  283. package/build/dist/Graphics/SpriteFont.js +139 -0
  284. package/build/dist/Graphics/SpriteFont.js.map +1 -0
  285. package/build/dist/Graphics/SpriteSheet.js +116 -0
  286. package/build/dist/Graphics/SpriteSheet.js.map +1 -0
  287. package/build/dist/Graphics/Text.js +103 -0
  288. package/build/dist/Graphics/Text.js.map +1 -0
  289. package/build/dist/Graphics/index.js +46 -0
  290. package/build/dist/Graphics/index.js.map +1 -0
  291. package/build/dist/Id.js +8 -0
  292. package/build/dist/Id.js.map +1 -0
  293. package/build/dist/Input/CapturePointerConfig.js +5 -0
  294. package/build/dist/Input/CapturePointerConfig.js.map +1 -0
  295. package/build/dist/Input/EngineInput.js +2 -0
  296. package/build/dist/Input/EngineInput.js.map +1 -0
  297. package/build/dist/Input/Gamepad.js +422 -0
  298. package/build/dist/Input/Gamepad.js.map +1 -0
  299. package/build/dist/Input/Index.js +88 -0
  300. package/build/dist/Input/Index.js.map +1 -0
  301. package/build/dist/Input/InputMapper.js +45 -0
  302. package/build/dist/Input/InputMapper.js.map +1 -0
  303. package/build/dist/Input/Keyboard.js +348 -0
  304. package/build/dist/Input/Keyboard.js.map +1 -0
  305. package/build/dist/Input/NativePointerButton.js +12 -0
  306. package/build/dist/Input/NativePointerButton.js.map +1 -0
  307. package/build/dist/Input/PointerAbstraction.js +44 -0
  308. package/build/dist/Input/PointerAbstraction.js.map +1 -0
  309. package/build/dist/Input/PointerButton.js +12 -0
  310. package/build/dist/Input/PointerButton.js.map +1 -0
  311. package/build/dist/Input/PointerComponent.js +28 -0
  312. package/build/dist/Input/PointerComponent.js.map +1 -0
  313. package/build/dist/Input/PointerEvent.js +25 -0
  314. package/build/dist/Input/PointerEvent.js.map +1 -0
  315. package/build/dist/Input/PointerEventReceiver.js +456 -0
  316. package/build/dist/Input/PointerEventReceiver.js.map +1 -0
  317. package/build/dist/Input/PointerScope.js +16 -0
  318. package/build/dist/Input/PointerScope.js.map +1 -0
  319. package/build/dist/Input/PointerSystem.js +249 -0
  320. package/build/dist/Input/PointerSystem.js.map +1 -0
  321. package/build/dist/Input/PointerType.js +11 -0
  322. package/build/dist/Input/PointerType.js.map +1 -0
  323. package/build/dist/Input/WheelDeltaMode.js +7 -0
  324. package/build/dist/Input/WheelDeltaMode.js.map +1 -0
  325. package/build/dist/Input/WheelEvent.js +21 -0
  326. package/build/dist/Input/WheelEvent.js.map +1 -0
  327. package/build/dist/Interfaces/Audio.js +2 -0
  328. package/build/dist/Interfaces/Audio.js.map +1 -0
  329. package/build/dist/Interfaces/AudioImplementation.js +11 -0
  330. package/build/dist/Interfaces/AudioImplementation.js.map +1 -0
  331. package/build/dist/Interfaces/Clonable.js +2 -0
  332. package/build/dist/Interfaces/Clonable.js.map +1 -0
  333. package/build/dist/Interfaces/Evented.js +2 -0
  334. package/build/dist/Interfaces/Evented.js.map +1 -0
  335. package/build/dist/Interfaces/Index.js +8 -0
  336. package/build/dist/Interfaces/Index.js.map +1 -0
  337. package/build/dist/Interfaces/LifecycleEvents.js +51 -0
  338. package/build/dist/Interfaces/LifecycleEvents.js.map +1 -0
  339. package/build/dist/Interfaces/Loadable.js +2 -0
  340. package/build/dist/Interfaces/Loadable.js.map +1 -0
  341. package/build/dist/Interfaces/PointerEventHandlers.js +2 -0
  342. package/build/dist/Interfaces/PointerEventHandlers.js.map +1 -0
  343. package/build/dist/Label.js +81 -0
  344. package/build/dist/Label.js.map +1 -0
  345. package/build/dist/Loader.js +416 -0
  346. package/build/dist/Loader.js.map +1 -0
  347. package/build/dist/Math/Index.js +13 -0
  348. package/build/dist/Math/Index.js.map +1 -0
  349. package/build/dist/Math/Random.js +239 -0
  350. package/build/dist/Math/Random.js.map +1 -0
  351. package/build/dist/Math/affine-matrix.js +331 -0
  352. package/build/dist/Math/affine-matrix.js.map +1 -0
  353. package/build/dist/Math/coord-plane.js +17 -0
  354. package/build/dist/Math/coord-plane.js.map +1 -0
  355. package/build/dist/Math/global-coordinates.js +30 -0
  356. package/build/dist/Math/global-coordinates.js.map +1 -0
  357. package/build/dist/Math/line-segment.js +205 -0
  358. package/build/dist/Math/line-segment.js.map +1 -0
  359. package/build/dist/Math/matrix.js +457 -0
  360. package/build/dist/Math/matrix.js.map +1 -0
  361. package/build/dist/Math/projection.js +24 -0
  362. package/build/dist/Math/projection.js.map +1 -0
  363. package/build/dist/Math/ray.js +52 -0
  364. package/build/dist/Math/ray.js.map +1 -0
  365. package/build/dist/Math/transform.js +219 -0
  366. package/build/dist/Math/transform.js.map +1 -0
  367. package/build/dist/Math/util.js +82 -0
  368. package/build/dist/Math/util.js.map +1 -0
  369. package/build/dist/Math/vector-view.js +25 -0
  370. package/build/dist/Math/vector-view.js.map +1 -0
  371. package/build/dist/Math/vector.js +340 -0
  372. package/build/dist/Math/vector.js.map +1 -0
  373. package/build/dist/Math/watch-vector.js +26 -0
  374. package/build/dist/Math/watch-vector.js.map +1 -0
  375. package/build/dist/Particles.js +430 -0
  376. package/build/dist/Particles.js.map +1 -0
  377. package/build/dist/Polyfill.js +56 -0
  378. package/build/dist/Polyfill.js.map +1 -0
  379. package/build/dist/Resources/Gif.js +464 -0
  380. package/build/dist/Resources/Gif.js.map +1 -0
  381. package/build/dist/Resources/Index.js +4 -0
  382. package/build/dist/Resources/Index.js.map +1 -0
  383. package/build/dist/Resources/Resource.js +81 -0
  384. package/build/dist/Resources/Resource.js.map +1 -0
  385. package/build/dist/Resources/Sound/AudioContext.js +16 -0
  386. package/build/dist/Resources/Sound/AudioContext.js.map +1 -0
  387. package/build/dist/Resources/Sound/Index.js +4 -0
  388. package/build/dist/Resources/Sound/Index.js.map +1 -0
  389. package/build/dist/Resources/Sound/Sound.js +326 -0
  390. package/build/dist/Resources/Sound/Sound.js.map +1 -0
  391. package/build/dist/Resources/Sound/WebAudioInstance.js +190 -0
  392. package/build/dist/Resources/Sound/WebAudioInstance.js.map +1 -0
  393. package/build/dist/Scene.js +444 -0
  394. package/build/dist/Scene.js.map +1 -0
  395. package/build/dist/Screen.js +782 -0
  396. package/build/dist/Screen.js.map +1 -0
  397. package/build/dist/ScreenElement.js +43 -0
  398. package/build/dist/ScreenElement.js.map +1 -0
  399. package/build/dist/TileMap/IsometricEntityComponent.js +17 -0
  400. package/build/dist/TileMap/IsometricEntityComponent.js.map +1 -0
  401. package/build/dist/TileMap/IsometricEntitySystem.js +23 -0
  402. package/build/dist/TileMap/IsometricEntitySystem.js.map +1 -0
  403. package/build/dist/TileMap/IsometricMap.js +311 -0
  404. package/build/dist/TileMap/IsometricMap.js.map +1 -0
  405. package/build/dist/TileMap/TileMap.d.ts +2 -1
  406. package/build/dist/TileMap/TileMap.js +630 -0
  407. package/build/dist/TileMap/TileMap.js.map +1 -0
  408. package/build/dist/TileMap/index.js +5 -0
  409. package/build/dist/TileMap/index.js.map +1 -0
  410. package/build/dist/Timer.js +202 -0
  411. package/build/dist/Timer.js.map +1 -0
  412. package/build/dist/Trigger.js +94 -0
  413. package/build/dist/Trigger.js.map +1 -0
  414. package/build/dist/Util/Browser.js +66 -0
  415. package/build/dist/Util/Browser.js.map +1 -0
  416. package/build/dist/Util/Clock.js +219 -0
  417. package/build/dist/Util/Clock.js.map +1 -0
  418. package/build/dist/Util/Decorators.js +78 -0
  419. package/build/dist/Util/Decorators.js.map +1 -0
  420. package/build/dist/Util/Detector.js +167 -0
  421. package/build/dist/Util/Detector.js.map +1 -0
  422. package/build/dist/Util/DrawUtil.js +115 -0
  423. package/build/dist/Util/DrawUtil.js.map +1 -0
  424. package/build/dist/Util/EasingFunctions.js +102 -0
  425. package/build/dist/Util/EasingFunctions.js.map +1 -0
  426. package/build/dist/Util/Fps.js +47 -0
  427. package/build/dist/Util/Fps.js.map +1 -0
  428. package/build/dist/Util/Future.js +30 -0
  429. package/build/dist/Util/Future.js.map +1 -0
  430. package/build/dist/Util/IFrame.js +23 -0
  431. package/build/dist/Util/IFrame.js.map +1 -0
  432. package/build/dist/Util/Index.js +7 -0
  433. package/build/dist/Util/Index.js.map +1 -0
  434. package/build/dist/Util/Log.js +195 -0
  435. package/build/dist/Util/Log.js.map +1 -0
  436. package/build/dist/Util/Observable.js +66 -0
  437. package/build/dist/Util/Observable.js.map +1 -0
  438. package/build/dist/Util/Pool.js +74 -0
  439. package/build/dist/Util/Pool.js.map +1 -0
  440. package/build/dist/Util/Semaphore.js +55 -0
  441. package/build/dist/Util/Semaphore.js.map +1 -0
  442. package/build/dist/Util/Sound.js +22 -0
  443. package/build/dist/Util/Sound.js.map +1 -0
  444. package/build/dist/Util/StateMachine.js +79 -0
  445. package/build/dist/Util/StateMachine.js.map +1 -0
  446. package/build/dist/Util/Toaster.css +28 -28
  447. package/build/dist/Util/Toaster.js +84 -0
  448. package/build/dist/Util/Toaster.js.map +1 -0
  449. package/build/dist/Util/Util.d.ts +6 -0
  450. package/build/dist/Util/Util.js +95 -0
  451. package/build/dist/Util/Util.js.map +1 -0
  452. package/build/dist/Util/Watch.js +67 -0
  453. package/build/dist/Util/Watch.js.map +1 -0
  454. package/build/dist/Util/WebAudio.js +62 -0
  455. package/build/dist/Util/WebAudio.js.map +1 -0
  456. package/build/dist/excalibur.d.ts +2 -2
  457. package/build/dist/excalibur.js +389 -258
  458. package/build/dist/excalibur.js.map +1 -1
  459. package/build/dist/excalibur.min.js +1 -1
  460. package/build/dist/excalibur.min.js.LICENSE.txt +1 -1
  461. package/build/dist/excalibur.min.js.map +1 -1
  462. package/build/dist/index.js +81 -0
  463. package/build/dist/index.js.map +1 -0
  464. package/build/esm/Debug/Debug.d.ts +11 -0
  465. package/build/esm/Graphics/Context/ExcaliburGraphicsContextWebGL.d.ts +1 -0
  466. package/build/esm/Graphics/Context/material.d.ts +2 -0
  467. package/build/esm/Graphics/DebugGraphicsComponent.d.ts +3 -2
  468. package/build/esm/Graphics/FontCache.d.ts +1 -0
  469. package/build/esm/TileMap/TileMap.d.ts +2 -1
  470. package/build/esm/Util/Util.d.ts +6 -0
  471. package/build/esm/excalibur.d.ts +2 -2
  472. package/build/esm/excalibur.js +389 -258
  473. package/build/esm/excalibur.js.map +1 -1
  474. package/build/esm/excalibur.min.js +1 -1
  475. package/build/esm/excalibur.min.js.LICENSE.txt +1 -1
  476. package/build/esm/excalibur.min.js.map +1 -1
  477. package/docker-compose.yml +11 -11
  478. package/package.json +131 -131
  479. package/build/dist/Loader.css +0 -122
  480. package/build/nuget/Excalibur.0.28.3.nupkg +0 -0
  481. package/build/v0.28.3.zip +0 -0
  482. package/excalibur-0.28.3.tgz +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontTextInstance.js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AC,CAAC;QAE/B,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,uGAAuG;QACvG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,IAAI,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACpB,IAAI,OAAO,GAAG,EAAE,CAAC;YACjB,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,QAAQ,EAAE,CAAC;gBAC5C,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,QAAQ,EAAE,CAAC;oBAC/C,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;oBAC1C,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,kCAAkC;gBAC9D,CAAC;gBAED,uCAAuC;gBACvC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;gBAChB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;YACzB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC;QAEnC,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
@@ -0,0 +1,208 @@
1
+ import { Vector, vec } from '../Math/vector';
2
+ import { BoundingBox } from '../Collision/BoundingBox';
3
+ import { watch } from '../Util/Watch';
4
+ import { AffineMatrix } from '../Math/affine-matrix';
5
+ /**
6
+ * A Graphic is the base Excalibur primitive for something that can be drawn to the [[ExcaliburGraphicsContext]].
7
+ * [[Sprite]], [[Animation]], [[GraphicsGroup]], [[Canvas]], [[Rectangle]], [[Circle]], and [[Polygon]] all derive from the
8
+ * [[Graphic]] abstract class.
9
+ *
10
+ * Implementors of a Graphic must override the abstract [[Graphic._drawImage]] method to render an image to the graphics context. Graphic
11
+ * handles all the position, rotation, and scale transformations in [[Graphic._preDraw]] and [[Graphic._postDraw]]
12
+ */
13
+ export class Graphic {
14
+ isStale() {
15
+ return this._transformStale;
16
+ }
17
+ /**
18
+ * Gets or sets the flipHorizontal, which will flip the graphic horizontally (across the y axis)
19
+ */
20
+ get flipHorizontal() {
21
+ return this._flipHorizontal;
22
+ }
23
+ set flipHorizontal(value) {
24
+ this._flipHorizontal = value;
25
+ this._transformStale = true;
26
+ }
27
+ /**
28
+ * Gets or sets the flipVertical, which will flip the graphic vertically (across the x axis)
29
+ */
30
+ get flipVertical() {
31
+ return this._flipVertical;
32
+ }
33
+ set flipVertical(value) {
34
+ this._flipVertical = value;
35
+ this._transformStale = true;
36
+ }
37
+ /**
38
+ * Gets or sets the rotation of the graphic
39
+ */
40
+ get rotation() {
41
+ return this._rotation;
42
+ }
43
+ set rotation(value) {
44
+ this._rotation = value;
45
+ this._transformStale = true;
46
+ }
47
+ /**
48
+ * Gets or sets the scale of the graphic, this affects the width and
49
+ */
50
+ get scale() {
51
+ return this._scale;
52
+ }
53
+ set scale(value) {
54
+ this._scale = watch(value, () => {
55
+ this._transformStale = true;
56
+ });
57
+ this._transformStale = true;
58
+ }
59
+ /**
60
+ * Gets or sets the origin of the graphic, if not set the center of the graphic is the origin
61
+ */
62
+ get origin() {
63
+ return this._origin;
64
+ }
65
+ set origin(value) {
66
+ this._origin = watch(value, () => {
67
+ this._transformStale = true;
68
+ });
69
+ this._transformStale = true;
70
+ }
71
+ constructor(options) {
72
+ var _a, _b, _c, _d, _e, _f, _g;
73
+ this.id = Graphic._ID++;
74
+ this.transform = AffineMatrix.identity();
75
+ this.tint = null;
76
+ this._transformStale = true;
77
+ /**
78
+ * Gets or sets wether to show debug information about the graphic
79
+ */
80
+ this.showDebug = false;
81
+ this._flipHorizontal = false;
82
+ this._flipVertical = false;
83
+ this._rotation = 0;
84
+ /**
85
+ * Gets or sets the opacity of the graphic, 0 is transparent, 1 is solid (opaque).
86
+ */
87
+ this.opacity = 1;
88
+ this._scale = Vector.One;
89
+ this._origin = null;
90
+ this._width = 0;
91
+ this._height = 0;
92
+ if (options) {
93
+ this.origin = (_a = options.origin) !== null && _a !== void 0 ? _a : this.origin;
94
+ this.flipHorizontal = (_b = options.flipHorizontal) !== null && _b !== void 0 ? _b : this.flipHorizontal;
95
+ this.flipVertical = (_c = options.flipVertical) !== null && _c !== void 0 ? _c : this.flipVertical;
96
+ this.rotation = (_d = options.rotation) !== null && _d !== void 0 ? _d : this.rotation;
97
+ this.opacity = (_e = options.opacity) !== null && _e !== void 0 ? _e : this.opacity;
98
+ this.scale = (_f = options.scale) !== null && _f !== void 0 ? _f : this.scale;
99
+ this.tint = (_g = options.tint) !== null && _g !== void 0 ? _g : this.tint;
100
+ }
101
+ }
102
+ cloneGraphicOptions() {
103
+ return {
104
+ width: this.width / this.scale.x,
105
+ height: this.height / this.scale.y,
106
+ origin: this.origin ? this.origin.clone() : null,
107
+ flipHorizontal: this.flipHorizontal,
108
+ flipVertical: this.flipVertical,
109
+ rotation: this.rotation,
110
+ opacity: this.opacity,
111
+ scale: this.scale ? this.scale.clone() : null,
112
+ tint: this.tint ? this.tint.clone() : null
113
+ };
114
+ }
115
+ /**
116
+ * Gets or sets the width of the graphic (always positive)
117
+ */
118
+ get width() {
119
+ return Math.abs(this._width * this.scale.x);
120
+ }
121
+ /**
122
+ * Gets or sets the height of the graphic (always positive)
123
+ */
124
+ get height() {
125
+ return Math.abs(this._height * this.scale.y);
126
+ }
127
+ set width(value) {
128
+ this._width = value;
129
+ this._transformStale = true;
130
+ }
131
+ set height(value) {
132
+ this._height = value;
133
+ this._transformStale = true;
134
+ }
135
+ /**
136
+ * Gets a copy of the bounds in pixels occupied by the graphic on the the screen. This includes scale.
137
+ */
138
+ get localBounds() {
139
+ return BoundingBox.fromDimension(this.width, this.height, Vector.Zero);
140
+ }
141
+ /**
142
+ * Draw the whole graphic to the context including transform
143
+ * @param ex The excalibur graphics context
144
+ * @param x
145
+ * @param y
146
+ */
147
+ draw(ex, x, y) {
148
+ this._preDraw(ex, x, y);
149
+ this._drawImage(ex, 0, 0);
150
+ this._postDraw(ex);
151
+ }
152
+ /**
153
+ * Apply affine transformations to the graphics context to manipulate the graphic before [[Graphic._drawImage]]
154
+ * @param ex
155
+ * @param x
156
+ * @param y
157
+ */
158
+ _preDraw(ex, x, y) {
159
+ ex.save();
160
+ ex.translate(x, y);
161
+ if (this._transformStale) {
162
+ this.transform.reset();
163
+ this.transform.scale(Math.abs(this.scale.x), Math.abs(this.scale.y));
164
+ this._rotate(this.transform);
165
+ this._flip(this.transform);
166
+ this._transformStale = false;
167
+ }
168
+ ex.multiply(this.transform);
169
+ // it is important to multiply alphas so graphics respect the current context
170
+ ex.opacity = ex.opacity * this.opacity;
171
+ if (this.tint) {
172
+ ex.tint = this.tint;
173
+ }
174
+ }
175
+ _rotate(ex) {
176
+ var _a;
177
+ const scaleDirX = this.scale.x > 0 ? 1 : -1;
178
+ const scaleDirY = this.scale.y > 0 ? 1 : -1;
179
+ const origin = (_a = this.origin) !== null && _a !== void 0 ? _a : vec(this.width / 2, this.height / 2);
180
+ ex.translate(origin.x, origin.y);
181
+ ex.rotate(this.rotation);
182
+ // This is for handling direction changes 1 or -1, that way we don't have mismatched translates()
183
+ ex.scale(scaleDirX, scaleDirY);
184
+ ex.translate(-origin.x, -origin.y);
185
+ }
186
+ _flip(ex) {
187
+ if (this.flipHorizontal) {
188
+ ex.translate(this.width / this.scale.x, 0);
189
+ ex.scale(-1, 1);
190
+ }
191
+ if (this.flipVertical) {
192
+ ex.translate(0, this.height / this.scale.y);
193
+ ex.scale(1, -1);
194
+ }
195
+ }
196
+ /**
197
+ * Apply any additional work after [[Graphic._drawImage]] and restore the context state.
198
+ * @param ex
199
+ */
200
+ _postDraw(ex) {
201
+ if (this.showDebug) {
202
+ ex.debug.drawRect(0, 0, this.width, this.height);
203
+ }
204
+ ex.restore();
205
+ }
206
+ }
207
+ Graphic._ID = 0;
208
+ //# sourceMappingURL=Graphic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Graphic.js","sourceRoot":"","sources":["../../../src/engine/Graphics/Graphic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAyCrD;;;;;;;GAOG;AACH,MAAM,OAAgB,OAAO;IAQpB,OAAO;QACZ,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IASD;;OAEG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,IAAW,cAAc,CAAC,KAAc;QACtC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAC7B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;IAGD;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,YAAY,CAAC,KAAc;QACpC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAW,QAAQ,CAAC,KAAa;QAC/B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;IAQD;;OAEG;IACH,IAAW,KAAK;QACd,OAAO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,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAES,KAAK,CAAC,EAA2C;QACzD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3C,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5C,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED;;;OAGG;IACO,SAAS,CAAC,EAA4B;QAC9C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACnD,CAAC;QACD,EAAE,CAAC,OAAO,EAAE,CAAC;IACf,CAAC;;AAtOc,WAAG,GAAW,CAAC,AAAZ,CAAa"}
@@ -0,0 +1,336 @@
1
+ import { Vector, vec } from '../Math/vector';
2
+ import { Graphic } from './Graphic';
3
+ import { Logger } from '../Util/Log';
4
+ import { BoundingBox } from '../Collision/Index';
5
+ import { Component } from '../EntityComponentSystem/Component';
6
+ /**
7
+ * Type guard for checking if a Graphic HasTick (used for graphics that change over time like animations)
8
+ * @param graphic
9
+ */
10
+ export function hasGraphicsTick(graphic) {
11
+ return !!graphic.tick;
12
+ }
13
+ export class GraphicsLayer {
14
+ constructor(_options, _graphics) {
15
+ this._options = _options;
16
+ this._graphics = _graphics;
17
+ this.graphics = [];
18
+ }
19
+ get name() {
20
+ return this._options.name;
21
+ }
22
+ hide(nameOrGraphic) {
23
+ if (!nameOrGraphic) {
24
+ this.graphics.length = 0;
25
+ }
26
+ else {
27
+ let gfx = null;
28
+ if (nameOrGraphic instanceof Graphic) {
29
+ gfx = nameOrGraphic;
30
+ }
31
+ else {
32
+ gfx = this._graphics.getGraphic(nameOrGraphic);
33
+ }
34
+ this.graphics = this.graphics.filter((g) => g.graphic !== gfx);
35
+ this._graphics.recalculateBounds();
36
+ }
37
+ }
38
+ /**
39
+ * Show a graphic by name or instance at an offset, graphics are shown in the order in which `show()` is called.
40
+ *
41
+ * If `show()` is called multiple times for the same graphic it will be shown multiple times.
42
+ * @param nameOrGraphic
43
+ * @param options
44
+ */
45
+ show(nameOrGraphic, options) {
46
+ options = { ...options };
47
+ let gfx;
48
+ if (nameOrGraphic instanceof Graphic) {
49
+ gfx = this._graphics.copyGraphics ? nameOrGraphic.clone() : nameOrGraphic;
50
+ }
51
+ else {
52
+ gfx = this._graphics.getGraphic(nameOrGraphic);
53
+ if (!gfx) {
54
+ Logger.getInstance().error(`No such graphic added to component named ${nameOrGraphic}. These named graphics are available: `, this._graphics.getNames());
55
+ }
56
+ }
57
+ if (gfx) {
58
+ this.graphics.push({ graphic: gfx, options });
59
+ this._graphics.recalculateBounds();
60
+ return gfx;
61
+ }
62
+ else {
63
+ return null;
64
+ }
65
+ }
66
+ /**
67
+ * Use a specific graphic, swap out any current graphics being shown
68
+ * @param nameOrGraphic
69
+ * @param options
70
+ */
71
+ use(nameOrGraphic, options) {
72
+ options = { ...options };
73
+ this.hide();
74
+ return this.show(nameOrGraphic, options);
75
+ }
76
+ /**
77
+ * Current order of the layer, higher numbers are on top, lower numbers are on the bottom.
78
+ *
79
+ * For example a layer with `order = -1` would be under a layer of `order = 1`
80
+ */
81
+ get order() {
82
+ return this._options.order;
83
+ }
84
+ /**
85
+ * Set the order of the layer, higher numbers are on top, lower numbers are on the bottom.
86
+ *
87
+ * For example a layer with `order = -1` would be under a layer of `order = 1`
88
+ */
89
+ set order(order) {
90
+ this._options.order = order;
91
+ }
92
+ /**
93
+ * Get or set the pixel offset from the layer anchor for all graphics in the layer
94
+ */
95
+ get offset() {
96
+ var _a;
97
+ return (_a = this._options.offset) !== null && _a !== void 0 ? _a : Vector.Zero;
98
+ }
99
+ set offset(value) {
100
+ this._options.offset = value;
101
+ }
102
+ get currentKeys() {
103
+ var _a;
104
+ return (_a = this.name) !== null && _a !== void 0 ? _a : 'anonymous';
105
+ }
106
+ clone(graphicsComponent) {
107
+ const layer = new GraphicsLayer({ ...this._options }, graphicsComponent);
108
+ layer.graphics = [...this.graphics.map(g => ({ graphic: g.graphic.clone(), options: { ...g.options } }))];
109
+ return layer;
110
+ }
111
+ }
112
+ export class GraphicsLayers {
113
+ constructor(_component) {
114
+ this._component = _component;
115
+ this._layers = [];
116
+ this._layerMap = {};
117
+ this.default = new GraphicsLayer({ name: 'default', order: 0 }, _component);
118
+ this._maybeAddLayer(this.default);
119
+ }
120
+ create(options) {
121
+ const layer = new GraphicsLayer(options, this._component);
122
+ return this._maybeAddLayer(layer);
123
+ }
124
+ get(name) {
125
+ if (name) {
126
+ return this._getLayer(name);
127
+ }
128
+ return this._layers;
129
+ }
130
+ currentKeys() {
131
+ const graphicsLayerKeys = [];
132
+ for (const layer of this._layers) {
133
+ graphicsLayerKeys.push(layer.currentKeys);
134
+ }
135
+ return graphicsLayerKeys;
136
+ }
137
+ has(name) {
138
+ return name in this._layerMap;
139
+ }
140
+ _maybeAddLayer(layer) {
141
+ if (this._layerMap[layer.name]) {
142
+ // todo log warning
143
+ return this._layerMap[layer.name];
144
+ }
145
+ this._layerMap[layer.name] = layer;
146
+ this._layers.push(layer);
147
+ this._layers.sort((a, b) => a.order - b.order);
148
+ return layer;
149
+ }
150
+ _getLayer(name) {
151
+ return this._layerMap[name];
152
+ }
153
+ clone(graphicsComponent) {
154
+ const layers = new GraphicsLayers(graphicsComponent);
155
+ layers._layerMap = {};
156
+ layers._layers = [];
157
+ layers.default = this.default.clone(graphicsComponent);
158
+ layers._maybeAddLayer(layers.default);
159
+ // Remove the default layer out of the clone
160
+ const clonedLayers = this._layers.filter(l => l.name !== 'default').map(l => l.clone(graphicsComponent));
161
+ clonedLayers.forEach(layer => layers._maybeAddLayer(layer));
162
+ return layers;
163
+ }
164
+ }
165
+ /**
166
+ * Component to manage drawings, using with the position component
167
+ */
168
+ export class GraphicsComponent extends Component {
169
+ getGraphic(name) {
170
+ return this._graphics[name];
171
+ }
172
+ /**
173
+ * Get registered graphics names
174
+ */
175
+ getNames() {
176
+ return Object.keys(this._graphics);
177
+ }
178
+ constructor(options) {
179
+ super();
180
+ this.type = 'ex.graphics';
181
+ this._graphics = {};
182
+ /**
183
+ * Sets or gets wether any drawing should be visible in this component
184
+ */
185
+ this.visible = true;
186
+ /**
187
+ * Sets or gets wither all drawings should have an opacity applied
188
+ */
189
+ this.opacity = 1;
190
+ /**
191
+ * Offset to apply to graphics by default
192
+ */
193
+ this.offset = Vector.Zero;
194
+ /**
195
+ * Anchor to apply to graphics by default
196
+ */
197
+ this.anchor = Vector.Half;
198
+ /**
199
+ * Flip all graphics horizontally along the y-axis
200
+ */
201
+ this.flipHorizontal = false;
202
+ /**
203
+ * Flip all graphics vertically along the x-axis
204
+ */
205
+ this.flipVertical = false;
206
+ /**
207
+ * If set to true graphics added to the component will be copied. This can affect performance
208
+ */
209
+ this.copyGraphics = false;
210
+ this._localBounds = null;
211
+ // Defaults
212
+ options = {
213
+ visible: this.visible,
214
+ ...options
215
+ };
216
+ const { current, anchor, opacity, visible, graphics, offset, copyGraphics, onPreDraw, onPostDraw } = options;
217
+ this._graphics = graphics || {};
218
+ this.offset = offset !== null && offset !== void 0 ? offset : this.offset;
219
+ this.opacity = opacity !== null && opacity !== void 0 ? opacity : this.opacity;
220
+ this.anchor = anchor !== null && anchor !== void 0 ? anchor : this.anchor;
221
+ this.copyGraphics = copyGraphics !== null && copyGraphics !== void 0 ? copyGraphics : this.copyGraphics;
222
+ this.onPreDraw = onPreDraw !== null && onPreDraw !== void 0 ? onPreDraw : this.onPreDraw;
223
+ this.onPostDraw = onPostDraw !== null && onPostDraw !== void 0 ? onPostDraw : this.onPostDraw;
224
+ this.visible = !!visible;
225
+ this.layers = new GraphicsLayers(this);
226
+ if (current && this._graphics[current]) {
227
+ this.show(this._graphics[current]);
228
+ }
229
+ }
230
+ /**
231
+ * Returns the currently displayed graphics and their offsets, empty array if hidden
232
+ */
233
+ get current() {
234
+ return this.layers.default.graphics;
235
+ }
236
+ /**
237
+ * Returns all graphics associated with this component
238
+ */
239
+ get graphics() {
240
+ return this._graphics;
241
+ }
242
+ add(nameOrGraphic, graphic) {
243
+ let name = 'default';
244
+ let graphicToSet = null;
245
+ if (typeof nameOrGraphic === 'string') {
246
+ name = nameOrGraphic;
247
+ graphicToSet = graphic;
248
+ }
249
+ else {
250
+ graphicToSet = nameOrGraphic;
251
+ }
252
+ this._graphics[name] = this.copyGraphics ? graphicToSet.clone() : graphicToSet;
253
+ if (name === 'default') {
254
+ this.show('default');
255
+ }
256
+ return graphicToSet;
257
+ }
258
+ /**
259
+ * Show a graphic by name on the **default** layer, returns the new [[Graphic]]
260
+ */
261
+ show(nameOrGraphic, options) {
262
+ const result = this.layers.default.show(nameOrGraphic, options);
263
+ this.recalculateBounds();
264
+ return result;
265
+ }
266
+ /**
267
+ * Use a graphic only, swap out any graphics on the **default** layer, returns the new [[Graphic]]
268
+ * @param nameOrGraphic
269
+ * @param options
270
+ */
271
+ use(nameOrGraphic, options) {
272
+ const result = this.layers.default.use(nameOrGraphic, options);
273
+ this.recalculateBounds();
274
+ return result;
275
+ }
276
+ hide(nameOrGraphic) {
277
+ this.layers.default.hide(nameOrGraphic);
278
+ }
279
+ set localBounds(bounds) {
280
+ this._localBounds = bounds;
281
+ }
282
+ recalculateBounds() {
283
+ let bb = new BoundingBox();
284
+ for (const layer of this.layers.get()) {
285
+ for (const { graphic, options } of layer.graphics) {
286
+ let anchor = this.anchor;
287
+ let offset = this.offset;
288
+ if (options === null || options === void 0 ? void 0 : options.anchor) {
289
+ anchor = options.anchor;
290
+ }
291
+ if (options === null || options === void 0 ? void 0 : options.offset) {
292
+ offset = options.offset;
293
+ }
294
+ const bounds = graphic.localBounds;
295
+ const offsetX = -bounds.width * anchor.x + offset.x;
296
+ const offsetY = -bounds.height * anchor.y + offset.y;
297
+ bb = graphic === null || graphic === void 0 ? void 0 : graphic.localBounds.translate(vec(offsetX + layer.offset.x, offsetY + layer.offset.y)).combine(bb);
298
+ }
299
+ }
300
+ this._localBounds = bb;
301
+ }
302
+ get localBounds() {
303
+ if (!this._localBounds || this._localBounds.hasZeroDimensions()) {
304
+ this.recalculateBounds();
305
+ }
306
+ return this._localBounds;
307
+ }
308
+ /**
309
+ * Update underlying graphics if necesary, called internally
310
+ * @param elapsed
311
+ * @internal
312
+ */
313
+ update(elapsed, idempotencyToken = 0) {
314
+ for (const layer of this.layers.get()) {
315
+ for (const { graphic } of layer.graphics) {
316
+ if (hasGraphicsTick(graphic)) {
317
+ graphic === null || graphic === void 0 ? void 0 : graphic.tick(elapsed, idempotencyToken);
318
+ }
319
+ }
320
+ }
321
+ }
322
+ clone() {
323
+ const graphics = new GraphicsComponent();
324
+ graphics._graphics = { ...this._graphics };
325
+ graphics.offset = this.offset.clone();
326
+ graphics.opacity = this.opacity;
327
+ graphics.anchor = this.anchor.clone();
328
+ graphics.copyGraphics = this.copyGraphics;
329
+ graphics.onPreDraw = this.onPreDraw;
330
+ graphics.onPostDraw = this.onPostDraw;
331
+ graphics.visible = this.visible;
332
+ graphics.layers = this.layers.clone(graphics);
333
+ return graphics;
334
+ }
335
+ }
336
+ //# sourceMappingURL=GraphicsComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphicsComponent.js","sourceRoot":"","sources":["../../../src/engine/Graphics/GraphicsComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,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,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ export class GraphicsDiagnostics {
2
+ static clear() {
3
+ GraphicsDiagnostics.DrawCallCount = 0;
4
+ GraphicsDiagnostics.DrawnImagesCount = 0;
5
+ }
6
+ }
7
+ GraphicsDiagnostics.DrawCallCount = 0;
8
+ GraphicsDiagnostics.DrawnImagesCount = 0;
9
+ //# sourceMappingURL=GraphicsDiagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphicsDiagnostics.js","sourceRoot":"","sources":["../../../src/engine/Graphics/GraphicsDiagnostics.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,mBAAmB;IAGvB,MAAM,CAAC,KAAK;QACjB,mBAAmB,CAAC,aAAa,GAAG,CAAC,CAAC;QACtC,mBAAmB,CAAC,gBAAgB,GAAG,CAAC,CAAC;IAC3C,CAAC;;AALa,iCAAa,GAAW,CAAC,CAAC;AAC1B,oCAAgB,GAAW,CAAC,CAAC"}