bard-legends-framework 0.10.9 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions-performance.test.d.ts +1 -0
- package/dist/actions-performance.test.js +83 -0
- package/dist/game-entities/controller/controller.d.ts +2 -3
- package/dist/game-entities/controller/controller.js +9 -8
- package/dist/game-entities/controller/controller.test.js +2 -2
- package/dist/game-entities/entity/entity.d.ts +11 -9
- package/dist/game-entities/entity/entity.js +20 -16
- package/dist/game-entities/entity/entity.test.js +116 -147
- package/dist/game-entities/entity/helpers/entity-store.helper.d.ts +6 -9
- package/dist/game-entities/entity/helpers/entity-store.helper.js +22 -57
- package/dist/game-entities/entity/helpers/entity-store.helper.test.d.ts +1 -0
- package/dist/game-entities/entity/helpers/entity-store.helper.test.js +136 -0
- package/dist/game-entities/entity/helpers/entity-views.helper.d.ts +7 -7
- package/dist/game-entities/entity/helpers/entity-views.helper.js +28 -23
- package/dist/game-entities/entity/singleton-entity.d.ts +3 -3
- package/dist/game-entities/entity/singleton-entity.js +1 -1
- package/dist/game-entities/entity/singleton-entity.test.js +9 -31
- package/dist/game-entities/hard-reset.d.ts +5 -0
- package/dist/game-entities/hard-reset.js +14 -0
- package/dist/game-entities/index.d.ts +1 -3
- package/dist/game-entities/index.js +3 -7
- package/dist/game-entities/scene/scene.d.ts +15 -15
- package/dist/game-entities/scene/scene.js +61 -60
- package/dist/game-entities/scene/scene.test.js +97 -67
- package/dist/game-entities/service/service.d.ts +1 -4
- package/dist/game-entities/service/service.js +15 -14
- package/dist/game-entities/service/service.test.js +33 -38
- package/dist/game-entities/unit-test.helper.d.ts +5 -0
- package/dist/game-entities/unit-test.helper.js +14 -0
- package/dist/game-entities/update-cycle.d.ts +10 -9
- package/dist/game-entities/update-cycle.js +34 -23
- package/dist/game-entities/view/view.d.ts +10 -11
- package/dist/game-entities/view/view.js +17 -35
- package/dist/game-entities/view/view.test.js +73 -250
- package/dist/physics/entity-types/immovable-physics-entity.d.ts +2 -4
- package/dist/physics/entity-types/immovable-physics-entity.js +4 -6
- package/dist/physics/entity-types/movable-entity.d.ts +1 -1
- package/dist/physics/entity-types/movable-entity.js +6 -6
- package/dist/physics/entity-types/movable-physics-entity.d.ts +10 -11
- package/dist/physics/entity-types/movable-physics-entity.js +31 -32
- package/dist/physics/entity-types/physics-entity.d.ts +12 -15
- package/dist/physics/entity-types/physics-entity.js +30 -28
- package/dist/physics/interfaces.d.ts +6 -6
- package/dist/physics/interfaces.js +4 -4
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics-internal.controller.d.ts +16 -16
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics-internal.controller.js +22 -22
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics.controller.d.ts +20 -20
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics.controller.js +30 -30
- package/dist/physics/module//342/232/234/357/270/217gateways/dtos/requests.dto.d.ts +3 -3
- package/dist/physics/module//342/232/234/357/270/217gateways/physics-internal.gateway.d.ts +10 -10
- package/dist/physics/module//342/232/234/357/270/217gateways/physics-internal.gateway.js +16 -16
- package/dist/physics/module//342/232/234/357/270/217gateways/physics.gateway.d.ts +11 -11
- package/dist/physics/module//342/232/234/357/270/217gateways/physics.gateway.js +18 -18
- package/dist/physics/module//360/237/223/220services/collision/collisions.service.d.ts +5 -5
- package/dist/physics/module//360/237/223/220services/collision/collisions.service.js +17 -17
- package/dist/physics/module//360/237/223/220services/collision/hit-test.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/collision/hit-test.service.js +11 -11
- package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.js +4 -4
- package/dist/physics/module//360/237/223/220services/creation/border.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/creation/border.service.js +9 -9
- package/dist/physics/module//360/237/223/220services/creation/materials.service.d.ts +7 -7
- package/dist/physics/module//360/237/223/220services/creation/materials.service.js +17 -17
- package/dist/physics/module//360/237/223/220services/creation/physics-world.service.d.ts +11 -11
- package/dist/physics/module//360/237/223/220services/creation/physics-world.service.js +28 -27
- package/dist/physics/module//360/237/223/220services/creation/shape-creation.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/creation/shape-creation.service.js +13 -13
- package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.d.ts +9 -9
- package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.js +19 -19
- package/dist/physics/module//360/237/223/220services/impact/explosion.service.d.ts +9 -9
- package/dist/physics/module//360/237/223/220services/impact/explosion.service.js +20 -20
- package/dist/physics/module//360/237/223/220services/impact/ray-cast-hit-converter.d.ts +1 -1
- package/dist/physics/module//360/237/223/220services/impact/ray-cast-hit-converter.js +4 -4
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid-cache.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid-cache.service.js +3 -3
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid.service.d.ts +5 -5
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid.service.js +13 -13
- package/dist/physics/module//360/237/223/220services/path-finding/path-finder.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/path-finding/path-finder.service.js +13 -13
- package/dist/physics/module//360/237/223/220services/query/physics-query.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/query/physics-query.service.js +4 -4
- package/dist/physics/module//360/237/223/220services/ray-casting/ray-casting.service.d.ts +1 -4
- package/dist/physics/module//360/237/223/220services/ray-casting/ray-casting.service.js +7 -15
- package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.d.ts +9 -9
- package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.js +60 -49
- package/dist/physics/module//360/237/247/212entities/border.entity.d.ts +1 -1
- package/dist/physics/module//360/237/247/212entities/border.entity.js +3 -3
- package/dist/physics/module//360/237/247/212entities/physics-world.entity.js +2 -2
- package/dist/pixi/components/display-object-array.d.ts +5 -5
- package/dist/pixi/components/display-object-array.js +14 -14
- package/dist/pixi/components/helpers/smooth-scroller.d.ts +7 -7
- package/dist/pixi/components/helpers/smooth-scroller.js +23 -23
- package/dist/pixi/components/helpers/smooth-scroller.test.js +14 -14
- package/dist/pixi/components/menu/menu-entity.d.ts +14 -0
- package/dist/pixi/components/menu/menu-entity.js +48 -0
- package/dist/pixi/components/menu/menu.ui.d.ts +23 -0
- package/dist/pixi/components/menu/menu.ui.js +97 -0
- package/dist/pixi/components/mouse-wheel-listener.ui.d.ts +4 -3
- package/dist/pixi/components/mouse-wheel-listener.ui.js +15 -14
- package/dist/pixi/components/scroll-area.ui.d.ts +1 -1
- package/dist/pixi/components/scroll-area.ui.js +9 -9
- package/dist/pixi/components/scroll-mask.ui.d.ts +9 -8
- package/dist/pixi/components/scroll-mask.ui.js +25 -24
- package/dist/pixi/display-object/container-attributes.d.ts +24 -26
- package/dist/pixi/display-object/container-attributes.js +27 -28
- package/dist/pixi/display-object/container.d.ts +3 -6
- package/dist/pixi/display-object/container.js +2 -12
- package/dist/pixi/display-object/filters/base-filters/blur.filter.d.ts +9 -9
- package/dist/pixi/display-object/filters/base-filters/blur.filter.js +25 -25
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.d.ts +7 -7
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.js +17 -17
- package/dist/pixi/display-object/filters/composite-filters/glow-filter.d.ts +6 -6
- package/dist/pixi/display-object/filters/composite-filters/glow-filter.js +10 -11
- package/dist/pixi/display-object/filters/helpers/gaussian-values.helper.d.ts +2 -2
- package/dist/pixi/display-object/filters/helpers/gaussian-values.helper.js +5 -5
- package/dist/pixi/display-object/filters/templates/checking-neighbors.template.d.ts +5 -5
- package/dist/pixi/display-object/filters/templates/checking-neighbors.template.js +8 -8
- package/dist/pixi/display-object/filters/templates/plane.template.d.ts +5 -5
- package/dist/pixi/display-object/filters/templates/plane.template.js +7 -7
- package/dist/pixi/display-object/filters.d.ts +7 -7
- package/dist/pixi/display-object/filters.js +34 -34
- package/dist/pixi/display-object/index.d.ts +1 -1
- package/dist/pixi/display-object/objects/graphics/graphics.d.ts +9 -9
- package/dist/pixi/display-object/objects/graphics/graphics.js +25 -25
- package/dist/pixi/display-object/objects/placeholder.d.ts +1 -1
- package/dist/pixi/display-object/objects/placeholder.js +7 -7
- package/dist/pixi/display-object/objects/sprite/glow-sprite-generator.d.ts +9 -9
- package/dist/pixi/display-object/objects/sprite/glow-sprite-generator.js +29 -26
- package/dist/pixi/display-object/objects/sprite/sprite.d.ts +10 -9
- package/dist/pixi/display-object/objects/sprite/sprite.js +62 -53
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/pixi-text-style-converter.d.ts +4 -3
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.d.ts +6 -6
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.js +16 -16
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.test.js +28 -28
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/consistent-space-text-wrapper.d.ts +1 -1
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/consistent-space-text-wrapper.js +3 -3
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.d.ts +17 -17
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.js +62 -62
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.test.js +2 -2
- package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.d.ts +3 -3
- package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.js +6 -6
- package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.test.js +12 -12
- package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.d.ts +2 -2
- package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.test.js +5 -5
- package/dist/pixi/display-object/objects/text/rich-text.d.ts +0 -1
- package/dist/pixi/display-object/objects/text/rich-text.js +0 -1
- package/dist/pixi/display-object/objects/text/text.d.ts +9 -10
- package/dist/pixi/display-object/objects/text/text.js +34 -35
- package/dist/pixi/game.d.ts +26 -17
- package/dist/pixi/game.js +53 -39
- package/dist/pixi/helpers/game-assets.d.ts +5 -5
- package/dist/pixi/helpers/game-assets.js +14 -11
- package/dist/pixi/helpers/position-conversion.helper.d.ts +4 -4
- package/dist/pixi/helpers/position-conversion.helper.js +3 -3
- package/dist/pixi/index.d.ts +3 -37
- package/dist/pixi/index.js +6 -22
- package/dist/pixi/modules/CAMERA/camera.d.ts +5 -4
- package/dist/pixi/modules/CAMERA/camera.js +9 -9
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.d.ts +3 -2
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.js +1 -1
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.d.ts +3 -2
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.js +5 -5
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.d.ts +3 -3
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.js +7 -7
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.d.ts +8 -8
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.js +8 -8
- package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.d.ts +2 -2
- package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.js +12 -12
- package/dist/pixi/modules/CAMERA//360/237/247/212entities/camera.entity.js +4 -4
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.d.ts +17 -16
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.js +50 -49
- package/dist/pixi/pixi-definitions.d.ts +38 -0
- package/dist/pixi/pixi-definitions.js +37 -0
- package/dist/pixi/services/keyboard/keyboard.d.ts +6 -4
- package/dist/pixi/services/keyboard/keyboard.js +15 -13
- package/dist/pixi/services/mouse/mouse-target-focus.service.d.ts +12 -11
- package/dist/pixi/services/mouse/mouse-target-focus.service.js +31 -30
- package/dist/pixi/services/mouse/mouse.service.d.ts +16 -6
- package/dist/pixi/services/mouse/mouse.service.js +42 -22
- package/dist/utilities/animator/animating-content/fade-in-content.d.ts +18 -0
- package/dist/utilities/animator/animating-content/fade-in-content.js +37 -0
- package/dist/utilities/animator/animating-content/fade-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/animating-content/fade-in-content.test.js +10 -0
- package/dist/utilities/animator/animating-content/slide-in-content.d.ts +37 -0
- package/dist/utilities/animator/animating-content/slide-in-content.js +99 -0
- package/dist/utilities/animator/animating-content/slide-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/animating-content/slide-in-content.test.js +10 -0
- package/dist/utilities/animator/animations.d.ts +45 -0
- package/dist/utilities/animator/animations.js +92 -0
- package/dist/utilities/animator/animator/animator.d.ts +44 -0
- package/dist/utilities/animator/animator/animator.js +234 -0
- package/dist/utilities/animator/animator/animator.memory-leak.test.d.ts +1 -0
- package/dist/utilities/animator/animator/animator.memory-leak.test.js +73 -0
- package/dist/utilities/animator/animator/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator/animator.performance.test.js +116 -0
- package/dist/utilities/animator/animator/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator/animator.test.js +1046 -0
- package/dist/utilities/animator/animator.d.ts +60 -0
- package/dist/utilities/animator/animator.js +322 -0
- package/dist/utilities/animator/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator.performance.test.js +46 -0
- package/dist/utilities/animator/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator.test.js +928 -0
- package/dist/utilities/animator/animator2/animator.d.ts +42 -0
- package/dist/utilities/animator/animator2/animator.js +222 -0
- package/dist/utilities/animator/animator2/animator.memory-leak.test.d.ts +1 -0
- package/dist/utilities/animator/animator2/animator.memory-leak.test.js +73 -0
- package/dist/utilities/animator/animator2/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator2/animator.performance.test.js +65 -0
- package/dist/utilities/animator/animator2/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator2/animator.test.js +1007 -0
- package/dist/utilities/animator/animator_old/animator.d.ts +60 -0
- package/dist/utilities/animator/animator_old/animator.js +337 -0
- package/dist/utilities/animator/animator_old/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator_old/animator.performance.test.js +121 -0
- package/dist/utilities/animator/animator_old/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator_old/animator.test.js +996 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.d.ts +18 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.js +37 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.test.js +10 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.d.ts +38 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.js +208 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.test.js +439 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.d.ts +41 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.js +107 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.test.js +10 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.d.ts +24 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.js +138 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.test.js +307 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.d.ts +37 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.js +170 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.test.js +340 -0
- package/dist/utilities/animator/index.d.ts +7 -0
- package/dist/utilities/animator/index.js +24 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.d.ts +18 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.js +37 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.test.js +10 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.d.ts +32 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.js +168 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.test.js +431 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.d.ts +37 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.js +100 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.test.js +10 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.d.ts +24 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.js +130 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.test.js +301 -0
- package/dist/utilities/animator/state-animation/slide-state-animation.d.ts +24 -0
- package/dist/utilities/animator/state-animation/slide-state-animation.js +130 -0
- package/dist/utilities/animator/state-animation/slide-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/slide-state-animation.test.js +301 -0
- package/dist/utilities/animator/state-animation/state-animation.d.ts +33 -0
- package/dist/utilities/animator/state-animation/state-animation.js +146 -0
- package/dist/utilities/animator/state-animation/state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/state-animation.test.js +335 -0
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.d.ts +32 -0
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.js +168 -0
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.test.js +431 -0
- package/dist/utilities/data-structures/vector-set/vector-set.d.ts +7 -0
- package/dist/utilities/data-structures/vector-set/vector-set.js +26 -0
- package/dist/utilities/delta-time/delta-time.d.ts +3 -0
- package/dist/utilities/delta-time/delta-time.js +10 -0
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.d.ts +6 -0
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.js +55 -0
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.test.d.ts +1 -0
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.test.js +100 -0
- package/dist/utilities/grid-algorithms/path-finder/path-finder.d.ts +8 -0
- package/dist/utilities/grid-algorithms/path-finder/path-finder.js +98 -0
- package/dist/utilities/grid-algorithms/path-finder/path-finder.test.d.ts +1 -0
- package/dist/utilities/grid-algorithms/path-finder/path-finder.test.js +155 -0
- package/dist/utilities/grid-algorithms/position-to-grid-position-converter.d.ts +6 -0
- package/dist/utilities/grid-algorithms/position-to-grid-position-converter.js +17 -0
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.d.ts +18 -0
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.js +129 -0
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.test.d.ts +1 -0
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.test.js +254 -0
- package/dist/utilities/index.d.ts +6 -6
- package/dist/utilities/index.js +6 -6
- package/package.json +8 -6
|
@@ -10,100 +10,101 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CameraView = void 0;
|
|
13
|
+
const actions_lib_1 = require("actions-lib");
|
|
13
14
|
const helpers_lib_1 = require("helpers-lib");
|
|
14
15
|
const game_entities_1 = require("../../../../game-entities");
|
|
15
16
|
const utilities_1 = require("../../../../utilities");
|
|
17
|
+
const animator_1 = require("../../../../utilities/animator/animator/animator");
|
|
16
18
|
const display_object_1 = require("../../../display-object");
|
|
17
19
|
const container_1 = require("../../../display-object/container");
|
|
18
20
|
const game_1 = require("../../../game");
|
|
19
21
|
const camera_entity_1 = require("../\uD83E\uDDCAentities/camera.entity");
|
|
20
22
|
let CameraView = class CameraView extends game_entities_1.View {
|
|
21
|
-
constructor(
|
|
23
|
+
constructor(_entity) {
|
|
22
24
|
super();
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
25
|
+
this._entity = _entity;
|
|
26
|
+
this._sceneContainer = new container_1.Container().setAlpha(0).displayParent(game_1.Game.instance.stage).attach(this);
|
|
27
|
+
this._blackScreen = display_object_1.Graphics.createRectangle(new helpers_lib_1.Vector(1, 1), helpers_lib_1.ColorHelper.black)
|
|
26
28
|
.toSprite({ cache: true })
|
|
27
29
|
.setAlpha(0)
|
|
28
30
|
.displayParent(game_1.Game.instance.stage)
|
|
29
31
|
.attach(this);
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
32
|
+
this._backgroundScreen = new container_1.Container().displayParent(this._sceneContainer).attach(this);
|
|
33
|
+
this._cameraOffsetLayer = new container_1.Container().displayParent(this._sceneContainer).attach(this);
|
|
34
|
+
this._foregroundScreenLayer = new container_1.Container().setSortableChildren(true).displayParent(this._sceneContainer).attach(this);
|
|
35
|
+
this._cameraLayer = new container_1.Container().setSortableChildren(true).displayParent(this._cameraOffsetLayer).attach(this);
|
|
36
|
+
this._foreground = new container_1.Container().setSortableChildren(true).setZIndex(20).displayParent(this._cameraLayer).attach(this);
|
|
37
|
+
this._mainLayer = new container_1.Container().setSortableChildren(true).setZIndex(10).displayParent(this._cameraLayer).attach(this);
|
|
38
|
+
this._backgroundLayer = new container_1.Container().setZIndex(0).displayParent(this._cameraLayer).attach(this);
|
|
39
|
+
this._alphaAnimator = new animator_1.Animator(this._sceneContainer, 'alpha', {
|
|
38
40
|
duration: 500,
|
|
39
|
-
animation:
|
|
40
|
-
reAnimateHandling:
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
this.
|
|
41
|
+
animation: utilities_1.Animations.easeInOutCubic,
|
|
42
|
+
reAnimateHandling: animator_1.ReAnimateHandlingType.CompletePrevious,
|
|
43
|
+
completionHandling: animator_1.AnimationsCompletionHandlingType.StayInCurrentState
|
|
44
|
+
});
|
|
45
|
+
this._blackScreenAnimator = new animator_1.Animator(this._blackScreen, 'alpha', {
|
|
44
46
|
duration: 500,
|
|
45
|
-
animation:
|
|
46
|
-
reAnimateHandling:
|
|
47
|
-
|
|
48
|
-
})
|
|
47
|
+
animation: utilities_1.Animations.easeInOutCubic,
|
|
48
|
+
reAnimateHandling: animator_1.ReAnimateHandlingType.CompletePrevious,
|
|
49
|
+
completionHandling: animator_1.AnimationsCompletionHandlingType.StayInCurrentState
|
|
50
|
+
});
|
|
49
51
|
game_1.Game.instance.screenSize
|
|
50
52
|
.subscribe(value => {
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
53
|
+
this._blackScreen.aspectRatio = value.x / value.y;
|
|
54
|
+
this._blackScreen.scale = Math.max(value.x, value.y);
|
|
55
|
+
this._blackScreen.setPosition(helpers_lib_1.Vector.zero, { holdFrom: helpers_lib_1.Vector.zero });
|
|
54
56
|
})
|
|
55
57
|
.attach(this);
|
|
56
|
-
game_1.Game.instance.setScreenPositionToStagePositionFunction(globalMousePosition => new helpers_lib_1.Vector(globalMousePosition.x - this.
|
|
57
|
-
this.
|
|
58
|
+
game_1.Game.instance.setScreenPositionToStagePositionFunction(globalMousePosition => new helpers_lib_1.Vector(globalMousePosition.x - this._cameraLayer.position.x - this._cameraOffsetLayer.position.x, globalMousePosition.y - this._cameraLayer.position.y - this._cameraOffsetLayer.position.y));
|
|
59
|
+
this._entity.position
|
|
58
60
|
.subscribe(position => {
|
|
59
|
-
this.
|
|
61
|
+
this._cameraLayer.position = this._convertToCameraPosition(position);
|
|
60
62
|
})
|
|
61
63
|
.attach(this);
|
|
62
|
-
this.
|
|
64
|
+
this._entity.offset
|
|
63
65
|
.subscribe(offset => {
|
|
64
|
-
this.
|
|
66
|
+
this._cameraOffsetLayer.position = offset;
|
|
65
67
|
})
|
|
66
68
|
.attach(this);
|
|
67
69
|
this.appear(true, 'alpha');
|
|
68
70
|
}
|
|
69
71
|
destroy() {
|
|
70
72
|
if (!this.destroyed) {
|
|
71
|
-
game_1.Game.instance.resetScreenPositionToStagePositionFunction();
|
|
72
73
|
super.destroy();
|
|
74
|
+
game_1.Game.instance.resetScreenPositionToStagePositionFunction();
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
getLayers() {
|
|
76
78
|
return {
|
|
77
|
-
backgroundScreen: this.
|
|
78
|
-
background: this.
|
|
79
|
-
main: this.
|
|
80
|
-
foreground: this.
|
|
81
|
-
foregroundScreen: this.
|
|
79
|
+
backgroundScreen: this._backgroundScreen.id,
|
|
80
|
+
background: this._backgroundLayer.id,
|
|
81
|
+
main: this._mainLayer.id,
|
|
82
|
+
foreground: this._foreground.id,
|
|
83
|
+
foregroundScreen: this._foregroundScreenLayer.id
|
|
82
84
|
};
|
|
83
85
|
}
|
|
84
|
-
|
|
86
|
+
appear(value, type) {
|
|
85
87
|
switch (type) {
|
|
86
88
|
case 'alpha':
|
|
87
|
-
this.
|
|
88
|
-
this.
|
|
89
|
-
|
|
90
|
-
break;
|
|
89
|
+
this._blackScreenAnimator.set({ alpha: 0 });
|
|
90
|
+
this._alphaAnimator.set({ alpha: value ? 0 : 1 });
|
|
91
|
+
return this._alphaAnimator.animate({ alpha: value ? 1 : 0 }).chain(this);
|
|
91
92
|
case 'pureBlack':
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
break;
|
|
93
|
+
this._alphaAnimator.set({ alpha: 1 });
|
|
94
|
+
this._blackScreenAnimator.set({ alpha: value ? 1 : 0 });
|
|
95
|
+
return this._blackScreenAnimator.animate({ alpha: value ? 0 : 1 }).chain(this);
|
|
96
96
|
case 'instant':
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
99
|
-
|
|
97
|
+
this._alphaAnimator.set({ alpha: value ? 1 : 0 });
|
|
98
|
+
this._blackScreenAnimator.set({ alpha: value ? 0 : 1 });
|
|
99
|
+
return actions_lib_1.SingleEvent.instant();
|
|
100
100
|
default: {
|
|
101
101
|
let _ = type;
|
|
102
|
+
throw new Error('Switch ended with value "never".');
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
return helpers_lib_1.Vector.fromTo(positionInWorld, game_1.Game.instance.
|
|
106
|
+
_convertToCameraPosition(positionInWorld) {
|
|
107
|
+
return helpers_lib_1.Vector.fromTo(positionInWorld, game_1.Game.instance.getScreenSizeCenter());
|
|
107
108
|
}
|
|
108
109
|
};
|
|
109
110
|
exports.CameraView = CameraView;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RGBColor, Vec2, Vector } from 'helpers-lib';
|
|
2
|
+
export declare const DEFAULT_RESOLUTION = 2;
|
|
3
|
+
export interface AssetDefinition<T extends string = string> {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly url: T;
|
|
6
|
+
}
|
|
7
|
+
export declare enum BlendMode {
|
|
8
|
+
Normal = 0,
|
|
9
|
+
Add = 1,
|
|
10
|
+
Screen = 3,
|
|
11
|
+
Luminosity = 16,
|
|
12
|
+
ColorDodge = 7
|
|
13
|
+
}
|
|
14
|
+
export interface SpriteDefinition {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly scale: number;
|
|
17
|
+
readonly anchor: Vec2;
|
|
18
|
+
readonly size: Vec2;
|
|
19
|
+
readonly boundingShapes?: PolygonDefinition;
|
|
20
|
+
readonly destroyAssetOnDestroy?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface GlowingShapeDefinition {
|
|
23
|
+
readonly color: RGBColor;
|
|
24
|
+
readonly shapeAlpha: number;
|
|
25
|
+
readonly glowAlpha: number;
|
|
26
|
+
readonly glowOptions: GlowOptions;
|
|
27
|
+
readonly shapes: PolygonDefinition;
|
|
28
|
+
}
|
|
29
|
+
export type PolygonDefinition = readonly (readonly Vec2[])[];
|
|
30
|
+
export interface GlowOptions {
|
|
31
|
+
readonly color: RGBColor;
|
|
32
|
+
readonly blurRadius: number | Vector;
|
|
33
|
+
readonly expand: number;
|
|
34
|
+
readonly blendMode: BlendMode;
|
|
35
|
+
}
|
|
36
|
+
export type GlowEffectOptions = Partial<GlowOptions> & {
|
|
37
|
+
glowAlpha?: number;
|
|
38
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.BlendMode = exports.DEFAULT_RESOLUTION = void 0;
|
|
27
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
28
|
+
exports.DEFAULT_RESOLUTION = 2;
|
|
29
|
+
var BlendMode;
|
|
30
|
+
(function (BlendMode) {
|
|
31
|
+
BlendMode[BlendMode["Normal"] = 0] = "Normal";
|
|
32
|
+
BlendMode[BlendMode["Add"] = 1] = "Add";
|
|
33
|
+
BlendMode[BlendMode["Screen"] = 3] = "Screen";
|
|
34
|
+
BlendMode[BlendMode["Luminosity"] = 16] = "Luminosity";
|
|
35
|
+
BlendMode[BlendMode["ColorDodge"] = 7] = "ColorDodge";
|
|
36
|
+
})(BlendMode || (exports.BlendMode = BlendMode = {}));
|
|
37
|
+
//# sourceMappingURL=pixi-definitions.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Action } from 'actions-lib';
|
|
2
2
|
export declare class KeyboardService {
|
|
3
|
-
readonly
|
|
4
|
-
readonly
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
readonly _keyPressed: Action<string>;
|
|
4
|
+
readonly keyPressed: import("actions-lib").Notifier<string>;
|
|
5
|
+
readonly _keyReleased: Action<string>;
|
|
6
|
+
readonly keyReleased: import("actions-lib").Notifier<string>;
|
|
7
|
+
private _listOfPressedKeys;
|
|
8
|
+
private _listOfJustPressedKeys;
|
|
7
9
|
constructor();
|
|
8
10
|
isKeyDown(key: string): boolean;
|
|
9
11
|
isKeyJustPressed(key: string): boolean;
|
|
@@ -15,33 +15,35 @@ const game_entities_1 = require("../../../game-entities");
|
|
|
15
15
|
const service_1 = require("../../../game-entities/service/service");
|
|
16
16
|
let KeyboardService = class KeyboardService {
|
|
17
17
|
constructor() {
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
18
|
+
this._keyPressed = new actions_lib_1.Action();
|
|
19
|
+
this.keyPressed = this._keyPressed.notifier;
|
|
20
|
+
this._keyReleased = new actions_lib_1.Action();
|
|
21
|
+
this.keyReleased = this._keyReleased.notifier;
|
|
22
|
+
this._listOfPressedKeys = new Set();
|
|
23
|
+
this._listOfJustPressedKeys = new Set();
|
|
22
24
|
window.addEventListener('keydown', event => {
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
!event.repeat && this.
|
|
25
|
+
this._listOfPressedKeys.add(event.key);
|
|
26
|
+
this._listOfJustPressedKeys.add(event.key);
|
|
27
|
+
!event.repeat && this._keyPressed.trigger(event.key);
|
|
26
28
|
});
|
|
27
29
|
window.addEventListener('keyup', event => {
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
+
this._listOfPressedKeys.delete(event.key);
|
|
31
|
+
this._keyReleased.trigger(event.key);
|
|
30
32
|
});
|
|
31
33
|
window.addEventListener('blur', () => {
|
|
32
|
-
this.
|
|
34
|
+
this._listOfPressedKeys.clear();
|
|
33
35
|
});
|
|
34
36
|
game_entities_1.UpdateCycle.afterSceneUpdateAction
|
|
35
37
|
.subscribe(() => {
|
|
36
|
-
this.
|
|
38
|
+
this._listOfJustPressedKeys.clear();
|
|
37
39
|
})
|
|
38
40
|
.attachToRoot();
|
|
39
41
|
}
|
|
40
42
|
isKeyDown(key) {
|
|
41
|
-
return this.
|
|
43
|
+
return this._listOfPressedKeys.has(key);
|
|
42
44
|
}
|
|
43
45
|
isKeyJustPressed(key) {
|
|
44
|
-
return this.
|
|
46
|
+
return this._listOfJustPressedKeys.has(key);
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
exports.KeyboardService = KeyboardService;
|
|
@@ -2,19 +2,20 @@ import { Action } from 'actions-lib';
|
|
|
2
2
|
import { Vector } from 'helpers-lib';
|
|
3
3
|
import { MouseService } from './mouse.service';
|
|
4
4
|
export declare class MouseTargetFocusService {
|
|
5
|
-
private
|
|
6
|
-
|
|
5
|
+
private _mouseService;
|
|
6
|
+
readonly _onTargetFocus: Action<Vector>;
|
|
7
|
+
readonly onTargetFocus: import("actions-lib").Notifier<Vector>;
|
|
7
8
|
get focusedInLastFrame(): boolean;
|
|
8
9
|
get lastFocusedPosition(): Vector | undefined;
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
10
|
+
private _mouseStagePositionPrevious;
|
|
11
|
+
private _peakValueChange;
|
|
12
|
+
private _timePassFromLastTrigger;
|
|
13
|
+
private _triggerAfterCooldown;
|
|
13
14
|
private _focusedInLastFrame;
|
|
14
15
|
private _lastFocusedPosition;
|
|
15
|
-
constructor(
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
private
|
|
16
|
+
constructor(_mouseService: MouseService);
|
|
17
|
+
private _update;
|
|
18
|
+
private _check;
|
|
19
|
+
private _iterateValues;
|
|
20
|
+
private _getPositionChange;
|
|
20
21
|
}
|
|
@@ -22,57 +22,58 @@ let MouseTargetFocusService = class MouseTargetFocusService {
|
|
|
22
22
|
get lastFocusedPosition() {
|
|
23
23
|
return this._lastFocusedPosition;
|
|
24
24
|
}
|
|
25
|
-
constructor(
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
25
|
+
constructor(_mouseService) {
|
|
26
|
+
this._mouseService = _mouseService;
|
|
27
|
+
this._onTargetFocus = new actions_lib_1.Action();
|
|
28
|
+
this.onTargetFocus = this._onTargetFocus.notifier;
|
|
29
|
+
this._timePassFromLastTrigger = 0;
|
|
30
|
+
this._triggerAfterCooldown = false;
|
|
30
31
|
this._focusedInLastFrame = false;
|
|
31
32
|
this._lastFocusedPosition = undefined;
|
|
32
33
|
update_cycle_1.UpdateCycle.beforeSceneUpdateAction
|
|
33
|
-
.subscribe((event) => this.
|
|
34
|
+
.subscribe((event) => this._update(event.delta))
|
|
34
35
|
.attachToRoot();
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
if (this.
|
|
38
|
-
let mousePositionChange = this.
|
|
39
|
-
if (this.
|
|
40
|
-
this.
|
|
37
|
+
_update(delta) {
|
|
38
|
+
if (this._mouseStagePositionPrevious) {
|
|
39
|
+
let mousePositionChange = this._getPositionChange(this._mouseService.getStagePosition(), this._mouseStagePositionPrevious);
|
|
40
|
+
if (this._peakValueChange === undefined) {
|
|
41
|
+
this._peakValueChange = mousePositionChange;
|
|
41
42
|
}
|
|
42
43
|
else {
|
|
43
|
-
this.
|
|
44
|
+
this._check(mousePositionChange, delta);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
this.
|
|
47
|
+
this._mouseStagePositionPrevious = this._mouseService.getStagePosition();
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
-
if (this.
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
49
|
+
_check(mousePositionChange, delta) {
|
|
50
|
+
if (this._peakValueChange - mousePositionChange > 10) {
|
|
51
|
+
this._timePassFromLastTrigger = Math.max(250, this._timePassFromLastTrigger);
|
|
52
|
+
this._triggerAfterCooldown = true;
|
|
52
53
|
}
|
|
53
|
-
else if (this.
|
|
54
|
-
this.
|
|
54
|
+
else if (this._timePassFromLastTrigger > 1000) {
|
|
55
|
+
this._triggerAfterCooldown = true;
|
|
55
56
|
}
|
|
56
|
-
let focusHappened = this.
|
|
57
|
-
this.
|
|
57
|
+
let focusHappened = this._timePassFromLastTrigger >= 300 && this._triggerAfterCooldown;
|
|
58
|
+
this._iterateValues(focusHappened, mousePositionChange, delta);
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
if (focusHappened || mousePositionChange > this.
|
|
61
|
-
this.
|
|
60
|
+
_iterateValues(focusHappened, mousePositionChange, delta) {
|
|
61
|
+
if (focusHappened || mousePositionChange > this._peakValueChange) {
|
|
62
|
+
this._peakValueChange = mousePositionChange;
|
|
62
63
|
}
|
|
63
64
|
if (focusHappened) {
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
65
|
+
this._triggerAfterCooldown = false;
|
|
66
|
+
this._timePassFromLastTrigger = 0;
|
|
66
67
|
this._focusedInLastFrame = true;
|
|
67
|
-
this._lastFocusedPosition = this.
|
|
68
|
-
this.
|
|
68
|
+
this._lastFocusedPosition = this._mouseService.getStagePosition();
|
|
69
|
+
this._onTargetFocus.trigger(this._lastFocusedPosition);
|
|
69
70
|
}
|
|
70
71
|
else {
|
|
71
|
-
this.
|
|
72
|
+
this._timePassFromLastTrigger += delta;
|
|
72
73
|
this._focusedInLastFrame = false;
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
+
_getPositionChange(positionA, positionB) {
|
|
76
77
|
let changeVector = helpers_lib_1.Vector.fromTo(positionA, positionB);
|
|
77
78
|
return Math.abs(changeVector.x) + Math.abs(changeVector.y);
|
|
78
79
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { Variable } from 'actions-lib';
|
|
2
2
|
import { Vector } from 'helpers-lib';
|
|
3
3
|
export declare class MouseService {
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
6
|
-
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
4
|
+
readonly _initialMouseMovementHappened: Variable<boolean>;
|
|
5
|
+
readonly onInitialMouseMove: import("actions-lib").Notifier<boolean>;
|
|
6
|
+
get initialMouseMoveHappened(): boolean;
|
|
7
|
+
readonly _stagePosition: Variable<Vector>;
|
|
8
|
+
readonly stagePosition: import("actions-lib").Notifier<Vector>;
|
|
9
|
+
getStagePosition(): Vector;
|
|
10
|
+
readonly _screenPosition: Variable<Vector>;
|
|
11
|
+
readonly screenPosition: import("actions-lib").Notifier<Vector>;
|
|
12
|
+
getScreenPosition(): Vector;
|
|
13
|
+
readonly _mainButtonState: Variable<boolean>;
|
|
14
|
+
readonly mainButtonState: import("actions-lib").Notifier<boolean>;
|
|
15
|
+
getMainButtonState(): boolean;
|
|
16
|
+
readonly _secondaryButtonState: Variable<boolean>;
|
|
17
|
+
readonly secondaryButtonState: import("actions-lib").Notifier<boolean>;
|
|
18
|
+
getSecondaryButtonState(): boolean;
|
|
9
19
|
constructor();
|
|
10
|
-
private
|
|
20
|
+
private _startListeningMouseMove;
|
|
11
21
|
}
|
|
@@ -14,60 +14,80 @@ const actions_lib_1 = require("actions-lib");
|
|
|
14
14
|
const helpers_lib_1 = require("helpers-lib");
|
|
15
15
|
const service_1 = require("../../../game-entities/service/service");
|
|
16
16
|
const update_cycle_1 = require("../../../game-entities/update-cycle");
|
|
17
|
-
const
|
|
17
|
+
const game_1 = require("../../game");
|
|
18
18
|
let MouseService = class MouseService {
|
|
19
|
+
get initialMouseMoveHappened() {
|
|
20
|
+
return this._initialMouseMovementHappened.value;
|
|
21
|
+
}
|
|
22
|
+
getStagePosition() {
|
|
23
|
+
return this._stagePosition.value;
|
|
24
|
+
}
|
|
25
|
+
getScreenPosition() {
|
|
26
|
+
return this._screenPosition.value;
|
|
27
|
+
}
|
|
28
|
+
getMainButtonState() {
|
|
29
|
+
return this._mainButtonState.value;
|
|
30
|
+
}
|
|
31
|
+
getSecondaryButtonState() {
|
|
32
|
+
return this._secondaryButtonState.value;
|
|
33
|
+
}
|
|
19
34
|
constructor() {
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
35
|
+
this._initialMouseMovementHappened = new actions_lib_1.Variable(false);
|
|
36
|
+
this.onInitialMouseMove = this._initialMouseMovementHappened.notifier;
|
|
37
|
+
this._stagePosition = new actions_lib_1.Variable(helpers_lib_1.Vector.zero, { notifyOnChange: true });
|
|
38
|
+
this.stagePosition = this._stagePosition.notifier;
|
|
39
|
+
this._screenPosition = new actions_lib_1.Variable(helpers_lib_1.Vector.zero, { notifyOnChange: true });
|
|
40
|
+
this.screenPosition = this._screenPosition.notifier;
|
|
41
|
+
this._mainButtonState = new actions_lib_1.Variable(false);
|
|
42
|
+
this.mainButtonState = this._mainButtonState.notifier;
|
|
43
|
+
this._secondaryButtonState = new actions_lib_1.Variable(false);
|
|
44
|
+
this.secondaryButtonState = this._secondaryButtonState.notifier;
|
|
45
|
+
this._startListeningMouseMove();
|
|
26
46
|
window.addEventListener('mousedown', event => {
|
|
27
47
|
if (event.button === 0) {
|
|
28
|
-
this.
|
|
48
|
+
this._mainButtonState.value = true;
|
|
29
49
|
}
|
|
30
50
|
else if (event.button === 2) {
|
|
31
|
-
this.
|
|
51
|
+
this._secondaryButtonState.value = true;
|
|
32
52
|
}
|
|
33
53
|
});
|
|
34
54
|
window.addEventListener('mouseup', event => {
|
|
35
55
|
if (event.button === 0) {
|
|
36
|
-
this.
|
|
56
|
+
this._mainButtonState.value = false;
|
|
37
57
|
}
|
|
38
58
|
else if (event.button === 2) {
|
|
39
|
-
this.
|
|
59
|
+
this._secondaryButtonState.value = false;
|
|
40
60
|
}
|
|
41
61
|
});
|
|
42
62
|
window.addEventListener('blur', () => {
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
63
|
+
this._mainButtonState.value = false;
|
|
64
|
+
this._secondaryButtonState.value = false;
|
|
45
65
|
});
|
|
46
66
|
}
|
|
47
|
-
|
|
67
|
+
_startListeningMouseMove() {
|
|
48
68
|
let mouseScreenPosition = helpers_lib_1.Vector.zero;
|
|
49
69
|
window.addEventListener('mousemove', event => {
|
|
50
70
|
mouseScreenPosition = new helpers_lib_1.Vector(event.clientX, event.clientY);
|
|
51
|
-
this.
|
|
71
|
+
this._initialMouseMovementHappened.value = true;
|
|
52
72
|
});
|
|
53
73
|
update_cycle_1.UpdateCycle.beforeSceneUpdateAction
|
|
54
74
|
.subscribe(() => {
|
|
55
|
-
this.
|
|
75
|
+
this._screenPosition.value = mouseScreenPosition;
|
|
56
76
|
})
|
|
57
77
|
.attachToRoot();
|
|
58
78
|
update_cycle_1.UpdateCycle.afterSceneUpdateAction
|
|
59
79
|
.subscribe(() => {
|
|
60
|
-
let newStagePosition =
|
|
61
|
-
if (newStagePosition.isEqual(this.
|
|
80
|
+
let newStagePosition = game_1.Game.instance.screenPositonToStagePosition(this._screenPosition.value);
|
|
81
|
+
if (newStagePosition.isEqual(this._stagePosition.value)) {
|
|
62
82
|
// Trigger pointer move event, because content might slide under the mouse cursor
|
|
63
|
-
|
|
64
|
-
clientX: this.
|
|
65
|
-
clientY: this.
|
|
83
|
+
game_1.Game.instance.renderer.events['onPointerMove'](new PointerEvent('pointermove', {
|
|
84
|
+
clientX: this._screenPosition.value.x,
|
|
85
|
+
clientY: this._screenPosition.value.y,
|
|
66
86
|
pointerType: 'mouse'
|
|
67
87
|
}));
|
|
68
88
|
}
|
|
69
89
|
else {
|
|
70
|
-
this.
|
|
90
|
+
this._stagePosition.value = newStagePosition;
|
|
71
91
|
}
|
|
72
92
|
})
|
|
73
93
|
.attachToRoot();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Container } from '../../../pixi';
|
|
2
|
+
import { AnimatorAnimation } from '../animations';
|
|
3
|
+
export interface FadeInContentOptions {
|
|
4
|
+
duration: number;
|
|
5
|
+
animation: AnimatorAnimation;
|
|
6
|
+
}
|
|
7
|
+
export declare class FadeInContent<T> extends Container {
|
|
8
|
+
private createFunction;
|
|
9
|
+
private stateAnimation;
|
|
10
|
+
private content;
|
|
11
|
+
constructor(createFunction: (value: {
|
|
12
|
+
state: T;
|
|
13
|
+
container: Container;
|
|
14
|
+
}) => void, partialOptions?: Partial<FadeInContentOptions>);
|
|
15
|
+
setState(state: T | undefined, options?: {
|
|
16
|
+
instant?: boolean;
|
|
17
|
+
}): this;
|
|
18
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FadeInContent = void 0;
|
|
4
|
+
const pixi_1 = require("../../../pixi");
|
|
5
|
+
const animations_1 = require("../animations");
|
|
6
|
+
const visit_disappear_state_animation_1 = require("../state-animation/visit-disappear-state-animation");
|
|
7
|
+
class FadeInContent extends pixi_1.Container {
|
|
8
|
+
constructor(createFunction, partialOptions) {
|
|
9
|
+
super();
|
|
10
|
+
this.createFunction = createFunction;
|
|
11
|
+
let options = {
|
|
12
|
+
duration: 200,
|
|
13
|
+
animation: new animations_1.AnimationEaseInOut(),
|
|
14
|
+
...partialOptions
|
|
15
|
+
};
|
|
16
|
+
this.alpha = 0;
|
|
17
|
+
this.stateAnimation = new visit_disappear_state_animation_1.VisitDisappearStateAnimation(options)
|
|
18
|
+
.onStateChange(state => {
|
|
19
|
+
this.content?.destroy();
|
|
20
|
+
this.content = undefined;
|
|
21
|
+
if (state !== undefined) {
|
|
22
|
+
this.content = new pixi_1.Container().displayParent(this).attach(this);
|
|
23
|
+
this.createFunction({ state, container: this.content });
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
.onValueChange(value => {
|
|
27
|
+
this.alpha = value;
|
|
28
|
+
})
|
|
29
|
+
.attach(this);
|
|
30
|
+
}
|
|
31
|
+
setState(state, options) {
|
|
32
|
+
this.stateAnimation.setState(state, options);
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.FadeInContent = FadeInContent;
|
|
37
|
+
//# sourceMappingURL=fade-in-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const fade_in_content_1 = require("./fade-in-content");
|
|
5
|
+
(0, vitest_1.describe)('Fade In Content', () => {
|
|
6
|
+
(0, vitest_1.test)('should exist', () => {
|
|
7
|
+
(0, vitest_1.expect)(fade_in_content_1.FadeInContent).toBeDefined();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=fade-in-content.test.js.map
|