excalibur 0.25.2 → 0.25.3

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 (446) hide show
  1. package/CHANGELOG.md +7 -2
  2. package/build/dist/Actions/Action/Blink.js +51 -0
  3. package/build/dist/Actions/Action/Blink.js.map +1 -0
  4. package/build/dist/Actions/Action/CallMethod.js +21 -0
  5. package/build/dist/Actions/Action/CallMethod.js.map +1 -0
  6. package/build/dist/Actions/Action/Delay.js +25 -0
  7. package/build/dist/Actions/Action/Delay.js.map +1 -0
  8. package/build/dist/Actions/Action/Die.js +22 -0
  9. package/build/dist/Actions/Action/Die.js.map +1 -0
  10. package/build/dist/Actions/Action/EaseTo.js +69 -0
  11. package/build/dist/Actions/Action/EaseTo.js.map +1 -0
  12. package/build/dist/Actions/Action/Fade.js +46 -0
  13. package/build/dist/Actions/Action/Fade.js.map +1 -0
  14. package/build/dist/Actions/Action/Follow.js +55 -0
  15. package/build/dist/Actions/Action/Follow.js.map +1 -0
  16. package/build/dist/Actions/Action/Meet.js +52 -0
  17. package/build/dist/Actions/Action/Meet.js.map +1 -0
  18. package/build/dist/Actions/Action/MoveBy.js +47 -0
  19. package/build/dist/Actions/Action/MoveBy.js.map +1 -0
  20. package/build/dist/Actions/Action/MoveTo.js +40 -0
  21. package/build/dist/Actions/Action/MoveTo.js.map +1 -0
  22. package/build/dist/Actions/Action/Repeat.js +31 -0
  23. package/build/dist/Actions/Action/Repeat.js.map +1 -0
  24. package/build/dist/Actions/Action/RepeatForever.js +37 -0
  25. package/build/dist/Actions/Action/RepeatForever.js.map +1 -0
  26. package/build/dist/Actions/Action/RotateBy.js +91 -0
  27. package/build/dist/Actions/Action/RotateBy.js.map +1 -0
  28. package/build/dist/Actions/Action/RotateTo.js +90 -0
  29. package/build/dist/Actions/Action/RotateTo.js.map +1 -0
  30. package/build/dist/Actions/Action/ScaleBy.js +45 -0
  31. package/build/dist/Actions/Action/ScaleBy.js.map +1 -0
  32. package/build/dist/Actions/Action/ScaleTo.js +56 -0
  33. package/build/dist/Actions/Action/ScaleTo.js.map +1 -0
  34. package/build/dist/Actions/Action.js +2 -0
  35. package/build/dist/Actions/Action.js.map +1 -0
  36. package/build/dist/Actions/ActionContext.js +305 -0
  37. package/build/dist/Actions/ActionContext.js.map +1 -0
  38. package/build/dist/Actions/ActionQueue.js +87 -0
  39. package/build/dist/Actions/ActionQueue.js.map +1 -0
  40. package/build/dist/Actions/Actionable.js +2 -0
  41. package/build/dist/Actions/Actionable.js.map +1 -0
  42. package/build/dist/Actions/ActionsComponent.js +198 -0
  43. package/build/dist/Actions/ActionsComponent.js.map +1 -0
  44. package/build/dist/Actions/ActionsSystem.js +18 -0
  45. package/build/dist/Actions/ActionsSystem.js.map +1 -0
  46. package/build/dist/Actions/Index.js +22 -0
  47. package/build/dist/Actions/Index.js.map +1 -0
  48. package/build/dist/Actions/RotationType.js +27 -0
  49. package/build/dist/Actions/RotationType.js.map +1 -0
  50. package/build/dist/Actor.js +831 -0
  51. package/build/dist/Actor.js.map +1 -0
  52. package/build/dist/Camera.js +663 -0
  53. package/build/dist/Camera.js.map +1 -0
  54. package/build/dist/Class.js +48 -0
  55. package/build/dist/Class.js.map +1 -0
  56. package/build/dist/Collision/BodyComponent.js +351 -0
  57. package/build/dist/Collision/BodyComponent.js.map +1 -0
  58. package/build/dist/Collision/BoundingBox.js +361 -0
  59. package/build/dist/Collision/BoundingBox.js.map +1 -0
  60. package/build/dist/Collision/ColliderComponent.js +198 -0
  61. package/build/dist/Collision/ColliderComponent.js.map +1 -0
  62. package/build/dist/Collision/Colliders/CircleCollider.js +264 -0
  63. package/build/dist/Collision/Colliders/CircleCollider.js.map +1 -0
  64. package/build/dist/Collision/Colliders/ClosestLineJumpTable.js +211 -0
  65. package/build/dist/Collision/Colliders/ClosestLineJumpTable.js.map +1 -0
  66. package/build/dist/Collision/Colliders/Collider.js +26 -0
  67. package/build/dist/Collision/Colliders/Collider.js.map +1 -0
  68. package/build/dist/Collision/Colliders/CollisionJumpTable.js +301 -0
  69. package/build/dist/Collision/Colliders/CollisionJumpTable.js.map +1 -0
  70. package/build/dist/Collision/Colliders/CompositeCollider.js +232 -0
  71. package/build/dist/Collision/Colliders/CompositeCollider.js.map +1 -0
  72. package/build/dist/Collision/Colliders/EdgeCollider.js +253 -0
  73. package/build/dist/Collision/Colliders/EdgeCollider.js.map +1 -0
  74. package/build/dist/Collision/Colliders/PolygonCollider.js +389 -0
  75. package/build/dist/Collision/Colliders/PolygonCollider.js.map +1 -0
  76. package/build/dist/Collision/Colliders/SeparatingAxis.js +67 -0
  77. package/build/dist/Collision/Colliders/SeparatingAxis.js.map +1 -0
  78. package/build/dist/Collision/Colliders/Shape.js +102 -0
  79. package/build/dist/Collision/Colliders/Shape.js.map +1 -0
  80. package/build/dist/Collision/CollisionSystem.js +116 -0
  81. package/build/dist/Collision/CollisionSystem.js.map +1 -0
  82. package/build/dist/Collision/CollisionType.js +33 -0
  83. package/build/dist/Collision/CollisionType.js.map +1 -0
  84. package/build/dist/Collision/Detection/CollisionContact.js +46 -0
  85. package/build/dist/Collision/Detection/CollisionContact.js.map +1 -0
  86. package/build/dist/Collision/Detection/CollisionProcessor.js +2 -0
  87. package/build/dist/Collision/Detection/CollisionProcessor.js.map +1 -0
  88. package/build/dist/Collision/Detection/DynamicTree.js +442 -0
  89. package/build/dist/Collision/Detection/DynamicTree.js.map +1 -0
  90. package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.js +211 -0
  91. package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.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/Group/CollisionGroup.js +114 -0
  95. package/build/dist/Collision/Group/CollisionGroup.js.map +1 -0
  96. package/build/dist/Collision/Group/CollisionGroupManager.js +52 -0
  97. package/build/dist/Collision/Group/CollisionGroupManager.js.map +1 -0
  98. package/build/dist/Collision/Index.js +29 -0
  99. package/build/dist/Collision/Index.js.map +1 -0
  100. package/build/dist/Collision/Integrator.js +11 -0
  101. package/build/dist/Collision/Integrator.js.map +1 -0
  102. package/build/dist/Collision/MotionSystem.js +42 -0
  103. package/build/dist/Collision/MotionSystem.js.map +1 -0
  104. package/build/dist/Collision/Physics.js +163 -0
  105. package/build/dist/Collision/Physics.js.map +1 -0
  106. package/build/dist/Collision/Side.js +51 -0
  107. package/build/dist/Collision/Side.js.map +1 -0
  108. package/build/dist/Collision/Solver/ArcadeSolver.js +101 -0
  109. package/build/dist/Collision/Solver/ArcadeSolver.js.map +1 -0
  110. package/build/dist/Collision/Solver/ContactConstraintPoint.js +83 -0
  111. package/build/dist/Collision/Solver/ContactConstraintPoint.js.map +1 -0
  112. package/build/dist/Collision/Solver/RealisticSolver.js +248 -0
  113. package/build/dist/Collision/Solver/RealisticSolver.js.map +1 -0
  114. package/build/dist/Collision/Solver/Solver.js +37 -0
  115. package/build/dist/Collision/Solver/Solver.js.map +1 -0
  116. package/build/dist/Color.js +461 -0
  117. package/build/dist/Color.js.map +1 -0
  118. package/build/dist/Configurable.js +32 -0
  119. package/build/dist/Configurable.js.map +1 -0
  120. package/build/dist/Debug/Debug.js +375 -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 +251 -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/Drawing/Animation.js +294 -0
  131. package/build/dist/Drawing/Animation.js.map +1 -0
  132. package/build/dist/Drawing/CanvasDrawComponent.js +16 -0
  133. package/build/dist/Drawing/CanvasDrawComponent.js.map +1 -0
  134. package/build/dist/Drawing/CanvasDrawingSystem.js +95 -0
  135. package/build/dist/Drawing/CanvasDrawingSystem.js.map +1 -0
  136. package/build/dist/Drawing/Index.js +10 -0
  137. package/build/dist/Drawing/Index.js.map +1 -0
  138. package/build/dist/Drawing/Polygon.js +139 -0
  139. package/build/dist/Drawing/Polygon.js.map +1 -0
  140. package/build/dist/Drawing/Sprite.js +355 -0
  141. package/build/dist/Drawing/Sprite.js.map +1 -0
  142. package/build/dist/Drawing/SpriteEffects.js +246 -0
  143. package/build/dist/Drawing/SpriteEffects.js.map +1 -0
  144. package/build/dist/Drawing/SpriteSheet.js +413 -0
  145. package/build/dist/Drawing/SpriteSheet.js.map +1 -0
  146. package/build/dist/Drawing/Texture.js +69 -0
  147. package/build/dist/Drawing/Texture.js.map +1 -0
  148. package/build/dist/Engine.d.ts +4 -1
  149. package/build/dist/Engine.js +985 -0
  150. package/build/dist/Engine.js.map +1 -0
  151. package/build/dist/EntityComponentSystem/Component.js +65 -0
  152. package/build/dist/EntityComponentSystem/Component.js.map +1 -0
  153. package/build/dist/EntityComponentSystem/Components/MotionComponent.js +33 -0
  154. package/build/dist/EntityComponentSystem/Components/MotionComponent.js.map +1 -0
  155. package/build/dist/EntityComponentSystem/Components/TransformComponent.js +249 -0
  156. package/build/dist/EntityComponentSystem/Components/TransformComponent.js.map +1 -0
  157. package/build/dist/EntityComponentSystem/Entity.js +452 -0
  158. package/build/dist/EntityComponentSystem/Entity.js.map +1 -0
  159. package/build/dist/EntityComponentSystem/EntityManager.js +128 -0
  160. package/build/dist/EntityComponentSystem/EntityManager.js.map +1 -0
  161. package/build/dist/EntityComponentSystem/Query.js +91 -0
  162. package/build/dist/EntityComponentSystem/Query.js.map +1 -0
  163. package/build/dist/EntityComponentSystem/QueryManager.js +90 -0
  164. package/build/dist/EntityComponentSystem/QueryManager.js.map +1 -0
  165. package/build/dist/EntityComponentSystem/System.js +76 -0
  166. package/build/dist/EntityComponentSystem/System.js.map +1 -0
  167. package/build/dist/EntityComponentSystem/SystemManager.js +102 -0
  168. package/build/dist/EntityComponentSystem/SystemManager.js.map +1 -0
  169. package/build/dist/EntityComponentSystem/Util.js +5 -0
  170. package/build/dist/EntityComponentSystem/Util.js.map +1 -0
  171. package/build/dist/EntityComponentSystem/World.js +55 -0
  172. package/build/dist/EntityComponentSystem/World.js.map +1 -0
  173. package/build/dist/EntityComponentSystem/index.js +11 -0
  174. package/build/dist/EntityComponentSystem/index.js.map +1 -0
  175. package/build/dist/EventDispatcher.js +114 -0
  176. package/build/dist/EventDispatcher.js.map +1 -0
  177. package/build/dist/Events/ExEvent.js +12 -0
  178. package/build/dist/Events/ExEvent.js.map +1 -0
  179. package/build/dist/Events/MediaEvents.js +75 -0
  180. package/build/dist/Events/MediaEvents.js.map +1 -0
  181. package/build/dist/Events/PointerEvents.js +52 -0
  182. package/build/dist/Events/PointerEvents.js.map +1 -0
  183. package/build/dist/Events.js +497 -0
  184. package/build/dist/Events.js.map +1 -0
  185. package/build/dist/Flags.js +90 -0
  186. package/build/dist/Flags.js.map +1 -0
  187. package/build/dist/Graphics/Animation.js +310 -0
  188. package/build/dist/Graphics/Animation.js.map +1 -0
  189. package/build/dist/Graphics/Canvas.js +38 -0
  190. package/build/dist/Graphics/Canvas.js.map +1 -0
  191. package/build/dist/Graphics/Circle.js +47 -0
  192. package/build/dist/Graphics/Circle.js.map +1 -0
  193. package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js +2 -0
  194. package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js.map +1 -0
  195. package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js +207 -0
  196. package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js.map +1 -0
  197. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js +331 -0
  198. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js.map +1 -0
  199. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js +160 -0
  200. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js.map +1 -0
  201. package/build/dist/Graphics/Context/debug-text.js +47 -0
  202. package/build/dist/Graphics/Context/debug-text.js.map +1 -0
  203. package/build/dist/Graphics/Context/image-renderer/image-renderer.js +209 -0
  204. package/build/dist/Graphics/Context/image-renderer/image-renderer.js.map +1 -0
  205. package/build/dist/Graphics/Context/line-renderer/line-renderer.js +87 -0
  206. package/build/dist/Graphics/Context/line-renderer/line-renderer.js.map +1 -0
  207. package/build/dist/Graphics/Context/point-renderer/point-renderer.js +82 -0
  208. package/build/dist/Graphics/Context/point-renderer/point-renderer.js.map +1 -0
  209. package/build/dist/Graphics/Context/quad-index-buffer.js +69 -0
  210. package/build/dist/Graphics/Context/quad-index-buffer.js.map +1 -0
  211. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js +272 -0
  212. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js.map +1 -0
  213. package/build/dist/Graphics/Context/render-source.js +16 -0
  214. package/build/dist/Graphics/Context/render-source.js.map +1 -0
  215. package/build/dist/Graphics/Context/render-target.js +65 -0
  216. package/build/dist/Graphics/Context/render-target.js.map +1 -0
  217. package/build/dist/Graphics/Context/renderer.js +2 -0
  218. package/build/dist/Graphics/Context/renderer.js.map +1 -0
  219. package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js +53 -0
  220. package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js.map +1 -0
  221. package/build/dist/Graphics/Context/shader.js +236 -0
  222. package/build/dist/Graphics/Context/shader.js.map +1 -0
  223. package/build/dist/Graphics/Context/state-stack.js +27 -0
  224. package/build/dist/Graphics/Context/state-stack.js.map +1 -0
  225. package/build/dist/Graphics/Context/texture-loader.d.ts +8 -0
  226. package/build/dist/Graphics/Context/texture-loader.js +121 -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 +45 -0
  231. package/build/dist/Graphics/Context/vertex-buffer.js.map +1 -0
  232. package/build/dist/Graphics/Context/vertex-layout.js +93 -0
  233. package/build/dist/Graphics/Context/vertex-layout.js.map +1 -0
  234. package/build/dist/Graphics/Context/webgl-adapter.js +19 -0
  235. package/build/dist/Graphics/Context/webgl-adapter.js.map +1 -0
  236. package/build/dist/Graphics/Context/webgl-util.js +105 -0
  237. package/build/dist/Graphics/Context/webgl-util.js.map +1 -0
  238. package/build/dist/Graphics/DebugGraphicsComponent.js +15 -0
  239. package/build/dist/Graphics/DebugGraphicsComponent.js.map +1 -0
  240. package/build/dist/Graphics/Filtering.js +17 -0
  241. package/build/dist/Graphics/Filtering.js.map +1 -0
  242. package/build/dist/Graphics/Font.js +293 -0
  243. package/build/dist/Graphics/Font.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/Graphic.js +200 -0
  247. package/build/dist/Graphics/Graphic.js.map +1 -0
  248. package/build/dist/Graphics/GraphicsComponent.js +290 -0
  249. package/build/dist/Graphics/GraphicsComponent.js.map +1 -0
  250. package/build/dist/Graphics/GraphicsDiagnostics.js +9 -0
  251. package/build/dist/Graphics/GraphicsDiagnostics.js.map +1 -0
  252. package/build/dist/Graphics/GraphicsGroup.js +69 -0
  253. package/build/dist/Graphics/GraphicsGroup.js.map +1 -0
  254. package/build/dist/Graphics/GraphicsSystem.js +153 -0
  255. package/build/dist/Graphics/GraphicsSystem.js.map +1 -0
  256. package/build/dist/Graphics/ImageSource.js +116 -0
  257. package/build/dist/Graphics/ImageSource.js.map +1 -0
  258. package/build/dist/Graphics/Polygon.js +59 -0
  259. package/build/dist/Graphics/Polygon.js.map +1 -0
  260. package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js +7 -0
  261. package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js.map +1 -0
  262. package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js +52 -0
  263. package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js.map +1 -0
  264. package/build/dist/Graphics/PostProcessor/PostProcessor.js +2 -0
  265. package/build/dist/Graphics/PostProcessor/PostProcessor.js.map +1 -0
  266. package/build/dist/Graphics/PostProcessor/ScreenShader.js +56 -0
  267. package/build/dist/Graphics/PostProcessor/ScreenShader.js.map +1 -0
  268. package/build/dist/Graphics/Raster.js +207 -0
  269. package/build/dist/Graphics/Raster.js.map +1 -0
  270. package/build/dist/Graphics/Rectangle.js +29 -0
  271. package/build/dist/Graphics/Rectangle.js.map +1 -0
  272. package/build/dist/Graphics/Sprite.js +103 -0
  273. package/build/dist/Graphics/Sprite.js.map +1 -0
  274. package/build/dist/Graphics/SpriteFont.js +120 -0
  275. package/build/dist/Graphics/SpriteFont.js.map +1 -0
  276. package/build/dist/Graphics/SpriteSheet.js +115 -0
  277. package/build/dist/Graphics/SpriteSheet.js.map +1 -0
  278. package/build/dist/Graphics/Text.js +94 -0
  279. package/build/dist/Graphics/Text.js.map +1 -0
  280. package/build/dist/Graphics/index.js +42 -0
  281. package/build/dist/Graphics/index.js.map +1 -0
  282. package/build/dist/Id.js +8 -0
  283. package/build/dist/Id.js.map +1 -0
  284. package/build/dist/Input/CapturePointerConfig.js +5 -0
  285. package/build/dist/Input/CapturePointerConfig.js.map +1 -0
  286. package/build/dist/Input/EngineInput.js +2 -0
  287. package/build/dist/Input/EngineInput.js.map +1 -0
  288. package/build/dist/Input/Gamepad.js +358 -0
  289. package/build/dist/Input/Gamepad.js.map +1 -0
  290. package/build/dist/Input/Index.js +22 -0
  291. package/build/dist/Input/Index.js.map +1 -0
  292. package/build/dist/Input/Keyboard.js +267 -0
  293. package/build/dist/Input/Keyboard.js.map +1 -0
  294. package/build/dist/Input/NativePointerButton.js +12 -0
  295. package/build/dist/Input/NativePointerButton.js.map +1 -0
  296. package/build/dist/Input/PointerAbstraction.js +41 -0
  297. package/build/dist/Input/PointerAbstraction.js.map +1 -0
  298. package/build/dist/Input/PointerButton.js +12 -0
  299. package/build/dist/Input/PointerButton.js.map +1 -0
  300. package/build/dist/Input/PointerComponent.js +28 -0
  301. package/build/dist/Input/PointerComponent.js.map +1 -0
  302. package/build/dist/Input/PointerEvent.js +25 -0
  303. package/build/dist/Input/PointerEvent.js.map +1 -0
  304. package/build/dist/Input/PointerEventReceiver.js +414 -0
  305. package/build/dist/Input/PointerEventReceiver.js.map +1 -0
  306. package/build/dist/Input/PointerScope.js +16 -0
  307. package/build/dist/Input/PointerScope.js.map +1 -0
  308. package/build/dist/Input/PointerSystem.js +217 -0
  309. package/build/dist/Input/PointerSystem.js.map +1 -0
  310. package/build/dist/Input/PointerType.js +11 -0
  311. package/build/dist/Input/PointerType.js.map +1 -0
  312. package/build/dist/Input/WheelDeltaMode.js +7 -0
  313. package/build/dist/Input/WheelDeltaMode.js.map +1 -0
  314. package/build/dist/Input/WheelEvent.js +21 -0
  315. package/build/dist/Input/WheelEvent.js.map +1 -0
  316. package/build/dist/Interfaces/Audio.js +2 -0
  317. package/build/dist/Interfaces/Audio.js.map +1 -0
  318. package/build/dist/Interfaces/AudioImplementation.js +11 -0
  319. package/build/dist/Interfaces/AudioImplementation.js.map +1 -0
  320. package/build/dist/Interfaces/Clonable.js +2 -0
  321. package/build/dist/Interfaces/Clonable.js.map +1 -0
  322. package/build/dist/Interfaces/Drawable.js +2 -0
  323. package/build/dist/Interfaces/Drawable.js.map +1 -0
  324. package/build/dist/Interfaces/Evented.js +2 -0
  325. package/build/dist/Interfaces/Evented.js.map +1 -0
  326. package/build/dist/Interfaces/Index.js +10 -0
  327. package/build/dist/Interfaces/Index.js.map +1 -0
  328. package/build/dist/Interfaces/LifecycleEvents.js +51 -0
  329. package/build/dist/Interfaces/LifecycleEvents.js.map +1 -0
  330. package/build/dist/Interfaces/Loadable.js +2 -0
  331. package/build/dist/Interfaces/Loadable.js.map +1 -0
  332. package/build/dist/Interfaces/PointerEventHandlers.js +2 -0
  333. package/build/dist/Interfaces/PointerEventHandlers.js.map +1 -0
  334. package/build/dist/Interfaces/Trait.js +2 -0
  335. package/build/dist/Interfaces/Trait.js.map +1 -0
  336. package/build/dist/Label.js +273 -0
  337. package/build/dist/Label.js.map +1 -0
  338. package/build/dist/Loader.js +367 -0
  339. package/build/dist/Loader.js.map +1 -0
  340. package/build/dist/Math/Index.js +10 -0
  341. package/build/dist/Math/Index.js.map +1 -0
  342. package/build/dist/Math/Random.js +239 -0
  343. package/build/dist/Math/Random.js.map +1 -0
  344. package/build/dist/Math/global-coordinates.js +30 -0
  345. package/build/dist/Math/global-coordinates.js.map +1 -0
  346. package/build/dist/Math/line.js +194 -0
  347. package/build/dist/Math/line.js.map +1 -0
  348. package/build/dist/Math/matrix.js +446 -0
  349. package/build/dist/Math/matrix.js.map +1 -0
  350. package/build/dist/Math/projection.js +24 -0
  351. package/build/dist/Math/projection.js.map +1 -0
  352. package/build/dist/Math/ray.js +52 -0
  353. package/build/dist/Math/ray.js.map +1 -0
  354. package/build/dist/Math/util.js +82 -0
  355. package/build/dist/Math/util.js.map +1 -0
  356. package/build/dist/Math/vector-view.js +25 -0
  357. package/build/dist/Math/vector-view.js.map +1 -0
  358. package/build/dist/Math/vector.js +326 -0
  359. package/build/dist/Math/vector.js.map +1 -0
  360. package/build/dist/Particles.js +449 -0
  361. package/build/dist/Particles.js.map +1 -0
  362. package/build/dist/Polyfill.js +56 -0
  363. package/build/dist/Polyfill.js.map +1 -0
  364. package/build/dist/Promises.js +205 -0
  365. package/build/dist/Promises.js.map +1 -0
  366. package/build/dist/Resources/Gif.js +479 -0
  367. package/build/dist/Resources/Gif.js.map +1 -0
  368. package/build/dist/Resources/Index.js +4 -0
  369. package/build/dist/Resources/Index.js.map +1 -0
  370. package/build/dist/Resources/Resource.js +74 -0
  371. package/build/dist/Resources/Resource.js.map +1 -0
  372. package/build/dist/Resources/Sound/AudioContext.js +16 -0
  373. package/build/dist/Resources/Sound/AudioContext.js.map +1 -0
  374. package/build/dist/Resources/Sound/Index.js +4 -0
  375. package/build/dist/Resources/Sound/Index.js.map +1 -0
  376. package/build/dist/Resources/Sound/Sound.js +240 -0
  377. package/build/dist/Resources/Sound/Sound.js.map +1 -0
  378. package/build/dist/Resources/Sound/WebAudioInstance.js +160 -0
  379. package/build/dist/Resources/Sound/WebAudioInstance.js.map +1 -0
  380. package/build/dist/Scene.js +458 -0
  381. package/build/dist/Scene.js.map +1 -0
  382. package/build/dist/Screen.js +634 -0
  383. package/build/dist/Screen.js.map +1 -0
  384. package/build/dist/ScreenElement.js +29 -0
  385. package/build/dist/ScreenElement.js.map +1 -0
  386. package/build/dist/TileMap.js +488 -0
  387. package/build/dist/TileMap.js.map +1 -0
  388. package/build/dist/Timer.js +198 -0
  389. package/build/dist/Timer.js.map +1 -0
  390. package/build/dist/Traits/Index.js +5 -0
  391. package/build/dist/Traits/Index.js.map +1 -0
  392. package/build/dist/Traits/OffscreenCulling.js +35 -0
  393. package/build/dist/Traits/OffscreenCulling.js.map +1 -0
  394. package/build/dist/Trigger.js +113 -0
  395. package/build/dist/Trigger.js.map +1 -0
  396. package/build/dist/Util/Actors.js +19 -0
  397. package/build/dist/Util/Actors.js.map +1 -0
  398. package/build/dist/Util/Browser.js +66 -0
  399. package/build/dist/Util/Browser.js.map +1 -0
  400. package/build/dist/Util/Clock.js +219 -0
  401. package/build/dist/Util/Clock.js.map +1 -0
  402. package/build/dist/Util/CullingBox.js +104 -0
  403. package/build/dist/Util/CullingBox.js.map +1 -0
  404. package/build/dist/Util/Decorators.js +78 -0
  405. package/build/dist/Util/Decorators.js.map +1 -0
  406. package/build/dist/Util/Detector.js +167 -0
  407. package/build/dist/Util/Detector.js.map +1 -0
  408. package/build/dist/Util/DrawUtil.js +117 -0
  409. package/build/dist/Util/DrawUtil.js.map +1 -0
  410. package/build/dist/Util/EasingFunctions.js +118 -0
  411. package/build/dist/Util/EasingFunctions.js.map +1 -0
  412. package/build/dist/Util/Fps.js +47 -0
  413. package/build/dist/Util/Fps.js.map +1 -0
  414. package/build/dist/Util/Index.js +7 -0
  415. package/build/dist/Util/Index.js.map +1 -0
  416. package/build/dist/Util/Log.js +195 -0
  417. package/build/dist/Util/Log.js.map +1 -0
  418. package/build/dist/Util/Observable.js +60 -0
  419. package/build/dist/Util/Observable.js.map +1 -0
  420. package/build/dist/Util/Pool.js +66 -0
  421. package/build/dist/Util/Pool.js.map +1 -0
  422. package/build/dist/Util/SortedList.js +261 -0
  423. package/build/dist/Util/SortedList.js.map +1 -0
  424. package/build/dist/Util/Sound.js +22 -0
  425. package/build/dist/Util/Sound.js.map +1 -0
  426. package/build/dist/Util/Util.js +294 -0
  427. package/build/dist/Util/Util.js.map +1 -0
  428. package/build/dist/Util/Watch.js +67 -0
  429. package/build/dist/Util/Watch.js.map +1 -0
  430. package/build/dist/Util/WebAudio.js +62 -0
  431. package/build/dist/Util/WebAudio.js.map +1 -0
  432. package/build/dist/excalibur.js +101 -22
  433. package/build/dist/excalibur.js.map +1 -1
  434. package/build/dist/excalibur.min.js +1 -1
  435. package/build/dist/excalibur.min.js.LICENSE.txt +1 -1
  436. package/build/dist/excalibur.min.js.map +1 -1
  437. package/build/dist/index.js +74 -0
  438. package/build/dist/index.js.map +1 -0
  439. package/build/esm/Engine.d.ts +4 -1
  440. package/build/esm/Graphics/Context/texture-loader.d.ts +8 -0
  441. package/build/esm/excalibur.js +101 -22
  442. package/build/esm/excalibur.js.map +1 -1
  443. package/build/esm/excalibur.min.js +1 -1
  444. package/build/esm/excalibur.min.js.LICENSE.txt +1 -1
  445. package/build/esm/excalibur.min.js.map +1 -1
  446. package/package.json +23 -22
