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.
- package/CHANGELOG.md +7 -2
- package/build/dist/Actions/Action/Blink.js +51 -0
- package/build/dist/Actions/Action/Blink.js.map +1 -0
- package/build/dist/Actions/Action/CallMethod.js +21 -0
- package/build/dist/Actions/Action/CallMethod.js.map +1 -0
- package/build/dist/Actions/Action/Delay.js +25 -0
- package/build/dist/Actions/Action/Delay.js.map +1 -0
- package/build/dist/Actions/Action/Die.js +22 -0
- package/build/dist/Actions/Action/Die.js.map +1 -0
- package/build/dist/Actions/Action/EaseTo.js +69 -0
- package/build/dist/Actions/Action/EaseTo.js.map +1 -0
- package/build/dist/Actions/Action/Fade.js +46 -0
- package/build/dist/Actions/Action/Fade.js.map +1 -0
- package/build/dist/Actions/Action/Follow.js +55 -0
- package/build/dist/Actions/Action/Follow.js.map +1 -0
- package/build/dist/Actions/Action/Meet.js +52 -0
- package/build/dist/Actions/Action/Meet.js.map +1 -0
- package/build/dist/Actions/Action/MoveBy.js +47 -0
- package/build/dist/Actions/Action/MoveBy.js.map +1 -0
- package/build/dist/Actions/Action/MoveTo.js +40 -0
- package/build/dist/Actions/Action/MoveTo.js.map +1 -0
- package/build/dist/Actions/Action/Repeat.js +31 -0
- package/build/dist/Actions/Action/Repeat.js.map +1 -0
- package/build/dist/Actions/Action/RepeatForever.js +37 -0
- package/build/dist/Actions/Action/RepeatForever.js.map +1 -0
- package/build/dist/Actions/Action/RotateBy.js +91 -0
- package/build/dist/Actions/Action/RotateBy.js.map +1 -0
- package/build/dist/Actions/Action/RotateTo.js +90 -0
- package/build/dist/Actions/Action/RotateTo.js.map +1 -0
- package/build/dist/Actions/Action/ScaleBy.js +45 -0
- package/build/dist/Actions/Action/ScaleBy.js.map +1 -0
- package/build/dist/Actions/Action/ScaleTo.js +56 -0
- package/build/dist/Actions/Action/ScaleTo.js.map +1 -0
- package/build/dist/Actions/Action.js +2 -0
- package/build/dist/Actions/Action.js.map +1 -0
- package/build/dist/Actions/ActionContext.js +305 -0
- package/build/dist/Actions/ActionContext.js.map +1 -0
- package/build/dist/Actions/ActionQueue.js +87 -0
- package/build/dist/Actions/ActionQueue.js.map +1 -0
- package/build/dist/Actions/Actionable.js +2 -0
- package/build/dist/Actions/Actionable.js.map +1 -0
- package/build/dist/Actions/ActionsComponent.js +198 -0
- package/build/dist/Actions/ActionsComponent.js.map +1 -0
- package/build/dist/Actions/ActionsSystem.js +18 -0
- package/build/dist/Actions/ActionsSystem.js.map +1 -0
- package/build/dist/Actions/Index.js +22 -0
- package/build/dist/Actions/Index.js.map +1 -0
- package/build/dist/Actions/RotationType.js +27 -0
- package/build/dist/Actions/RotationType.js.map +1 -0
- package/build/dist/Actor.js +831 -0
- package/build/dist/Actor.js.map +1 -0
- package/build/dist/Camera.js +663 -0
- package/build/dist/Camera.js.map +1 -0
- package/build/dist/Class.js +48 -0
- package/build/dist/Class.js.map +1 -0
- package/build/dist/Collision/BodyComponent.js +351 -0
- package/build/dist/Collision/BodyComponent.js.map +1 -0
- package/build/dist/Collision/BoundingBox.js +361 -0
- package/build/dist/Collision/BoundingBox.js.map +1 -0
- package/build/dist/Collision/ColliderComponent.js +198 -0
- package/build/dist/Collision/ColliderComponent.js.map +1 -0
- package/build/dist/Collision/Colliders/CircleCollider.js +264 -0
- package/build/dist/Collision/Colliders/CircleCollider.js.map +1 -0
- package/build/dist/Collision/Colliders/ClosestLineJumpTable.js +211 -0
- package/build/dist/Collision/Colliders/ClosestLineJumpTable.js.map +1 -0
- package/build/dist/Collision/Colliders/Collider.js +26 -0
- package/build/dist/Collision/Colliders/Collider.js.map +1 -0
- package/build/dist/Collision/Colliders/CollisionJumpTable.js +301 -0
- package/build/dist/Collision/Colliders/CollisionJumpTable.js.map +1 -0
- package/build/dist/Collision/Colliders/CompositeCollider.js +232 -0
- package/build/dist/Collision/Colliders/CompositeCollider.js.map +1 -0
- package/build/dist/Collision/Colliders/EdgeCollider.js +253 -0
- package/build/dist/Collision/Colliders/EdgeCollider.js.map +1 -0
- package/build/dist/Collision/Colliders/PolygonCollider.js +389 -0
- package/build/dist/Collision/Colliders/PolygonCollider.js.map +1 -0
- package/build/dist/Collision/Colliders/SeparatingAxis.js +67 -0
- package/build/dist/Collision/Colliders/SeparatingAxis.js.map +1 -0
- package/build/dist/Collision/Colliders/Shape.js +102 -0
- package/build/dist/Collision/Colliders/Shape.js.map +1 -0
- package/build/dist/Collision/CollisionSystem.js +116 -0
- package/build/dist/Collision/CollisionSystem.js.map +1 -0
- package/build/dist/Collision/CollisionType.js +33 -0
- package/build/dist/Collision/CollisionType.js.map +1 -0
- package/build/dist/Collision/Detection/CollisionContact.js +46 -0
- package/build/dist/Collision/Detection/CollisionContact.js.map +1 -0
- package/build/dist/Collision/Detection/CollisionProcessor.js +2 -0
- package/build/dist/Collision/Detection/CollisionProcessor.js.map +1 -0
- package/build/dist/Collision/Detection/DynamicTree.js +442 -0
- package/build/dist/Collision/Detection/DynamicTree.js.map +1 -0
- package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.js +211 -0
- package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.js.map +1 -0
- package/build/dist/Collision/Detection/Pair.js +92 -0
- package/build/dist/Collision/Detection/Pair.js.map +1 -0
- package/build/dist/Collision/Group/CollisionGroup.js +114 -0
- package/build/dist/Collision/Group/CollisionGroup.js.map +1 -0
- package/build/dist/Collision/Group/CollisionGroupManager.js +52 -0
- package/build/dist/Collision/Group/CollisionGroupManager.js.map +1 -0
- package/build/dist/Collision/Index.js +29 -0
- package/build/dist/Collision/Index.js.map +1 -0
- package/build/dist/Collision/Integrator.js +11 -0
- package/build/dist/Collision/Integrator.js.map +1 -0
- package/build/dist/Collision/MotionSystem.js +42 -0
- package/build/dist/Collision/MotionSystem.js.map +1 -0
- package/build/dist/Collision/Physics.js +163 -0
- package/build/dist/Collision/Physics.js.map +1 -0
- package/build/dist/Collision/Side.js +51 -0
- package/build/dist/Collision/Side.js.map +1 -0
- package/build/dist/Collision/Solver/ArcadeSolver.js +101 -0
- package/build/dist/Collision/Solver/ArcadeSolver.js.map +1 -0
- package/build/dist/Collision/Solver/ContactConstraintPoint.js +83 -0
- package/build/dist/Collision/Solver/ContactConstraintPoint.js.map +1 -0
- package/build/dist/Collision/Solver/RealisticSolver.js +248 -0
- package/build/dist/Collision/Solver/RealisticSolver.js.map +1 -0
- package/build/dist/Collision/Solver/Solver.js +37 -0
- package/build/dist/Collision/Solver/Solver.js.map +1 -0
- package/build/dist/Color.js +461 -0
- package/build/dist/Color.js.map +1 -0
- package/build/dist/Configurable.js +32 -0
- package/build/dist/Configurable.js.map +1 -0
- package/build/dist/Debug/Debug.js +375 -0
- package/build/dist/Debug/Debug.js.map +1 -0
- package/build/dist/Debug/DebugFlags.js +40 -0
- package/build/dist/Debug/DebugFlags.js.map +1 -0
- package/build/dist/Debug/DebugSystem.js +251 -0
- package/build/dist/Debug/DebugSystem.js.map +1 -0
- package/build/dist/Debug/index.js +4 -0
- package/build/dist/Debug/index.js.map +1 -0
- package/build/dist/Deprecated.js +2 -0
- package/build/dist/Deprecated.js.map +1 -0
- package/build/dist/Drawing/Animation.js +294 -0
- package/build/dist/Drawing/Animation.js.map +1 -0
- package/build/dist/Drawing/CanvasDrawComponent.js +16 -0
- package/build/dist/Drawing/CanvasDrawComponent.js.map +1 -0
- package/build/dist/Drawing/CanvasDrawingSystem.js +95 -0
- package/build/dist/Drawing/CanvasDrawingSystem.js.map +1 -0
- package/build/dist/Drawing/Index.js +10 -0
- package/build/dist/Drawing/Index.js.map +1 -0
- package/build/dist/Drawing/Polygon.js +139 -0
- package/build/dist/Drawing/Polygon.js.map +1 -0
- package/build/dist/Drawing/Sprite.js +355 -0
- package/build/dist/Drawing/Sprite.js.map +1 -0
- package/build/dist/Drawing/SpriteEffects.js +246 -0
- package/build/dist/Drawing/SpriteEffects.js.map +1 -0
- package/build/dist/Drawing/SpriteSheet.js +413 -0
- package/build/dist/Drawing/SpriteSheet.js.map +1 -0
- package/build/dist/Drawing/Texture.js +69 -0
- package/build/dist/Drawing/Texture.js.map +1 -0
- package/build/dist/Engine.d.ts +4 -1
- package/build/dist/Engine.js +985 -0
- package/build/dist/Engine.js.map +1 -0
- package/build/dist/EntityComponentSystem/Component.js +65 -0
- package/build/dist/EntityComponentSystem/Component.js.map +1 -0
- package/build/dist/EntityComponentSystem/Components/MotionComponent.js +33 -0
- package/build/dist/EntityComponentSystem/Components/MotionComponent.js.map +1 -0
- package/build/dist/EntityComponentSystem/Components/TransformComponent.js +249 -0
- package/build/dist/EntityComponentSystem/Components/TransformComponent.js.map +1 -0
- package/build/dist/EntityComponentSystem/Entity.js +452 -0
- package/build/dist/EntityComponentSystem/Entity.js.map +1 -0
- package/build/dist/EntityComponentSystem/EntityManager.js +128 -0
- package/build/dist/EntityComponentSystem/EntityManager.js.map +1 -0
- package/build/dist/EntityComponentSystem/Query.js +91 -0
- package/build/dist/EntityComponentSystem/Query.js.map +1 -0
- package/build/dist/EntityComponentSystem/QueryManager.js +90 -0
- package/build/dist/EntityComponentSystem/QueryManager.js.map +1 -0
- package/build/dist/EntityComponentSystem/System.js +76 -0
- package/build/dist/EntityComponentSystem/System.js.map +1 -0
- package/build/dist/EntityComponentSystem/SystemManager.js +102 -0
- package/build/dist/EntityComponentSystem/SystemManager.js.map +1 -0
- package/build/dist/EntityComponentSystem/Util.js +5 -0
- package/build/dist/EntityComponentSystem/Util.js.map +1 -0
- package/build/dist/EntityComponentSystem/World.js +55 -0
- package/build/dist/EntityComponentSystem/World.js.map +1 -0
- package/build/dist/EntityComponentSystem/index.js +11 -0
- package/build/dist/EntityComponentSystem/index.js.map +1 -0
- package/build/dist/EventDispatcher.js +114 -0
- package/build/dist/EventDispatcher.js.map +1 -0
- package/build/dist/Events/ExEvent.js +12 -0
- package/build/dist/Events/ExEvent.js.map +1 -0
- package/build/dist/Events/MediaEvents.js +75 -0
- package/build/dist/Events/MediaEvents.js.map +1 -0
- package/build/dist/Events/PointerEvents.js +52 -0
- package/build/dist/Events/PointerEvents.js.map +1 -0
- package/build/dist/Events.js +497 -0
- package/build/dist/Events.js.map +1 -0
- package/build/dist/Flags.js +90 -0
- package/build/dist/Flags.js.map +1 -0
- package/build/dist/Graphics/Animation.js +310 -0
- package/build/dist/Graphics/Animation.js.map +1 -0
- package/build/dist/Graphics/Canvas.js +38 -0
- package/build/dist/Graphics/Canvas.js.map +1 -0
- package/build/dist/Graphics/Circle.js +47 -0
- package/build/dist/Graphics/Circle.js.map +1 -0
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js +2 -0
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext.js.map +1 -0
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js +207 -0
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.js.map +1 -0
- package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js +331 -0
- package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.js.map +1 -0
- package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js +160 -0
- package/build/dist/Graphics/Context/circle-renderer/circle-renderer.js.map +1 -0
- package/build/dist/Graphics/Context/debug-text.js +47 -0
- package/build/dist/Graphics/Context/debug-text.js.map +1 -0
- package/build/dist/Graphics/Context/image-renderer/image-renderer.js +209 -0
- package/build/dist/Graphics/Context/image-renderer/image-renderer.js.map +1 -0
- package/build/dist/Graphics/Context/line-renderer/line-renderer.js +87 -0
- package/build/dist/Graphics/Context/line-renderer/line-renderer.js.map +1 -0
- package/build/dist/Graphics/Context/point-renderer/point-renderer.js +82 -0
- package/build/dist/Graphics/Context/point-renderer/point-renderer.js.map +1 -0
- package/build/dist/Graphics/Context/quad-index-buffer.js +69 -0
- package/build/dist/Graphics/Context/quad-index-buffer.js.map +1 -0
- package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js +272 -0
- package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.js.map +1 -0
- package/build/dist/Graphics/Context/render-source.js +16 -0
- package/build/dist/Graphics/Context/render-source.js.map +1 -0
- package/build/dist/Graphics/Context/render-target.js +65 -0
- package/build/dist/Graphics/Context/render-target.js.map +1 -0
- package/build/dist/Graphics/Context/renderer.js +2 -0
- package/build/dist/Graphics/Context/renderer.js.map +1 -0
- package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js +53 -0
- package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.js.map +1 -0
- package/build/dist/Graphics/Context/shader.js +236 -0
- package/build/dist/Graphics/Context/shader.js.map +1 -0
- package/build/dist/Graphics/Context/state-stack.js +27 -0
- package/build/dist/Graphics/Context/state-stack.js.map +1 -0
- package/build/dist/Graphics/Context/texture-loader.d.ts +8 -0
- package/build/dist/Graphics/Context/texture-loader.js +121 -0
- package/build/dist/Graphics/Context/texture-loader.js.map +1 -0
- package/build/dist/Graphics/Context/transform-stack.js +30 -0
- package/build/dist/Graphics/Context/transform-stack.js.map +1 -0
- package/build/dist/Graphics/Context/vertex-buffer.js +45 -0
- package/build/dist/Graphics/Context/vertex-buffer.js.map +1 -0
- package/build/dist/Graphics/Context/vertex-layout.js +93 -0
- package/build/dist/Graphics/Context/vertex-layout.js.map +1 -0
- package/build/dist/Graphics/Context/webgl-adapter.js +19 -0
- package/build/dist/Graphics/Context/webgl-adapter.js.map +1 -0
- package/build/dist/Graphics/Context/webgl-util.js +105 -0
- package/build/dist/Graphics/Context/webgl-util.js.map +1 -0
- package/build/dist/Graphics/DebugGraphicsComponent.js +15 -0
- package/build/dist/Graphics/DebugGraphicsComponent.js.map +1 -0
- package/build/dist/Graphics/Filtering.js +17 -0
- package/build/dist/Graphics/Filtering.js.map +1 -0
- package/build/dist/Graphics/Font.js +293 -0
- package/build/dist/Graphics/Font.js.map +1 -0
- package/build/dist/Graphics/FontCommon.js +109 -0
- package/build/dist/Graphics/FontCommon.js.map +1 -0
- package/build/dist/Graphics/Graphic.js +200 -0
- package/build/dist/Graphics/Graphic.js.map +1 -0
- package/build/dist/Graphics/GraphicsComponent.js +290 -0
- package/build/dist/Graphics/GraphicsComponent.js.map +1 -0
- package/build/dist/Graphics/GraphicsDiagnostics.js +9 -0
- package/build/dist/Graphics/GraphicsDiagnostics.js.map +1 -0
- package/build/dist/Graphics/GraphicsGroup.js +69 -0
- package/build/dist/Graphics/GraphicsGroup.js.map +1 -0
- package/build/dist/Graphics/GraphicsSystem.js +153 -0
- package/build/dist/Graphics/GraphicsSystem.js.map +1 -0
- package/build/dist/Graphics/ImageSource.js +116 -0
- package/build/dist/Graphics/ImageSource.js.map +1 -0
- package/build/dist/Graphics/Polygon.js +59 -0
- package/build/dist/Graphics/Polygon.js.map +1 -0
- package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js +7 -0
- package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.js.map +1 -0
- package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js +52 -0
- package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.js.map +1 -0
- package/build/dist/Graphics/PostProcessor/PostProcessor.js +2 -0
- package/build/dist/Graphics/PostProcessor/PostProcessor.js.map +1 -0
- package/build/dist/Graphics/PostProcessor/ScreenShader.js +56 -0
- package/build/dist/Graphics/PostProcessor/ScreenShader.js.map +1 -0
- package/build/dist/Graphics/Raster.js +207 -0
- package/build/dist/Graphics/Raster.js.map +1 -0
- package/build/dist/Graphics/Rectangle.js +29 -0
- package/build/dist/Graphics/Rectangle.js.map +1 -0
- package/build/dist/Graphics/Sprite.js +103 -0
- package/build/dist/Graphics/Sprite.js.map +1 -0
- package/build/dist/Graphics/SpriteFont.js +120 -0
- package/build/dist/Graphics/SpriteFont.js.map +1 -0
- package/build/dist/Graphics/SpriteSheet.js +115 -0
- package/build/dist/Graphics/SpriteSheet.js.map +1 -0
- package/build/dist/Graphics/Text.js +94 -0
- package/build/dist/Graphics/Text.js.map +1 -0
- package/build/dist/Graphics/index.js +42 -0
- package/build/dist/Graphics/index.js.map +1 -0
- package/build/dist/Id.js +8 -0
- package/build/dist/Id.js.map +1 -0
- package/build/dist/Input/CapturePointerConfig.js +5 -0
- package/build/dist/Input/CapturePointerConfig.js.map +1 -0
- package/build/dist/Input/EngineInput.js +2 -0
- package/build/dist/Input/EngineInput.js.map +1 -0
- package/build/dist/Input/Gamepad.js +358 -0
- package/build/dist/Input/Gamepad.js.map +1 -0
- package/build/dist/Input/Index.js +22 -0
- package/build/dist/Input/Index.js.map +1 -0
- package/build/dist/Input/Keyboard.js +267 -0
- package/build/dist/Input/Keyboard.js.map +1 -0
- package/build/dist/Input/NativePointerButton.js +12 -0
- package/build/dist/Input/NativePointerButton.js.map +1 -0
- package/build/dist/Input/PointerAbstraction.js +41 -0
- package/build/dist/Input/PointerAbstraction.js.map +1 -0
- package/build/dist/Input/PointerButton.js +12 -0
- package/build/dist/Input/PointerButton.js.map +1 -0
- package/build/dist/Input/PointerComponent.js +28 -0
- package/build/dist/Input/PointerComponent.js.map +1 -0
- package/build/dist/Input/PointerEvent.js +25 -0
- package/build/dist/Input/PointerEvent.js.map +1 -0
- package/build/dist/Input/PointerEventReceiver.js +414 -0
- package/build/dist/Input/PointerEventReceiver.js.map +1 -0
- package/build/dist/Input/PointerScope.js +16 -0
- package/build/dist/Input/PointerScope.js.map +1 -0
- package/build/dist/Input/PointerSystem.js +217 -0
- package/build/dist/Input/PointerSystem.js.map +1 -0
- package/build/dist/Input/PointerType.js +11 -0
- package/build/dist/Input/PointerType.js.map +1 -0
- package/build/dist/Input/WheelDeltaMode.js +7 -0
- package/build/dist/Input/WheelDeltaMode.js.map +1 -0
- package/build/dist/Input/WheelEvent.js +21 -0
- package/build/dist/Input/WheelEvent.js.map +1 -0
- package/build/dist/Interfaces/Audio.js +2 -0
- package/build/dist/Interfaces/Audio.js.map +1 -0
- package/build/dist/Interfaces/AudioImplementation.js +11 -0
- package/build/dist/Interfaces/AudioImplementation.js.map +1 -0
- package/build/dist/Interfaces/Clonable.js +2 -0
- package/build/dist/Interfaces/Clonable.js.map +1 -0
- package/build/dist/Interfaces/Drawable.js +2 -0
- package/build/dist/Interfaces/Drawable.js.map +1 -0
- package/build/dist/Interfaces/Evented.js +2 -0
- package/build/dist/Interfaces/Evented.js.map +1 -0
- package/build/dist/Interfaces/Index.js +10 -0
- package/build/dist/Interfaces/Index.js.map +1 -0
- package/build/dist/Interfaces/LifecycleEvents.js +51 -0
- package/build/dist/Interfaces/LifecycleEvents.js.map +1 -0
- package/build/dist/Interfaces/Loadable.js +2 -0
- package/build/dist/Interfaces/Loadable.js.map +1 -0
- package/build/dist/Interfaces/PointerEventHandlers.js +2 -0
- package/build/dist/Interfaces/PointerEventHandlers.js.map +1 -0
- package/build/dist/Interfaces/Trait.js +2 -0
- package/build/dist/Interfaces/Trait.js.map +1 -0
- package/build/dist/Label.js +273 -0
- package/build/dist/Label.js.map +1 -0
- package/build/dist/Loader.js +367 -0
- package/build/dist/Loader.js.map +1 -0
- package/build/dist/Math/Index.js +10 -0
- package/build/dist/Math/Index.js.map +1 -0
- package/build/dist/Math/Random.js +239 -0
- package/build/dist/Math/Random.js.map +1 -0
- package/build/dist/Math/global-coordinates.js +30 -0
- package/build/dist/Math/global-coordinates.js.map +1 -0
- package/build/dist/Math/line.js +194 -0
- package/build/dist/Math/line.js.map +1 -0
- package/build/dist/Math/matrix.js +446 -0
- package/build/dist/Math/matrix.js.map +1 -0
- package/build/dist/Math/projection.js +24 -0
- package/build/dist/Math/projection.js.map +1 -0
- package/build/dist/Math/ray.js +52 -0
- package/build/dist/Math/ray.js.map +1 -0
- package/build/dist/Math/util.js +82 -0
- package/build/dist/Math/util.js.map +1 -0
- package/build/dist/Math/vector-view.js +25 -0
- package/build/dist/Math/vector-view.js.map +1 -0
- package/build/dist/Math/vector.js +326 -0
- package/build/dist/Math/vector.js.map +1 -0
- package/build/dist/Particles.js +449 -0
- package/build/dist/Particles.js.map +1 -0
- package/build/dist/Polyfill.js +56 -0
- package/build/dist/Polyfill.js.map +1 -0
- package/build/dist/Promises.js +205 -0
- package/build/dist/Promises.js.map +1 -0
- package/build/dist/Resources/Gif.js +479 -0
- package/build/dist/Resources/Gif.js.map +1 -0
- package/build/dist/Resources/Index.js +4 -0
- package/build/dist/Resources/Index.js.map +1 -0
- package/build/dist/Resources/Resource.js +74 -0
- package/build/dist/Resources/Resource.js.map +1 -0
- package/build/dist/Resources/Sound/AudioContext.js +16 -0
- package/build/dist/Resources/Sound/AudioContext.js.map +1 -0
- package/build/dist/Resources/Sound/Index.js +4 -0
- package/build/dist/Resources/Sound/Index.js.map +1 -0
- package/build/dist/Resources/Sound/Sound.js +240 -0
- package/build/dist/Resources/Sound/Sound.js.map +1 -0
- package/build/dist/Resources/Sound/WebAudioInstance.js +160 -0
- package/build/dist/Resources/Sound/WebAudioInstance.js.map +1 -0
- package/build/dist/Scene.js +458 -0
- package/build/dist/Scene.js.map +1 -0
- package/build/dist/Screen.js +634 -0
- package/build/dist/Screen.js.map +1 -0
- package/build/dist/ScreenElement.js +29 -0
- package/build/dist/ScreenElement.js.map +1 -0
- package/build/dist/TileMap.js +488 -0
- package/build/dist/TileMap.js.map +1 -0
- package/build/dist/Timer.js +198 -0
- package/build/dist/Timer.js.map +1 -0
- package/build/dist/Traits/Index.js +5 -0
- package/build/dist/Traits/Index.js.map +1 -0
- package/build/dist/Traits/OffscreenCulling.js +35 -0
- package/build/dist/Traits/OffscreenCulling.js.map +1 -0
- package/build/dist/Trigger.js +113 -0
- package/build/dist/Trigger.js.map +1 -0
- package/build/dist/Util/Actors.js +19 -0
- package/build/dist/Util/Actors.js.map +1 -0
- package/build/dist/Util/Browser.js +66 -0
- package/build/dist/Util/Browser.js.map +1 -0
- package/build/dist/Util/Clock.js +219 -0
- package/build/dist/Util/Clock.js.map +1 -0
- package/build/dist/Util/CullingBox.js +104 -0
- package/build/dist/Util/CullingBox.js.map +1 -0
- package/build/dist/Util/Decorators.js +78 -0
- package/build/dist/Util/Decorators.js.map +1 -0
- package/build/dist/Util/Detector.js +167 -0
- package/build/dist/Util/Detector.js.map +1 -0
- package/build/dist/Util/DrawUtil.js +117 -0
- package/build/dist/Util/DrawUtil.js.map +1 -0
- package/build/dist/Util/EasingFunctions.js +118 -0
- package/build/dist/Util/EasingFunctions.js.map +1 -0
- package/build/dist/Util/Fps.js +47 -0
- package/build/dist/Util/Fps.js.map +1 -0
- package/build/dist/Util/Index.js +7 -0
- package/build/dist/Util/Index.js.map +1 -0
- package/build/dist/Util/Log.js +195 -0
- package/build/dist/Util/Log.js.map +1 -0
- package/build/dist/Util/Observable.js +60 -0
- package/build/dist/Util/Observable.js.map +1 -0
- package/build/dist/Util/Pool.js +66 -0
- package/build/dist/Util/Pool.js.map +1 -0
- package/build/dist/Util/SortedList.js +261 -0
- package/build/dist/Util/SortedList.js.map +1 -0
- package/build/dist/Util/Sound.js +22 -0
- package/build/dist/Util/Sound.js.map +1 -0
- package/build/dist/Util/Util.js +294 -0
- package/build/dist/Util/Util.js.map +1 -0
- package/build/dist/Util/Watch.js +67 -0
- package/build/dist/Util/Watch.js.map +1 -0
- package/build/dist/Util/WebAudio.js +62 -0
- package/build/dist/Util/WebAudio.js.map +1 -0
- package/build/dist/excalibur.js +101 -22
- package/build/dist/excalibur.js.map +1 -1
- package/build/dist/excalibur.min.js +1 -1
- package/build/dist/excalibur.min.js.LICENSE.txt +1 -1
- package/build/dist/excalibur.min.js.map +1 -1
- package/build/dist/index.js +74 -0
- package/build/dist/index.js.map +1 -0
- package/build/esm/Engine.d.ts +4 -1
- package/build/esm/Graphics/Context/texture-loader.d.ts +8 -0
- package/build/esm/excalibur.js +101 -22
- package/build/esm/excalibur.js.map +1 -1
- package/build/esm/excalibur.min.js +1 -1
- package/build/esm/excalibur.min.js.LICENSE.txt +1 -1
- package/build/esm/excalibur.min.js.map +1 -1
- package/package.json +23 -22
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { ColorBlindFlags } from './DebugFlags';
|
|
2
|
+
import { Color } from '../Color';
|
|
3
|
+
/**
|
|
4
|
+
* Debug statistics and flags for Excalibur. If polling these values, it would be
|
|
5
|
+
* best to do so on the `postupdate` event for [[Engine]], after all values have been
|
|
6
|
+
* updated during a frame.
|
|
7
|
+
*/
|
|
8
|
+
export class Debug {
|
|
9
|
+
constructor(engine) {
|
|
10
|
+
/**
|
|
11
|
+
* Performance statistics
|
|
12
|
+
*/
|
|
13
|
+
this.stats = {
|
|
14
|
+
/**
|
|
15
|
+
* Current frame statistics. Engine reuses this instance, use [[FrameStats.clone]] to copy frame stats.
|
|
16
|
+
* Best accessed on [[postframe]] event. See [[FrameStats]]
|
|
17
|
+
*/
|
|
18
|
+
currFrame: new FrameStats(),
|
|
19
|
+
/**
|
|
20
|
+
* Previous frame statistics. Engine reuses this instance, use [[FrameStats.clone]] to copy frame stats.
|
|
21
|
+
* Best accessed on [[preframe]] event. Best inspected on engine event `preframe`. See [[FrameStats]]
|
|
22
|
+
*/
|
|
23
|
+
prevFrame: new FrameStats()
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Filter debug context to named entities or entity ids
|
|
27
|
+
*/
|
|
28
|
+
this.filter = {
|
|
29
|
+
/**
|
|
30
|
+
* Toggle filter on or off (default off) must be on for DebugDraw to use filters
|
|
31
|
+
*/
|
|
32
|
+
useFilter: false,
|
|
33
|
+
/**
|
|
34
|
+
* Query for entities by name, if the entity name contains `nameQuery` it will be included
|
|
35
|
+
*/
|
|
36
|
+
nameQuery: '',
|
|
37
|
+
/**
|
|
38
|
+
* Query for Entity ids, if the id matches it will be included
|
|
39
|
+
*/
|
|
40
|
+
ids: []
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Entity debug settings
|
|
44
|
+
*/
|
|
45
|
+
this.entity = {
|
|
46
|
+
showAll: false,
|
|
47
|
+
showId: true,
|
|
48
|
+
showName: false
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Transform component debug settings
|
|
52
|
+
*/
|
|
53
|
+
this.transform = {
|
|
54
|
+
showAll: false,
|
|
55
|
+
showPosition: false,
|
|
56
|
+
showPositionLabel: false,
|
|
57
|
+
positionColor: Color.Yellow,
|
|
58
|
+
showScale: false,
|
|
59
|
+
scaleColor: Color.Green,
|
|
60
|
+
showRotation: false,
|
|
61
|
+
rotationColor: Color.Blue
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Graphics component debug settings
|
|
65
|
+
*/
|
|
66
|
+
this.graphics = {
|
|
67
|
+
showAll: false,
|
|
68
|
+
showBounds: true,
|
|
69
|
+
boundsColor: Color.Yellow
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Collider component debug settings
|
|
73
|
+
*/
|
|
74
|
+
this.collider = {
|
|
75
|
+
showAll: false,
|
|
76
|
+
showBounds: true,
|
|
77
|
+
boundsColor: Color.Blue,
|
|
78
|
+
showOwner: false,
|
|
79
|
+
showGeometry: true,
|
|
80
|
+
geometryColor: Color.Green
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Physics simulation debug settings
|
|
84
|
+
*/
|
|
85
|
+
this.physics = {
|
|
86
|
+
showAll: false,
|
|
87
|
+
showBroadphaseSpacePartitionDebug: false,
|
|
88
|
+
showCollisionNormals: false,
|
|
89
|
+
collisionNormalColor: Color.Cyan,
|
|
90
|
+
showCollisionContacts: true,
|
|
91
|
+
collisionContactColor: Color.Red
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Motion component debug settings
|
|
95
|
+
*/
|
|
96
|
+
this.motion = {
|
|
97
|
+
showAll: false,
|
|
98
|
+
showVelocity: false,
|
|
99
|
+
velocityColor: Color.Yellow,
|
|
100
|
+
showAcceleration: false,
|
|
101
|
+
accelerationColor: Color.Red
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Body component debug settings
|
|
105
|
+
*/
|
|
106
|
+
this.body = {
|
|
107
|
+
showAll: false,
|
|
108
|
+
showCollisionGroup: false,
|
|
109
|
+
showCollisionType: false,
|
|
110
|
+
showSleeping: false,
|
|
111
|
+
showMotion: false,
|
|
112
|
+
showMass: false
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Camera debug settings
|
|
116
|
+
*/
|
|
117
|
+
this.camera = {
|
|
118
|
+
showAll: false,
|
|
119
|
+
showFocus: false,
|
|
120
|
+
focusColor: Color.Red,
|
|
121
|
+
showZoom: false
|
|
122
|
+
};
|
|
123
|
+
this._engine = engine;
|
|
124
|
+
this.colorBlindMode = new ColorBlindFlags(this._engine);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Switch the current excalibur clock with the [[TestClock]] and return
|
|
128
|
+
* it in the same running state.
|
|
129
|
+
*
|
|
130
|
+
* This is useful when you need to debug frame by frame.
|
|
131
|
+
*/
|
|
132
|
+
useTestClock() {
|
|
133
|
+
const clock = this._engine.clock;
|
|
134
|
+
const wasRunning = clock.isRunning();
|
|
135
|
+
clock.stop();
|
|
136
|
+
const testClock = clock.toTestClock();
|
|
137
|
+
if (wasRunning) {
|
|
138
|
+
testClock.start();
|
|
139
|
+
}
|
|
140
|
+
this._engine.clock = testClock;
|
|
141
|
+
return testClock;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Switch the current excalibur clock with the [[StandardClock]] and
|
|
145
|
+
* return it in the same running state.
|
|
146
|
+
*
|
|
147
|
+
* This is useful when you need to switch back to normal mode after
|
|
148
|
+
* debugging.
|
|
149
|
+
*/
|
|
150
|
+
useStandardClock() {
|
|
151
|
+
const currentClock = this._engine.clock;
|
|
152
|
+
const wasRunning = currentClock.isRunning();
|
|
153
|
+
currentClock.stop();
|
|
154
|
+
const standardClock = currentClock.toStandardClock();
|
|
155
|
+
if (wasRunning) {
|
|
156
|
+
standardClock.start();
|
|
157
|
+
}
|
|
158
|
+
this._engine.clock = standardClock;
|
|
159
|
+
return standardClock;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Implementation of a frame's stats. Meant to have values copied via [[FrameStats.reset]], avoid
|
|
164
|
+
* creating instances of this every frame.
|
|
165
|
+
*/
|
|
166
|
+
export class FrameStats {
|
|
167
|
+
constructor() {
|
|
168
|
+
this._id = 0;
|
|
169
|
+
this._delta = 0;
|
|
170
|
+
this._fps = 0;
|
|
171
|
+
this._actorStats = {
|
|
172
|
+
alive: 0,
|
|
173
|
+
killed: 0,
|
|
174
|
+
ui: 0,
|
|
175
|
+
get remaining() {
|
|
176
|
+
return this.alive - this.killed;
|
|
177
|
+
},
|
|
178
|
+
get total() {
|
|
179
|
+
return this.remaining + this.ui;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
this._durationStats = {
|
|
183
|
+
update: 0,
|
|
184
|
+
draw: 0,
|
|
185
|
+
get total() {
|
|
186
|
+
return this.update + this.draw;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
this._physicsStats = new PhysicsStats();
|
|
190
|
+
this._graphicsStats = {
|
|
191
|
+
drawCalls: 0,
|
|
192
|
+
drawnImages: 0
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Zero out values or clone other IFrameStat stats. Allows instance reuse.
|
|
197
|
+
*
|
|
198
|
+
* @param [otherStats] Optional stats to clone
|
|
199
|
+
*/
|
|
200
|
+
reset(otherStats) {
|
|
201
|
+
if (otherStats) {
|
|
202
|
+
this.id = otherStats.id;
|
|
203
|
+
this.delta = otherStats.delta;
|
|
204
|
+
this.fps = otherStats.fps;
|
|
205
|
+
this.actors.alive = otherStats.actors.alive;
|
|
206
|
+
this.actors.killed = otherStats.actors.killed;
|
|
207
|
+
this.actors.ui = otherStats.actors.ui;
|
|
208
|
+
this.duration.update = otherStats.duration.update;
|
|
209
|
+
this.duration.draw = otherStats.duration.draw;
|
|
210
|
+
this._physicsStats.reset(otherStats.physics);
|
|
211
|
+
this.graphics.drawCalls = otherStats.graphics.drawCalls;
|
|
212
|
+
this.graphics.drawnImages = otherStats.graphics.drawnImages;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
this.id = this.delta = this.fps = 0;
|
|
216
|
+
this.actors.alive = this.actors.killed = this.actors.ui = 0;
|
|
217
|
+
this.duration.update = this.duration.draw = 0;
|
|
218
|
+
this._physicsStats.reset();
|
|
219
|
+
this.graphics.drawnImages = this.graphics.drawCalls = 0;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Provides a clone of this instance.
|
|
224
|
+
*/
|
|
225
|
+
clone() {
|
|
226
|
+
const fs = new FrameStats();
|
|
227
|
+
fs.reset(this);
|
|
228
|
+
return fs;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Gets the frame's id
|
|
232
|
+
*/
|
|
233
|
+
get id() {
|
|
234
|
+
return this._id;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Sets the frame's id
|
|
238
|
+
*/
|
|
239
|
+
set id(value) {
|
|
240
|
+
this._id = value;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Gets the frame's delta (time since last frame)
|
|
244
|
+
*/
|
|
245
|
+
get delta() {
|
|
246
|
+
return this._delta;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Sets the frame's delta (time since last frame). Internal use only.
|
|
250
|
+
* @internal
|
|
251
|
+
*/
|
|
252
|
+
set delta(value) {
|
|
253
|
+
this._delta = value;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Gets the frame's frames-per-second (FPS)
|
|
257
|
+
*/
|
|
258
|
+
get fps() {
|
|
259
|
+
return this._fps;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Sets the frame's frames-per-second (FPS). Internal use only.
|
|
263
|
+
* @internal
|
|
264
|
+
*/
|
|
265
|
+
set fps(value) {
|
|
266
|
+
this._fps = value;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Gets the frame's actor statistics
|
|
270
|
+
*/
|
|
271
|
+
get actors() {
|
|
272
|
+
return this._actorStats;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Gets the frame's duration statistics
|
|
276
|
+
*/
|
|
277
|
+
get duration() {
|
|
278
|
+
return this._durationStats;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Gets the frame's physics statistics
|
|
282
|
+
*/
|
|
283
|
+
get physics() {
|
|
284
|
+
return this._physicsStats;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Gets the frame's graphics statistics
|
|
288
|
+
*/
|
|
289
|
+
get graphics() {
|
|
290
|
+
return this._graphicsStats;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
export class PhysicsStats {
|
|
294
|
+
constructor() {
|
|
295
|
+
this._pairs = 0;
|
|
296
|
+
this._collisions = 0;
|
|
297
|
+
this._contacts = new Map();
|
|
298
|
+
this._fastBodies = 0;
|
|
299
|
+
this._fastBodyCollisions = 0;
|
|
300
|
+
this._broadphase = 0;
|
|
301
|
+
this._narrowphase = 0;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Zero out values or clone other IPhysicsStats stats. Allows instance reuse.
|
|
305
|
+
*
|
|
306
|
+
* @param [otherStats] Optional stats to clone
|
|
307
|
+
*/
|
|
308
|
+
reset(otherStats) {
|
|
309
|
+
if (otherStats) {
|
|
310
|
+
this.pairs = otherStats.pairs;
|
|
311
|
+
this.collisions = otherStats.collisions;
|
|
312
|
+
this.contacts = otherStats.contacts;
|
|
313
|
+
this.fastBodies = otherStats.fastBodies;
|
|
314
|
+
this.fastBodyCollisions = otherStats.fastBodyCollisions;
|
|
315
|
+
this.broadphase = otherStats.broadphase;
|
|
316
|
+
this.narrowphase = otherStats.narrowphase;
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
this.pairs = this.collisions = this.fastBodies = 0;
|
|
320
|
+
this.fastBodyCollisions = this.broadphase = this.narrowphase = 0;
|
|
321
|
+
this.contacts.clear();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Provides a clone of this instance.
|
|
326
|
+
*/
|
|
327
|
+
clone() {
|
|
328
|
+
const ps = new PhysicsStats();
|
|
329
|
+
ps.reset(this);
|
|
330
|
+
return ps;
|
|
331
|
+
}
|
|
332
|
+
get pairs() {
|
|
333
|
+
return this._pairs;
|
|
334
|
+
}
|
|
335
|
+
set pairs(value) {
|
|
336
|
+
this._pairs = value;
|
|
337
|
+
}
|
|
338
|
+
get collisions() {
|
|
339
|
+
return this._collisions;
|
|
340
|
+
}
|
|
341
|
+
set collisions(value) {
|
|
342
|
+
this._collisions = value;
|
|
343
|
+
}
|
|
344
|
+
get contacts() {
|
|
345
|
+
return this._contacts;
|
|
346
|
+
}
|
|
347
|
+
set contacts(contacts) {
|
|
348
|
+
this._contacts = contacts;
|
|
349
|
+
}
|
|
350
|
+
get fastBodies() {
|
|
351
|
+
return this._fastBodies;
|
|
352
|
+
}
|
|
353
|
+
set fastBodies(value) {
|
|
354
|
+
this._fastBodies = value;
|
|
355
|
+
}
|
|
356
|
+
get fastBodyCollisions() {
|
|
357
|
+
return this._fastBodyCollisions;
|
|
358
|
+
}
|
|
359
|
+
set fastBodyCollisions(value) {
|
|
360
|
+
this._fastBodyCollisions = value;
|
|
361
|
+
}
|
|
362
|
+
get broadphase() {
|
|
363
|
+
return this._broadphase;
|
|
364
|
+
}
|
|
365
|
+
set broadphase(value) {
|
|
366
|
+
this._broadphase = value;
|
|
367
|
+
}
|
|
368
|
+
get narrowphase() {
|
|
369
|
+
return this._narrowphase;
|
|
370
|
+
}
|
|
371
|
+
set narrowphase(value) {
|
|
372
|
+
this._narrowphase = value;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
//# sourceMappingURL=Debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Debug.js","sourceRoot":"","sources":["../../../src/engine/Debug/Debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,eAAe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AC;IACxB,CAAC;IAED,IAAW,QAAQ,CAAC,QAAuC;QACzD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED,IAAW,kBAAkB,CAAC,KAAa;QACzC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACnC,CAAC;IAED,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAW,WAAW,CAAC,KAAa;QAClC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ColorBlindnessMode } from '../Graphics/PostProcessor/ColorBlindnessMode';
|
|
2
|
+
import { ColorBlindnessPostProcessor } from '../Graphics/PostProcessor/ColorBlindnessPostProcessor';
|
|
3
|
+
import { ExcaliburGraphicsContextWebGL } from '..';
|
|
4
|
+
export class ColorBlindFlags {
|
|
5
|
+
constructor(engine) {
|
|
6
|
+
this._engine = engine;
|
|
7
|
+
this._colorBlindPostProcessor = new ColorBlindnessPostProcessor(ColorBlindnessMode.Protanope);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Correct colors for a specified color blindness
|
|
11
|
+
* @param colorBlindness
|
|
12
|
+
*/
|
|
13
|
+
correct(colorBlindness) {
|
|
14
|
+
if (this._engine.graphicsContext instanceof ExcaliburGraphicsContextWebGL) {
|
|
15
|
+
this.clear();
|
|
16
|
+
this._colorBlindPostProcessor.colorBlindnessMode = colorBlindness;
|
|
17
|
+
this._colorBlindPostProcessor.simulate = false;
|
|
18
|
+
this._engine.graphicsContext.addPostProcessor(this._colorBlindPostProcessor);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Simulate colors for a specified color blindness
|
|
23
|
+
* @param colorBlindness
|
|
24
|
+
*/
|
|
25
|
+
simulate(colorBlindness) {
|
|
26
|
+
if (this._engine.graphicsContext instanceof ExcaliburGraphicsContextWebGL) {
|
|
27
|
+
this.clear();
|
|
28
|
+
this._colorBlindPostProcessor.colorBlindnessMode = colorBlindness;
|
|
29
|
+
this._colorBlindPostProcessor.simulate = true;
|
|
30
|
+
this._engine.graphicsContext.addPostProcessor(this._colorBlindPostProcessor);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Remove color blindness post processor
|
|
35
|
+
*/
|
|
36
|
+
clear() {
|
|
37
|
+
this._engine.graphicsContext.removePostProcessor(this._colorBlindPostProcessor);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=DebugFlags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DebugFlags.js","sourceRoot":"","sources":["../../../src/engine/Debug/DebugFlags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AAEpG,OAAO,EAAE,6BAA6B,EAAE,MAAM,IAAI,CAAC;AAMnD,MAAM,OAAO,eAAe;IAI1B,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,wBAAwB,GAAG,IAAI,2BAA2B,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAChG,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,cAAkC;QAC/C,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,YAAY,6BAA6B,EAAE;YACzE,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,wBAAwB,CAAC,kBAAkB,GAAG,cAAc,CAAC;YAClE,IAAI,CAAC,wBAAwB,CAAC,QAAQ,GAAG,KAAK,CAAC;YAC/C,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,gBAAgB,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;SAC9E;IACH,CAAC;IAED;;;OAGG;IACI,QAAQ,CAAC,cAAkC;QAChD,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,YAAY,6BAA6B,EAAE;YACzE,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,wBAAwB,CAAC,kBAAkB,GAAG,cAAc,CAAC;YAClE,IAAI,CAAC,wBAAwB,CAAC,QAAQ,GAAG,IAAI,CAAC;YAC9C,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,gBAAgB,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;SAC9E;IACH,CAAC;IAED;;OAEG;IACI,KAAK;QACV,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,mBAAmB,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IAClF,CAAC;CACF"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { MotionComponent } from '../EntityComponentSystem/Components/MotionComponent';
|
|
2
|
+
import { ColliderComponent } from '../Collision/ColliderComponent';
|
|
3
|
+
import { CoordPlane, TransformComponent } from '../EntityComponentSystem';
|
|
4
|
+
import { System, SystemType } from '../EntityComponentSystem/System';
|
|
5
|
+
import { vec, Vector } from '../Math/vector';
|
|
6
|
+
import { toDegrees } from '../Math/util';
|
|
7
|
+
import { BodyComponent, CollisionSystem, CompositeCollider, GraphicsComponent, Particle } from '..';
|
|
8
|
+
import { DebugGraphicsComponent } from '../Graphics/DebugGraphicsComponent';
|
|
9
|
+
export class DebugSystem extends System {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.types = ['ex.transform'];
|
|
13
|
+
this.systemType = SystemType.Draw;
|
|
14
|
+
this.priority = 999; // lowest priority
|
|
15
|
+
}
|
|
16
|
+
initialize(scene) {
|
|
17
|
+
this._graphicsContext = scene.engine.graphicsContext;
|
|
18
|
+
this._camera = scene.camera;
|
|
19
|
+
this._engine = scene.engine;
|
|
20
|
+
this._collisionSystem = scene.world.systemManager.get(CollisionSystem);
|
|
21
|
+
}
|
|
22
|
+
update(entities, _delta) {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
if (!this._engine.isDebug) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const filterSettings = this._engine.debug.filter;
|
|
28
|
+
let id;
|
|
29
|
+
let name;
|
|
30
|
+
const entitySettings = this._engine.debug.entity;
|
|
31
|
+
let tx;
|
|
32
|
+
const txSettings = this._engine.debug.transform;
|
|
33
|
+
let motion;
|
|
34
|
+
const motionSettings = this._engine.debug.motion;
|
|
35
|
+
let colliderComp;
|
|
36
|
+
const colliderSettings = this._engine.debug.collider;
|
|
37
|
+
const physicsSettings = this._engine.debug.physics;
|
|
38
|
+
let graphics;
|
|
39
|
+
const graphicsSettings = this._engine.debug.graphics;
|
|
40
|
+
let debugDraw;
|
|
41
|
+
let body;
|
|
42
|
+
const bodySettings = this._engine.debug.body;
|
|
43
|
+
const cameraSettings = this._engine.debug.camera;
|
|
44
|
+
for (const entity of entities) {
|
|
45
|
+
if (entity.hasTag('offscreen')) {
|
|
46
|
+
// skip offscreen entities
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (entity instanceof Particle) {
|
|
50
|
+
// Particles crush the renderer :(
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (filterSettings.useFilter) {
|
|
54
|
+
const allIds = filterSettings.ids.length === 0;
|
|
55
|
+
const idMatch = allIds || filterSettings.ids.includes(entity.id);
|
|
56
|
+
if (!idMatch) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const allNames = filterSettings.nameQuery === '';
|
|
60
|
+
const nameMatch = allNames || entity.name.includes(filterSettings.nameQuery);
|
|
61
|
+
if (!nameMatch) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
let cursor = Vector.Zero;
|
|
66
|
+
const lineHeight = vec(0, 16);
|
|
67
|
+
id = entity.id;
|
|
68
|
+
name = entity.name;
|
|
69
|
+
tx = entity.get(TransformComponent);
|
|
70
|
+
// This optionally sets our camera based on the entity coord plan (world vs. screen)
|
|
71
|
+
this._pushCameraTransform(tx);
|
|
72
|
+
this._graphicsContext.save();
|
|
73
|
+
this._applyTransform(entity);
|
|
74
|
+
if (tx) {
|
|
75
|
+
if (txSettings.showAll || txSettings.showPosition) {
|
|
76
|
+
this._graphicsContext.debug.drawPoint(Vector.Zero, { size: 4, color: txSettings.positionColor });
|
|
77
|
+
}
|
|
78
|
+
if (txSettings.showAll || txSettings.showPositionLabel) {
|
|
79
|
+
this._graphicsContext.debug.drawText(`pos${tx.pos.toString(2)}`, cursor);
|
|
80
|
+
cursor = cursor.add(lineHeight);
|
|
81
|
+
}
|
|
82
|
+
if (entitySettings.showAll || entitySettings.showId) {
|
|
83
|
+
this._graphicsContext.debug.drawText(`id(${id}) ${tx.parent ? 'child of id(' + ((_b = (_a = tx.parent) === null || _a === void 0 ? void 0 : _a.owner) === null || _b === void 0 ? void 0 : _b.id) + ')' : ''}`, cursor);
|
|
84
|
+
cursor = cursor.add(lineHeight);
|
|
85
|
+
}
|
|
86
|
+
if (entitySettings.showAll || entitySettings.showName) {
|
|
87
|
+
this._graphicsContext.debug.drawText(`name(${name})`, cursor);
|
|
88
|
+
cursor = cursor.add(lineHeight);
|
|
89
|
+
}
|
|
90
|
+
if (txSettings.showAll || txSettings.showRotation) {
|
|
91
|
+
this._graphicsContext.drawLine(Vector.Zero, Vector.fromAngle(tx.rotation).scale(50).add(Vector.Zero), txSettings.rotationColor, 2);
|
|
92
|
+
this._graphicsContext.debug.drawText(`rot deg(${toDegrees(tx.rotation).toFixed(2)})`, cursor);
|
|
93
|
+
cursor = cursor.add(lineHeight);
|
|
94
|
+
}
|
|
95
|
+
if (txSettings.showAll || txSettings.showScale) {
|
|
96
|
+
this._graphicsContext.drawLine(Vector.Zero, tx.scale.add(Vector.Zero), txSettings.scaleColor, 2);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
graphics = entity.get(GraphicsComponent);
|
|
100
|
+
if (graphics) {
|
|
101
|
+
if (graphicsSettings.showAll || graphicsSettings.showBounds) {
|
|
102
|
+
const bounds = graphics.localBounds;
|
|
103
|
+
bounds.draw(this._graphicsContext, graphicsSettings.boundsColor);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
debugDraw = entity.get(DebugGraphicsComponent);
|
|
107
|
+
if (debugDraw) {
|
|
108
|
+
debugDraw.draw(this._graphicsContext);
|
|
109
|
+
}
|
|
110
|
+
body = entity.get(BodyComponent);
|
|
111
|
+
if (body) {
|
|
112
|
+
if (bodySettings.showAll || bodySettings.showCollisionGroup) {
|
|
113
|
+
this._graphicsContext.debug.drawText(`collision group(${body.group.name})`, cursor);
|
|
114
|
+
cursor = cursor.add(lineHeight);
|
|
115
|
+
}
|
|
116
|
+
if (bodySettings.showAll || bodySettings.showCollisionType) {
|
|
117
|
+
this._graphicsContext.debug.drawText(`collision type(${body.collisionType})`, cursor);
|
|
118
|
+
cursor = cursor.add(lineHeight);
|
|
119
|
+
}
|
|
120
|
+
if (bodySettings.showAll || bodySettings.showMass) {
|
|
121
|
+
this._graphicsContext.debug.drawText(`mass(${body.mass})`, cursor);
|
|
122
|
+
cursor = cursor.add(lineHeight);
|
|
123
|
+
}
|
|
124
|
+
if (bodySettings.showAll || bodySettings.showMotion) {
|
|
125
|
+
this._graphicsContext.debug.drawText(`motion(${body.sleepMotion})`, cursor);
|
|
126
|
+
cursor = cursor.add(lineHeight);
|
|
127
|
+
}
|
|
128
|
+
if (bodySettings.showAll || bodySettings.showSleeping) {
|
|
129
|
+
this._graphicsContext.debug.drawText(`sleeping(${body.canSleep ? body.sleeping : 'cant sleep'})`, cursor);
|
|
130
|
+
cursor = cursor.add(lineHeight);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
this._graphicsContext.restore();
|
|
134
|
+
motion = entity.get(MotionComponent);
|
|
135
|
+
if (motion) {
|
|
136
|
+
if (motionSettings.showAll || motionSettings.showVelocity) {
|
|
137
|
+
this._graphicsContext.debug.drawText(`vel${motion.vel.toString(2)}`, cursor.add(tx.globalPos));
|
|
138
|
+
this._graphicsContext.drawLine(tx.globalPos, tx.globalPos.add(motion.vel), motionSettings.velocityColor, 2);
|
|
139
|
+
cursor = cursor.add(lineHeight);
|
|
140
|
+
}
|
|
141
|
+
if (motionSettings.showAll || motionSettings.showAcceleration) {
|
|
142
|
+
this._graphicsContext.drawLine(tx.globalPos, tx.globalPos.add(motion.acc), motionSettings.accelerationColor, 2);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Colliders live in world space already so after the restore()
|
|
146
|
+
colliderComp = entity.get(ColliderComponent);
|
|
147
|
+
if (colliderComp) {
|
|
148
|
+
const collider = colliderComp.get();
|
|
149
|
+
if ((colliderSettings.showAll || colliderSettings.showGeometry) && collider) {
|
|
150
|
+
collider.debug(this._graphicsContext, colliderSettings.geometryColor);
|
|
151
|
+
}
|
|
152
|
+
if (colliderSettings.showAll || colliderSettings.showBounds) {
|
|
153
|
+
if (collider instanceof CompositeCollider) {
|
|
154
|
+
const colliders = collider.getColliders();
|
|
155
|
+
for (const collider of colliders) {
|
|
156
|
+
const bounds = collider.bounds;
|
|
157
|
+
const pos = vec(bounds.left, bounds.top);
|
|
158
|
+
this._graphicsContext.debug.drawRect(pos.x, pos.y, bounds.width, bounds.height, { color: colliderSettings.boundsColor });
|
|
159
|
+
if (colliderSettings.showAll || colliderSettings.showOwner) {
|
|
160
|
+
this._graphicsContext.debug.drawText(`owner id(${collider.owner.id})`, pos);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
colliderComp.bounds.draw(this._graphicsContext, colliderSettings.boundsColor);
|
|
164
|
+
}
|
|
165
|
+
else if (collider) {
|
|
166
|
+
const bounds = colliderComp.bounds;
|
|
167
|
+
const pos = vec(bounds.left, bounds.top);
|
|
168
|
+
this._graphicsContext.debug.drawRect(pos.x, pos.y, bounds.width, bounds.height, { color: colliderSettings.boundsColor });
|
|
169
|
+
if (colliderSettings.showAll || colliderSettings.showOwner) {
|
|
170
|
+
this._graphicsContext.debug.drawText(`owner id(${colliderComp.owner.id})`, pos);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
this._popCameraTransform(tx);
|
|
176
|
+
}
|
|
177
|
+
this._graphicsContext.save();
|
|
178
|
+
this._camera.draw(this._graphicsContext);
|
|
179
|
+
if (physicsSettings.showAll || physicsSettings.showBroadphaseSpacePartitionDebug) {
|
|
180
|
+
this._collisionSystem.debug(this._graphicsContext);
|
|
181
|
+
}
|
|
182
|
+
if (physicsSettings.showAll || physicsSettings.showCollisionContacts || physicsSettings.showCollisionNormals) {
|
|
183
|
+
for (const [_, contact] of this._engine.debug.stats.currFrame.physics.contacts) {
|
|
184
|
+
if (physicsSettings.showAll || physicsSettings.showCollisionContacts) {
|
|
185
|
+
for (const point of contact.points) {
|
|
186
|
+
this._graphicsContext.debug.drawPoint(point, { size: 5, color: physicsSettings.collisionContactColor });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (physicsSettings.showAll || physicsSettings.showCollisionNormals) {
|
|
190
|
+
for (const point of contact.points) {
|
|
191
|
+
this._graphicsContext.debug.drawLine(point, contact.normal.scale(30).add(point), {
|
|
192
|
+
color: physicsSettings.collisionNormalColor
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
this._graphicsContext.restore();
|
|
199
|
+
if (cameraSettings) {
|
|
200
|
+
this._graphicsContext.save();
|
|
201
|
+
this._camera.draw(this._graphicsContext);
|
|
202
|
+
if (cameraSettings.showAll || cameraSettings.showFocus) {
|
|
203
|
+
this._graphicsContext.drawCircle(this._camera.pos, 4, cameraSettings.focusColor);
|
|
204
|
+
}
|
|
205
|
+
if (cameraSettings.showAll || cameraSettings.showZoom) {
|
|
206
|
+
this._graphicsContext.debug.drawText(`zoom(${this._camera.zoom})`, this._camera.pos);
|
|
207
|
+
}
|
|
208
|
+
this._graphicsContext.restore();
|
|
209
|
+
}
|
|
210
|
+
this._graphicsContext.flush();
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* This applies the current entity transform to the graphics context
|
|
214
|
+
* @param entity
|
|
215
|
+
*/
|
|
216
|
+
_applyTransform(entity) {
|
|
217
|
+
const ancestors = entity.getAncestors();
|
|
218
|
+
for (const ancestor of ancestors) {
|
|
219
|
+
const transform = ancestor === null || ancestor === void 0 ? void 0 : ancestor.get(TransformComponent);
|
|
220
|
+
if (transform) {
|
|
221
|
+
this._graphicsContext.translate(transform.pos.x, transform.pos.y);
|
|
222
|
+
this._graphicsContext.scale(transform.scale.x, transform.scale.y);
|
|
223
|
+
this._graphicsContext.rotate(transform.rotation);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Applies the current camera transform if in world coordinates
|
|
229
|
+
* @param transform
|
|
230
|
+
*/
|
|
231
|
+
_pushCameraTransform(transform) {
|
|
232
|
+
// Establish camera offset per entity
|
|
233
|
+
if (transform.coordPlane === CoordPlane.World) {
|
|
234
|
+
this._graphicsContext.save();
|
|
235
|
+
if (this._camera) {
|
|
236
|
+
this._camera.draw(this._graphicsContext);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Resets the current camera transform if in world coordinates
|
|
242
|
+
* @param transform
|
|
243
|
+
*/
|
|
244
|
+
_popCameraTransform(transform) {
|
|
245
|
+
if (transform.coordPlane === CoordPlane.World) {
|
|
246
|
+
// Apply camera world offset
|
|
247
|
+
this._graphicsContext.restore();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=DebugSystem.js.map
|