@@ -0,0 +1,634 @@
1
+ import { Vector, vec } from './Math/vector';
2
+ import { Logger } from './Util/Log';
3
+ import { BoundingBox } from './Collision/Index';
4
+ import { getPosition } from './Util/Util';
5
+ import { ExcaliburGraphicsContextWebGL } from './Graphics/Context/ExcaliburGraphicsContextWebGL';
6
+ /**
7
+ * Enum representing the different display modes available to Excalibur.
8
+ */
9
+ export var DisplayMode;
10
+ (function (DisplayMode) {
11
+ /**
12
+ * Default, use a specified resolution for the game. Like 800x600 pixels for example.
13
+ */
14
+ DisplayMode["Fixed"] = "Fixed";
15
+ /**
16
+ * Fit to screen using as much space as possible while maintaining aspect ratio and resolution.
17
+ * This is not the same as [[Screen.goFullScreen]] but behaves in a similar way maintaining aspect ratio.
18
+ *
19
+ * You may want to center your game here is an example
20
+ * ```html
21
+ * <!-- html -->
22
+ * <body>
23
+ * <main>
24
+ * <canvas id="game"></canvas>
25
+ * </main>
26
+ * </body>
27
+ * ```
28
+ *
29
+ * ```css
30
+ * // css
31
+ * main {
32
+ * display: flex;
33
+ * align-items: center;
34
+ * justify-content: center;
35
+ * height: 100%;
36
+ * width: 100%;
37
+ * }
38
+ * ```
39
+ *
40
+ */
41
+ DisplayMode["FitScreen"] = "FitScreen";
42
+ /**
43
+ * Fill the entire screen's css width/height for the game resolution dynamically. This means the resolution of the game will
44
+ * change dynamically as the window is resized. This is not the same as [[Screen.goFullScreen]]
45
+ */
46
+ DisplayMode["FillScreen"] = "FillScreen";
47
+ /**
48
+ * Fit to parent element width/height using as much space as possible while maintaining aspect ratio and resolution.
49
+ */
50
+ DisplayMode["FitContainer"] = "FitContainer";
51
+ /**
52
+ * Use the parent DOM container's css width/height for the game resolution dynamically
53
+ */
54
+ DisplayMode["FillContainer"] = "FillContainer";
55
+ /**
56
+ * Allow the game to be positioned with the [[EngineOptions.position]] option
57
+ * @deprecated Use CSS to position the game canvas, will be removed in v0.26.0
58
+ */
59
+ DisplayMode["Position"] = "Position";
60
+ })(DisplayMode || (DisplayMode = {}));
61
+ /**
62
+ * Convenience class for quick resolutions
63
+ * Mostly sourced from https://emulation.gametechwiki.com/index.php/Resolution
64
+ */
65
+ export class Resolution {
66
+ /* istanbul ignore next */
67
+ static get SVGA() {
68
+ return { width: 800, height: 600 };
69
+ }
70
+ /* istanbul ignore next */
71
+ static get Standard() {
72
+ return { width: 1920, height: 1080 };
73
+ }
74
+ /* istanbul ignore next */
75
+ static get Atari2600() {
76
+ return { width: 160, height: 192 };
77
+ }
78
+ /* istanbul ignore next */
79
+ static get GameBoy() {
80
+ return { width: 160, height: 144 };
81
+ }
82
+ /* istanbul ignore next */
83
+ static get GameBoyAdvance() {
84
+ return { width: 240, height: 160 };
85
+ }
86
+ /* istanbul ignore next */
87
+ static get NintendoDS() {
88
+ return { width: 256, height: 192 };
89
+ }
90
+ /* istanbul ignore next */
91
+ static get NES() {
92
+ return { width: 256, height: 224 };
93
+ }
94
+ /* istanbul ignore next */
95
+ static get SNES() {
96
+ return { width: 256, height: 244 };
97
+ }
98
+ }
99
+ /**
100
+ * The Screen handles all aspects of interacting with the screen for Excalibur.
101
+ */
102
+ export class Screen {
103
+ constructor(options) {
104
+ var _a, _b, _c;
105
+ this._antialiasing = true;
106
+ this._resolutionStack = [];
107
+ this._viewportStack = [];
108
+ this._pixelRatioOverride = null;
109
+ this._isFullScreen = false;
110
+ this._isDisposed = false;
111
+ this._logger = Logger.getInstance();
112
+ this._fullscreenChangeHandler = () => {
113
+ this._isFullScreen = !this._isFullScreen;
114
+ this._logger.debug('Fullscreen Change', this._isFullScreen);
115
+ };
116
+ this._pixelRatioChangeHandler = () => {
117
+ this._logger.debug('Pixel Ratio Change', window.devicePixelRatio);
118
+ this._listenForPixelRatio();
119
+ this._devicePixelRatio = this._calculateDevicePixelRatio();
120
+ this.applyResolutionAndViewport();
121
+ };
122
+ this._resizeHandler = () => {
123
+ const parent = this.parent;
124
+ this._logger.debug('View port resized');
125
+ this._setResolutionAndViewportByDisplayMode(parent);
126
+ this.applyResolutionAndViewport();
127
+ };
128
+ // Asking the window.devicePixelRatio is expensive we do it once
129
+ this._devicePixelRatio = this._calculateDevicePixelRatio();
130
+ this._alreadyWarned = false;
131
+ this.viewport = options.viewport;
132
+ this.resolution = (_a = options.resolution) !== null && _a !== void 0 ? _a : { ...this.viewport };
133
+ this._displayMode = (_b = options.displayMode) !== null && _b !== void 0 ? _b : DisplayMode.Fixed;
134
+ this._canvas = options.canvas;
135
+ this.graphicsContext = options.context;
136
+ this._antialiasing = (_c = options.antialiasing) !== null && _c !== void 0 ? _c : this._antialiasing;
137
+ this._browser = options.browser;
138
+ this._position = options.position;
139
+ this._pixelRatioOverride = options.pixelRatio;
140
+ this._applyDisplayMode();
141
+ this._listenForPixelRatio();
142
+ this._canvas.addEventListener('fullscreenchange', this._fullscreenChangeHandler);
143
+ this.applyResolutionAndViewport();
144
+ }
145
+ _listenForPixelRatio() {
146
+ if (this._mediaQueryList && !this._mediaQueryList.addEventListener) {
147
+ // Safari <=13.1 workaround, remove any existing handlers
148
+ this._mediaQueryList.removeListener(this._pixelRatioChangeHandler);
149
+ }
150
+ this._mediaQueryList = this._browser.window.nativeComponent.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
151
+ // Safari <=13.1 workaround
152
+ if (this._mediaQueryList.addEventListener) {
153
+ this._mediaQueryList.addEventListener('change', this._pixelRatioChangeHandler, { once: true });
154
+ }
155
+ else {
156
+ this._mediaQueryList.addListener(this._pixelRatioChangeHandler);
157
+ }
158
+ }
159
+ dispose() {
160
+ if (!this._isDisposed) {
161
+ // Clean up handlers
162
+ this._isDisposed = true;
163
+ this._browser.window.off('resize', this._resizeHandler);
164
+ if (this._resizeObserver) {
165
+ this._resizeObserver.disconnect();
166
+ }
167
+ this.parent.removeEventListener('resize', this._resizeHandler);
168
+ // Safari <=13.1 workaround
169
+ if (this._mediaQueryList.removeEventListener) {
170
+ this._mediaQueryList.removeEventListener('change', this._pixelRatioChangeHandler);
171
+ }
172
+ else {
173
+ this._mediaQueryList.removeListener(this._pixelRatioChangeHandler);
174
+ }
175
+ this._canvas.removeEventListener('fullscreenchange', this._fullscreenChangeHandler);
176
+ }
177
+ }
178
+ _calculateDevicePixelRatio() {
179
+ if (window.devicePixelRatio < 1) {
180
+ return 1;
181
+ }
182
+ const devicePixelRatio = window.devicePixelRatio || 1;
183
+ return devicePixelRatio;
184
+ }
185
+ get pixelRatio() {
186
+ if (this._pixelRatioOverride) {
187
+ return this._pixelRatioOverride;
188
+ }
189
+ return this._devicePixelRatio;
190
+ }
191
+ get isHiDpi() {
192
+ return this.pixelRatio !== 1;
193
+ }
194
+ get displayMode() {
195
+ return this._displayMode;
196
+ }
197
+ get canvas() {
198
+ return this._canvas;
199
+ }
200
+ get parent() {
201
+ return ((this.displayMode === DisplayMode.FillContainer || this.displayMode === DisplayMode.FitContainer
202
+ ? this.canvas.parentElement || document.body
203
+ : window));
204
+ }
205
+ get resolution() {
206
+ return this._resolution;
207
+ }
208
+ set resolution(resolution) {
209
+ this._resolution = resolution;
210
+ }
211
+ get viewport() {
212
+ if (this._viewport) {
213
+ return this._viewport;
214
+ }
215
+ return this._resolution;
216
+ }
217
+ set viewport(viewport) {
218
+ this._viewport = viewport;
219
+ }
220
+ get aspectRatio() {
221
+ return this._resolution.width / this._resolution.height;
222
+ }
223
+ get scaledWidth() {
224
+ return this._resolution.width * this.pixelRatio;
225
+ }
226
+ get scaledHeight() {
227
+ return this._resolution.height * this.pixelRatio;
228
+ }
229
+ setCurrentCamera(camera) {
230
+ this._camera = camera;
231
+ }
232
+ pushResolutionAndViewport() {
233
+ this._resolutionStack.push(this.resolution);
234
+ this._viewportStack.push(this.viewport);
235
+ this.resolution = { ...this.resolution };
236
+ this.viewport = { ...this.viewport };
237
+ }
238
+ peekViewport() {
239
+ return this._viewportStack[this._viewportStack.length - 1];
240
+ }
241
+ peekResolution() {
242
+ return this._resolutionStack[this._resolutionStack.length - 1];
243
+ }
244
+ popResolutionAndViewport() {
245
+ this.resolution = this._resolutionStack.pop();
246
+ this.viewport = this._viewportStack.pop();
247
+ }
248
+ applyResolutionAndViewport() {
249
+ this._canvas.width = this.scaledWidth;
250
+ this._canvas.height = this.scaledHeight;
251
+ if (this.graphicsContext instanceof ExcaliburGraphicsContextWebGL) {
252
+ const supported = this.graphicsContext.checkIfResolutionSupported({
253
+ width: this.scaledWidth,
254
+ height: this.scaledHeight
255
+ });
256
+ if (!supported && !this._alreadyWarned) {
257
+ this._alreadyWarned = true; // warn once
258
+ this._logger.warn(`The currently configured resolution (${this.resolution.width}x${this.resolution.height})` +
259
+ ' is too large for the platform WebGL implementation, this may work but cause WebGL rendering to behave oddly.' +
260
+ ' Try reducing the resolution or disabling Hi DPI scaling to avoid this' +
261
+ ' (read more here https://excaliburjs.com/docs/screens#understanding-viewport--resolution).');
262
+ }
263
+ }
264
+ if (this._antialiasing) {
265
+ this._canvas.style.imageRendering = 'auto';
266
+ }
267
+ else {
268
+ this._canvas.style.imageRendering = 'pixelated';
269
+ // Fall back to 'crisp-edges' if 'pixelated' is not supported
270
+ // Currently for firefox https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering
271
+ if (this._canvas.style.imageRendering === '') {
272
+ this._canvas.style.imageRendering = 'crisp-edges';
273
+ }
274
+ }
275
+ this._canvas.style.width = this.viewport.width + 'px';
276
+ this._canvas.style.height = this.viewport.height + 'px';
277
+ // After messing with the canvas width/height the graphics context is invalidated and needs to have some properties reset
278
+ this.graphicsContext.updateViewport(this.resolution);
279
+ this.graphicsContext.resetTransform();
280
+ this.graphicsContext.smoothing = this._antialiasing;
281
+ }
282
+ get antialiasing() {
283
+ return this._antialiasing;
284
+ }
285
+ set antialiasing(isSmooth) {
286
+ this._antialiasing = isSmooth;
287
+ this.graphicsContext.smoothing = this._antialiasing;
288
+ }
289
+ /**
290
+ * Returns true if excalibur is fullscreen using the browser fullscreen api
291
+ */
292
+ get isFullScreen() {
293
+ return this._isFullScreen;
294
+ }
295
+ /**
296
+ * Requests to go fullscreen using the browser fullscreen api, requires user interaction to be successful.
297
+ * For example, wire this to a user click handler.
298
+ */
299
+ goFullScreen() {
300
+ return this._canvas.requestFullscreen();
301
+ }
302
+ /**
303
+ * Requests to exit fullscreen using the browser fullscreen api
304
+ */
305
+ exitFullScreen() {
306
+ return document.exitFullscreen();
307
+ }
308
+ /**
309
+ * Takes a coordinate in normal html page space, for example from a pointer move event, and translates it to
310
+ * Excalibur screen space.
311
+ *
312
+ * Excalibur screen space starts at the top left (0, 0) corner of the viewport, and extends to the
313
+ * bottom right corner (resolutionX, resolutionY)
314
+ * @param point
315
+ */
316
+ pageToScreenCoordinates(point) {
317
+ let newX = point.x;
318
+ let newY = point.y;
319
+ if (!this._isFullScreen) {
320
+ newX -= getPosition(this._canvas).x;
321
+ newY -= getPosition(this._canvas).y;
322
+ }
323
+ // if fullscreen api on it centers with black bars
324
+ // we need to adjust the screen to world coordinates in this case
325
+ if (this._isFullScreen) {
326
+ if (window.innerWidth / this.aspectRatio < window.innerHeight) {
327
+ const screenHeight = window.innerWidth / this.aspectRatio;
328
+ const screenMarginY = (window.innerHeight - screenHeight) / 2;
329
+ newY = ((newY - screenMarginY) / screenHeight) * this.viewport.height;
330
+ newX = (newX / window.innerWidth) * this.viewport.width;
331
+ }
332
+ else {
333
+ const screenWidth = window.innerHeight * this.aspectRatio;
334
+ const screenMarginX = (window.innerWidth - screenWidth) / 2;
335
+ newX = ((newX - screenMarginX) / screenWidth) * this.viewport.width;
336
+ newY = (newY / window.innerHeight) * this.viewport.height;
337
+ }
338
+ }
339
+ newX = (newX / this.viewport.width) * this.resolution.width;
340
+ newY = (newY / this.viewport.height) * this.resolution.height;
341
+ return new Vector(newX, newY);
342
+ }
343
+ /**
344
+ * Takes a coordinate in Excalibur screen space, and translates it to normal html page space. For example,
345
+ * this is where html elements might live if you want to position them relative to Excalibur.
346
+ *
347
+ * Excalibur screen space starts at the top left (0, 0) corner of the viewport, and extends to the
348
+ * bottom right corner (resolutionX, resolutionY)
349
+ * @param point
350
+ */
351
+ screenToPageCoordinates(point) {
352
+ let newX = point.x;
353
+ let newY = point.y;
354
+ newX = (newX / this.resolution.width) * this.viewport.width;
355
+ newY = (newY / this.resolution.height) * this.viewport.height;
356
+ if (this._isFullScreen) {
357
+ if (window.innerWidth / this.aspectRatio < window.innerHeight) {
358
+ const screenHeight = window.innerWidth / this.aspectRatio;
359
+ const screenMarginY = (window.innerHeight - screenHeight) / 2;
360
+ newY = (newY / this.viewport.height) * screenHeight + screenMarginY;
361
+ newX = (newX / this.viewport.width) * window.innerWidth;
362
+ }
363
+ else {
364
+ const screenWidth = window.innerHeight * this.aspectRatio;
365
+ const screenMarginX = (window.innerWidth - screenWidth) / 2;
366
+ newX = (newX / this.viewport.width) * screenWidth + screenMarginX;
367
+ newY = (newY / this.viewport.height) * window.innerHeight;
368
+ }
369
+ }
370
+ if (!this._isFullScreen) {
371
+ newX += getPosition(this._canvas).x;
372
+ newY += getPosition(this._canvas).y;
373
+ }
374
+ return new Vector(newX, newY);
375
+ }
376
+ /**
377
+ * Takes a coordinate in Excalibur screen space, and translates it to Excalibur world space.
378
+ *
379
+ * World space is where [[Entity|entities]] in Excalibur live by default [[CoordPlane.World]]
380
+ * and extends infinitely out relative from the [[Camera]].
381
+ * @param point Screen coordinate to convert
382
+ */
383
+ screenToWorldCoordinates(point) {
384
+ // the only difference between screen & world is the camera transform
385
+ if (this._camera) {
386
+ return this._camera.inverse.multv(point);
387
+ }
388
+ return point.sub(vec(this.resolution.width / 2, this.resolution.height / 2));
389
+ }
390
+ /**
391
+ * Takes a coordinate in Excalibur world space, and translates it to Excalibur screen space.
392
+ *
393
+ * Screen space is where [[ScreenElement|screen elements]] and [[Entity|entities]] with [[CoordPlane.Screen]] live.
394
+ * @param point World coordinate to convert
395
+ */
396
+ worldToScreenCoordinates(point) {
397
+ if (this._camera) {
398
+ return this._camera.transform.multv(point);
399
+ }
400
+ return point.add(vec(this.resolution.width / 2, this.resolution.height / 2));
401
+ }
402
+ pageToWorldCoordinates(point) {
403
+ const screen = this.pageToScreenCoordinates(point);
404
+ return this.screenToWorldCoordinates(screen);
405
+ }
406
+ worldToPageCoordinates(point) {
407
+ const screen = this.worldToScreenCoordinates(point);
408
+ return this.screenToPageCoordinates(screen);
409
+ }
410
+ /**
411
+ * Returns a BoundingBox of the top left corner of the screen
412
+ * and the bottom right corner of the screen.
413
+ *
414
+ * World bounds are in world coordinates, useful for culling objects offscreen
415
+ */
416
+ getWorldBounds() {
417
+ const topLeft = this.screenToWorldCoordinates(Vector.Zero);
418
+ const right = topLeft.x + this.drawWidth;
419
+ const bottom = topLeft.y + this.drawHeight;
420
+ return new BoundingBox(topLeft.x, topLeft.y, right, bottom);
421
+ }
422
+ /**
423
+ * The width of the game canvas in pixels (physical width component of the
424
+ * resolution of the canvas element)
425
+ */
426
+ get canvasWidth() {
427
+ return this.canvas.width;
428
+ }
429
+ /**
430
+ * Returns half width of the game canvas in pixels (half physical width component)
431
+ */
432
+ get halfCanvasWidth() {
433
+ return this.canvas.width / 2;
434
+ }
435
+ /**
436
+ * The height of the game canvas in pixels, (physical height component of
437
+ * the resolution of the canvas element)
438
+ */
439
+ get canvasHeight() {
440
+ return this.canvas.height;
441
+ }
442
+ /**
443
+ * Returns half height of the game canvas in pixels (half physical height component)
444
+ */
445
+ get halfCanvasHeight() {
446
+ return this.canvas.height / 2;
447
+ }
448
+ /**
449
+ * Returns the width of the engine's visible drawing surface in pixels including zoom and device pixel ratio.
450
+ */
451
+ get drawWidth() {
452
+ if (this._camera) {
453
+ return this.resolution.width / this._camera.zoom;
454
+ }
455
+ return this.resolution.width;
456
+ }
457
+ /**
458
+ * Returns half the width of the engine's visible drawing surface in pixels including zoom and device pixel ratio.
459
+ */
460
+ get halfDrawWidth() {
461
+ return this.drawWidth / 2;
462
+ }
463
+ /**
464
+ * Returns the height of the engine's visible drawing surface in pixels including zoom and device pixel ratio.
465
+ */
466
+ get drawHeight() {
467
+ if (this._camera) {
468
+ return this.resolution.height / this._camera.zoom;
469
+ }
470
+ return this.resolution.height;
471
+ }
472
+ /**
473
+ * Returns half the height of the engine's visible drawing surface in pixels including zoom and device pixel ratio.
474
+ */
475
+ get halfDrawHeight() {
476
+ return this.drawHeight / 2;
477
+ }
478
+ /**
479
+ * Returns screen center coordinates including zoom and device pixel ratio.
480
+ */
481
+ get center() {
482
+ return vec(this.halfDrawWidth, this.halfDrawHeight);
483
+ }
484
+ _computeFit() {
485
+ document.body.style.margin = '0px';
486
+ document.body.style.overflow = 'hidden';
487
+ const aspect = this.aspectRatio;
488
+ let adjustedWidth = 0;
489
+ let adjustedHeight = 0;
490
+ if (window.innerWidth / aspect < window.innerHeight) {
491
+ adjustedWidth = window.innerWidth;
492
+ adjustedHeight = window.innerWidth / aspect;
493
+ }
494
+ else {
495
+ adjustedWidth = window.innerHeight * aspect;
496
+ adjustedHeight = window.innerHeight;
497
+ }
498
+ this.viewport = {
499
+ width: adjustedWidth,
500
+ height: adjustedHeight
501
+ };
502
+ }
503
+ _computeFitContainer() {
504
+ const aspect = this.aspectRatio;
505
+ let adjustedWidth = 0;
506
+ let adjustedHeight = 0;
507
+ const parent = this.canvas.parentElement;
508
+ if (parent.clientWidth / aspect < parent.clientHeight) {
509
+ adjustedWidth = parent.clientWidth;
510
+ adjustedHeight = parent.clientWidth / aspect;
511
+ }
512
+ else {
513
+ adjustedWidth = parent.clientHeight * aspect;
514
+ adjustedHeight = parent.clientHeight;
515
+ }
516
+ this.viewport = {
517
+ width: adjustedWidth,
518
+ height: adjustedHeight
519
+ };
520
+ }
521
+ _applyDisplayMode() {
522
+ if (this.displayMode === DisplayMode.Position) {
523
+ this._initializeDisplayModePosition(this._position);
524
+ }
525
+ else {
526
+ this._setResolutionAndViewportByDisplayMode(this.parent);
527
+ // watch resizing
528
+ if (this.parent instanceof Window) {
529
+ this._browser.window.on('resize', this._resizeHandler);
530
+ }
531
+ else {
532
+ this._resizeObserver = new ResizeObserver(() => {
533
+ this._resizeHandler();
534
+ });
535
+ this._resizeObserver.observe(this.parent);
536
+ }
537
+ this.parent.addEventListener('resize', this._resizeHandler);
538
+ }
539
+ }
540
+ /**
541
+ * Sets the resolution and viewport based on the selected display mode.
542
+ */
543
+ _setResolutionAndViewportByDisplayMode(parent) {
544
+ if (this.displayMode === DisplayMode.FillContainer) {
545
+ this.resolution = {
546
+ width: parent.clientWidth,
547
+ height: parent.clientHeight
548
+ };
549
+ this.viewport = this.resolution;
550
+ }
551
+ if (this.displayMode === DisplayMode.FillScreen) {
552
+ document.body.style.margin = '0px';
553
+ document.body.style.overflow = 'hidden';
554
+ this.resolution = {
555
+ width: parent.innerWidth,
556
+ height: parent.innerHeight
557
+ };
558
+ this.viewport = this.resolution;
559
+ }
560
+ if (this.displayMode === DisplayMode.FitScreen) {
561
+ this._computeFit();
562
+ }
563
+ if (this.displayMode === DisplayMode.FitContainer) {
564
+ this._computeFitContainer();
565
+ }
566
+ }
567
+ _initializeDisplayModePosition(position) {
568
+ if (!position) {
569
+ throw new Error('DisplayMode of Position was selected but no position option was given');
570
+ }
571
+ else {
572
+ this.canvas.style.display = 'block';
573
+ this.canvas.style.position = 'absolute';
574
+ if (typeof position === 'string') {
575
+ const specifiedPosition = position.split(' ');
576
+ switch (specifiedPosition[0]) {
577
+ case 'top':
578
+ this.canvas.style.top = '0px';
579
+ break;
580
+ case 'bottom':
581
+ this.canvas.style.bottom = '0px';
582
+ break;
583
+ case 'middle':
584
+ this.canvas.style.top = '50%';
585
+ const offsetY = -this.halfDrawHeight;
586
+ this.canvas.style.marginTop = offsetY.toString();
587
+ break;
588
+ default:
589
+ throw new Error('Invalid Position Given');
590
+ }
591
+ if (specifiedPosition[1]) {
592
+ switch (specifiedPosition[1]) {
593
+ case 'left':
594
+ this.canvas.style.left = '0px';
595
+ break;
596
+ case 'right':
597
+ this.canvas.style.right = '0px';
598
+ break;
599
+ case 'center':
600
+ this.canvas.style.left = '50%';
601
+ const offsetX = -this.halfDrawWidth;
602
+ this.canvas.style.marginLeft = offsetX.toString();
603
+ break;
604
+ default:
605
+ throw new Error('Invalid Position Given');
606
+ }
607
+ }
608
+ }
609
+ else {
610
+ if (position.top) {
611
+ typeof position.top === 'number'
612
+ ? (this.canvas.style.top = position.top.toString() + 'px')
613
+ : (this.canvas.style.top = position.top);
614
+ }
615
+ if (position.right) {
616
+ typeof position.right === 'number'
617
+ ? (this.canvas.style.right = position.right.toString() + 'px')
618
+ : (this.canvas.style.right = position.right);
619
+ }
620
+ if (position.bottom) {
621
+ typeof position.bottom === 'number'
622
+ ? (this.canvas.style.bottom = position.bottom.toString() + 'px')
623
+ : (this.canvas.style.bottom = position.bottom);
624
+ }
625
+ if (position.left) {
626
+ typeof position.left === 'number'
627
+ ? (this.canvas.style.left = position.left.toString() + 'px')
628
+ : (this.canvas.style.left = position.left);
629
+ }
630
+ }
631
+ }
632
+ }
633
+ }
634
+ //# sourceMappingURL=Screen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../src/engine/Screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AAEjG;;GAEG;AACH,MAAM,CAAN,IAAY,WAuDX;AAvDD,WAAY,WAAW;IACrB;;OAEG;IACH,8BAAe,CAAA;IAEf;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,sCAAuB,CAAA;IAEvB;;;OAGG;IACH,wCAAyB,CAAA;IAEzB;;OAEG;IACH,4CAA6B,CAAA;IAE7B;;OAEG;IACH,8CAA+B,CAAA;IAE/B;;;OAGG;IACH,oCAAqB,CAAA;AACvB,CAAC,EAvDW,WAAW,KAAX,WAAW,QAuDtB;AAED;;;GAGG;AACH,MAAM,OAAO,UAAU;IACrB,0BAA0B;IACnB,MAAM,KAAK,IAAI;QACpB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACrC,CAAC;IAED,0BAA0B;IACnB,MAAM,KAAK,QAAQ;QACxB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE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