bard-legends-framework 0.11.0 → 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 -2
- package/dist/game-entities/controller/controller.js +8 -8
- package/dist/game-entities/controller/controller.test.js +2 -2
- package/dist/game-entities/entity/entity.d.ts +7 -7
- package/dist/game-entities/entity/entity.js +18 -12
- package/dist/game-entities/entity/entity.test.js +93 -30
- package/dist/game-entities/entity/helpers/entity-store.helper.d.ts +3 -3
- package/dist/game-entities/entity/helpers/entity-store.helper.js +12 -12
- package/dist/game-entities/entity/helpers/entity-store.helper.test.js +11 -11
- package/dist/game-entities/entity/helpers/entity-views.helper.d.ts +6 -6
- package/dist/game-entities/entity/helpers/entity-views.helper.js +25 -22
- package/dist/game-entities/entity/singleton-entity.test.js +9 -4
- 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 -1
- package/dist/game-entities/index.js +3 -3
- package/dist/game-entities/scene/scene.d.ts +13 -13
- package/dist/game-entities/scene/scene.js +41 -46
- package/dist/game-entities/scene/scene.test.js +95 -37
- package/dist/game-entities/service/service.d.ts +1 -4
- package/dist/game-entities/service/service.js +12 -13
- package/dist/game-entities/service/service.test.js +33 -12
- package/dist/game-entities/unit-test.helper.js +1 -1
- package/dist/game-entities/update-cycle.d.ts +7 -17
- package/dist/game-entities/update-cycle.js +25 -19
- package/dist/game-entities/view/view.d.ts +6 -6
- package/dist/game-entities/view/view.js +15 -21
- package/dist/game-entities/view/view.test.js +40 -9
- package/dist/physics/entity-types/immovable-physics-entity.d.ts +1 -1
- package/dist/physics/entity-types/immovable-physics-entity.js +4 -4
- package/dist/physics/entity-types/movable-entity.d.ts +1 -1
- package/dist/physics/entity-types/movable-entity.js +2 -2
- package/dist/physics/entity-types/movable-physics-entity.d.ts +8 -8
- package/dist/physics/entity-types/movable-physics-entity.js +27 -27
- package/dist/physics/entity-types/physics-entity.d.ts +10 -14
- package/dist/physics/entity-types/physics-entity.js +27 -26
- 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 +19 -19
- 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 +10 -10
- 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 +27 -26
- 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 +12 -12
- 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 +12 -12
- 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 +43 -42
- 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/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 +2 -2
- package/dist/pixi/components/mouse-wheel-listener.ui.js +11 -11
- 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 -25
- package/dist/pixi/display-object/container-attributes.js +26 -26
- package/dist/pixi/display-object/container.d.ts +3 -3
- package/dist/pixi/display-object/container.js +2 -2
- 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 +26 -25
- 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 +20 -15
- package/dist/pixi/game.js +40 -35
- 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/251views/camera.view.d.ts +17 -16
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.js +49 -48
- 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 +2 -2
- package/dist/pixi/services/keyboard/keyboard.js +9 -9
- package/dist/pixi/services/mouse/mouse-target-focus.service.d.ts +10 -10
- package/dist/pixi/services/mouse/mouse-target-focus.service.js +28 -28
- package/dist/pixi/services/mouse/mouse.service.d.ts +1 -1
- package/dist/pixi/services/mouse/mouse.service.js +5 -5
- 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.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 +14 -6
- package/dist/utilities/animator/animations.js +15 -11
- 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 +2 -3
- package/dist/utilities/animator/animator.js +66 -59
- 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.js +89 -28
- 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 +6 -6
- package/dist/utilities/animator/index.js +6 -6
- 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.test.js +30 -30
- package/dist/utilities/animator/state-animation/state-animation.js +7 -7
- package/dist/utilities/animator/state-animation/state-animation.test.js +24 -24
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.test.js +30 -30
- package/dist/utilities/data-structures/vector-set/vector-set.d.ts +1 -1
- package/dist/utilities/data-structures/vector-set/vector-set.js +5 -5
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.d.ts +1 -1
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.js +5 -5
- package/dist/utilities/grid-algorithms/path-finder/path-finder.js +21 -21
- package/dist/utilities/grid-algorithms/path-finder/path-finder.test.js +9 -9
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.d.ts +14 -14
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.js +43 -43
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.test.js +21 -21
- package/package.json +7 -5
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.CompositeHitArea = exports.PositionConversionHelper = void 0;
|
|
27
27
|
const helpers_lib_1 = require("helpers-lib");
|
|
28
|
-
const
|
|
28
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
29
29
|
class PositionConversionHelper {
|
|
30
30
|
static includeScaleInScreenPosition(screenPosition, gameInstanceScale, screenSizeCenter) {
|
|
31
31
|
if (gameInstanceScale !== 1) {
|
|
@@ -44,10 +44,10 @@ class PositionConversionHelper {
|
|
|
44
44
|
exports.PositionConversionHelper = PositionConversionHelper;
|
|
45
45
|
class CompositeHitArea {
|
|
46
46
|
constructor(polygonDefinition, size, anchor) {
|
|
47
|
-
this.
|
|
47
|
+
this._shapes = polygonDefinition.map(vertices => new Pixi.Polygon(vertices.map(vertex => new Pixi.Point(vertex.x, vertex.y))));
|
|
48
48
|
}
|
|
49
49
|
contains(x, y) {
|
|
50
|
-
return this.
|
|
50
|
+
return this._shapes.some(shape => shape.contains(x, y));
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
exports.CompositeHitArea = CompositeHitArea;
|
package/dist/pixi/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { RGBColor, Vec2, Vector } from 'helpers-lib';
|
|
2
1
|
export { DisplayObjectArray, DisplayObjectArrayOptions, UpdatableContainer } from './components/display-object-array';
|
|
2
|
+
export { Menu, MenuOptions } from './components/menu/menu.ui';
|
|
3
|
+
export { MenuEntity } from './components/menu/menu-entity';
|
|
3
4
|
export { MouseWheelListenerUI } from './components/mouse-wheel-listener.ui';
|
|
4
5
|
export { ScrollAreaUI } from './components/scroll-area.ui';
|
|
5
6
|
export { ScrollMaskUI } from './components/scroll-mask.ui';
|
|
@@ -7,42 +8,7 @@ export * from './display-object';
|
|
|
7
8
|
export { Game } from './game';
|
|
8
9
|
export { PositionConversionHelper } from './helpers/position-conversion.helper';
|
|
9
10
|
export * from './modules/CAMERA';
|
|
11
|
+
export * from './pixi-definitions';
|
|
10
12
|
export { KeyboardService } from './services/keyboard/keyboard';
|
|
11
13
|
export { MouseService } from './services/mouse/mouse.service';
|
|
12
14
|
export { MouseTargetFocusService } from './services/mouse/mouse-target-focus.service';
|
|
13
|
-
export interface AssetDefinition<T extends string = string> {
|
|
14
|
-
readonly id: string;
|
|
15
|
-
readonly url: T;
|
|
16
|
-
}
|
|
17
|
-
export declare enum BlendMode {
|
|
18
|
-
normal = 0,
|
|
19
|
-
add = 1,
|
|
20
|
-
screen = 3,
|
|
21
|
-
luminosity = 16,
|
|
22
|
-
colorDodge = 7
|
|
23
|
-
}
|
|
24
|
-
export interface SpriteDefinition {
|
|
25
|
-
readonly id: string;
|
|
26
|
-
readonly scale: number;
|
|
27
|
-
readonly anchor: Vec2;
|
|
28
|
-
readonly size: Vec2;
|
|
29
|
-
readonly boundingShapes?: PolygonDefinition;
|
|
30
|
-
readonly destroyAssetOnDestroy?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export interface GlowingShapeDefinition {
|
|
33
|
-
readonly color: RGBColor;
|
|
34
|
-
readonly shapeAlpha: number;
|
|
35
|
-
readonly glowAlpha: number;
|
|
36
|
-
readonly glowOptions: GlowOptions;
|
|
37
|
-
readonly shapes: PolygonDefinition;
|
|
38
|
-
}
|
|
39
|
-
export type PolygonDefinition = readonly (readonly Vec2[])[];
|
|
40
|
-
export interface GlowOptions {
|
|
41
|
-
readonly color: RGBColor;
|
|
42
|
-
readonly blurRadius: number | Vector;
|
|
43
|
-
readonly expand: number;
|
|
44
|
-
readonly blendMode: BlendMode;
|
|
45
|
-
}
|
|
46
|
-
export type GlowEffectOptions = Partial<GlowOptions> & {
|
|
47
|
-
glowAlpha?: number;
|
|
48
|
-
};
|
package/dist/pixi/index.js
CHANGED
|
@@ -10,27 +10,18 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
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
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
15
|
};
|
|
28
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
30
|
-
const PIXI = __importStar(require("pixi.js"));
|
|
17
|
+
exports.MouseTargetFocusService = exports.MouseService = exports.KeyboardService = exports.PositionConversionHelper = exports.Game = exports.ScrollMaskUI = exports.ScrollAreaUI = exports.MouseWheelListenerUI = exports.MenuEntity = exports.Menu = exports.UpdatableContainer = exports.DisplayObjectArray = void 0;
|
|
31
18
|
var display_object_array_1 = require("./components/display-object-array");
|
|
32
19
|
Object.defineProperty(exports, "DisplayObjectArray", { enumerable: true, get: function () { return display_object_array_1.DisplayObjectArray; } });
|
|
33
20
|
Object.defineProperty(exports, "UpdatableContainer", { enumerable: true, get: function () { return display_object_array_1.UpdatableContainer; } });
|
|
21
|
+
var menu_ui_1 = require("./components/menu/menu.ui");
|
|
22
|
+
Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { return menu_ui_1.Menu; } });
|
|
23
|
+
var menu_entity_1 = require("./components/menu/menu-entity");
|
|
24
|
+
Object.defineProperty(exports, "MenuEntity", { enumerable: true, get: function () { return menu_entity_1.MenuEntity; } });
|
|
34
25
|
var mouse_wheel_listener_ui_1 = require("./components/mouse-wheel-listener.ui");
|
|
35
26
|
Object.defineProperty(exports, "MouseWheelListenerUI", { enumerable: true, get: function () { return mouse_wheel_listener_ui_1.MouseWheelListenerUI; } });
|
|
36
27
|
var scroll_area_ui_1 = require("./components/scroll-area.ui");
|
|
@@ -43,18 +34,11 @@ Object.defineProperty(exports, "Game", { enumerable: true, get: function () { re
|
|
|
43
34
|
var position_conversion_helper_1 = require("./helpers/position-conversion.helper");
|
|
44
35
|
Object.defineProperty(exports, "PositionConversionHelper", { enumerable: true, get: function () { return position_conversion_helper_1.PositionConversionHelper; } });
|
|
45
36
|
__exportStar(require("./modules/CAMERA"), exports);
|
|
37
|
+
__exportStar(require("./pixi-definitions"), exports);
|
|
46
38
|
var keyboard_1 = require("./services/keyboard/keyboard");
|
|
47
39
|
Object.defineProperty(exports, "KeyboardService", { enumerable: true, get: function () { return keyboard_1.KeyboardService; } });
|
|
48
40
|
var mouse_service_1 = require("./services/mouse/mouse.service");
|
|
49
41
|
Object.defineProperty(exports, "MouseService", { enumerable: true, get: function () { return mouse_service_1.MouseService; } });
|
|
50
42
|
var mouse_target_focus_service_1 = require("./services/mouse/mouse-target-focus.service");
|
|
51
43
|
Object.defineProperty(exports, "MouseTargetFocusService", { enumerable: true, get: function () { return mouse_target_focus_service_1.MouseTargetFocusService; } });
|
|
52
|
-
var BlendMode;
|
|
53
|
-
(function (BlendMode) {
|
|
54
|
-
BlendMode[BlendMode["normal"] = 0] = "normal";
|
|
55
|
-
BlendMode[BlendMode["add"] = 1] = "add";
|
|
56
|
-
BlendMode[BlendMode["screen"] = 3] = "screen";
|
|
57
|
-
BlendMode[BlendMode["luminosity"] = 16] = "luminosity";
|
|
58
|
-
BlendMode[BlendMode["colorDodge"] = 7] = "colorDodge";
|
|
59
|
-
})(BlendMode || (exports.BlendMode = BlendMode = {}));
|
|
60
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { SingleEvent } from 'actions-lib';
|
|
1
2
|
import { Vector } from 'helpers-lib';
|
|
2
3
|
import { CameraAppearTransitionType, CameraLayer, FocusingOptions } from './⚜️gateways';
|
|
3
4
|
export declare class Camera {
|
|
4
|
-
readonly layers: Record<CameraLayer,
|
|
5
|
-
private
|
|
6
|
-
private
|
|
5
|
+
readonly layers: Record<CameraLayer, number>;
|
|
6
|
+
private _cameraGateway;
|
|
7
|
+
private _cameraViewGateway;
|
|
7
8
|
get position(): Vector;
|
|
8
9
|
constructor();
|
|
9
10
|
setPosition(position: Vector): void;
|
|
10
11
|
setTransition(options: FocusingOptions): void;
|
|
11
|
-
appear(on: boolean, type?: CameraAppearTransitionType):
|
|
12
|
+
appear(on: boolean, type?: CameraAppearTransitionType): SingleEvent;
|
|
12
13
|
}
|
|
@@ -5,22 +5,22 @@ const game_entities_1 = require("../../../game-entities");
|
|
|
5
5
|
const __gateways_1 = require("./\u269C\uFE0Fgateways");
|
|
6
6
|
class Camera {
|
|
7
7
|
get position() {
|
|
8
|
-
return this.
|
|
8
|
+
return this._cameraGateway.getCameraPosition();
|
|
9
9
|
}
|
|
10
10
|
constructor() {
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
this.layers = this.
|
|
11
|
+
this._cameraGateway = game_entities_1.Service.get(__gateways_1.CameraGateway);
|
|
12
|
+
this._cameraViewGateway = game_entities_1.Service.get(__gateways_1.CameraViewGateway);
|
|
13
|
+
this._cameraGateway.createCamera();
|
|
14
|
+
this.layers = this._cameraViewGateway.getLayers();
|
|
15
15
|
}
|
|
16
16
|
setPosition(position) {
|
|
17
|
-
this.
|
|
17
|
+
this._cameraGateway.setPosition(position);
|
|
18
18
|
}
|
|
19
19
|
setTransition(options) {
|
|
20
|
-
this.
|
|
20
|
+
this._cameraGateway.setTransition(options);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
return this.
|
|
22
|
+
appear(on, type = 'alpha') {
|
|
23
|
+
return this._cameraViewGateway.appear(on, type);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
exports.Camera = Camera;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { SingleEvent } from 'actions-lib';
|
|
1
2
|
import { ControllerLink } from '../../../../game-entities';
|
|
2
3
|
import { CameraAppearTransitionType, CameraLayer } from './dtos/requests.dto';
|
|
3
4
|
export declare const CameraViewControllerLink: ControllerLink;
|
|
4
5
|
export declare class CameraViewGateway {
|
|
5
|
-
getLayers(): Record<CameraLayer,
|
|
6
|
-
appear(on: boolean, type: CameraAppearTransitionType):
|
|
6
|
+
getLayers(): Record<CameraLayer, number>;
|
|
7
|
+
appear(on: boolean, type: CameraAppearTransitionType): SingleEvent;
|
|
7
8
|
}
|
|
@@ -13,7 +13,7 @@ let CameraViewGateway = class CameraViewGateway {
|
|
|
13
13
|
getLayers() {
|
|
14
14
|
return exports.CameraViewControllerLink.trigger('getLayers');
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
appear(on, type) {
|
|
17
17
|
return exports.CameraViewControllerLink.trigger('appear', on, type);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { SingleEvent } from 'actions-lib';
|
|
1
2
|
import { CameraAppearTransitionType, CameraLayer } from '../dtos/requests.dto';
|
|
2
3
|
export declare class CameraViewController {
|
|
3
|
-
getLayers(): Record<CameraLayer,
|
|
4
|
-
appear(on: boolean, type: CameraAppearTransitionType):
|
|
4
|
+
getLayers(): Record<CameraLayer, number>;
|
|
5
|
+
appear(on: boolean, type: CameraAppearTransitionType): SingleEvent;
|
|
5
6
|
}
|
|
@@ -13,13 +13,13 @@ const camera_view_1 = require("../../\uD83E\uDDE9views/camera.view");
|
|
|
13
13
|
const camera_view_gateway_1 = require("../camera-view.gateway");
|
|
14
14
|
let CameraViewController = class CameraViewController {
|
|
15
15
|
getLayers() {
|
|
16
|
-
let
|
|
17
|
-
let cameraView = camera_view_1.CameraView.getInstanceOrFail(
|
|
16
|
+
let cameraEntityID = camera_entity_1.CameraEntity.getInstanceOrFail().id;
|
|
17
|
+
let cameraView = camera_view_1.CameraView.getInstanceOrFail(cameraEntityID);
|
|
18
18
|
return cameraView.getLayers();
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
let cameraView = camera_view_1.CameraView.getInstanceOrFail(
|
|
20
|
+
appear(on, type) {
|
|
21
|
+
let cameraEntityID = camera_entity_1.CameraEntity.getInstanceOrFail().id;
|
|
22
|
+
let cameraView = camera_view_1.CameraView.getInstanceOrFail(cameraEntityID);
|
|
23
23
|
return cameraView.appear(on, type);
|
|
24
24
|
}
|
|
25
25
|
};
|
package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { Vector } from 'helpers-lib';
|
|
|
2
2
|
import { CameraService } from '../../📐services/camera.service';
|
|
3
3
|
import { FocusingOptions } from '../dtos/requests.dto';
|
|
4
4
|
export declare class CameraController {
|
|
5
|
-
private
|
|
6
|
-
constructor(
|
|
7
|
-
createCamera():
|
|
5
|
+
private _cameraService;
|
|
6
|
+
constructor(_cameraService: CameraService);
|
|
7
|
+
createCamera(): number;
|
|
8
8
|
update(time: number, delta: number): void;
|
|
9
9
|
setPosition(position: Vector): void;
|
|
10
10
|
setTransition(options: FocusingOptions): void;
|
package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.js
CHANGED
|
@@ -14,23 +14,23 @@ const game_entities_1 = require("../../../../../game-entities");
|
|
|
14
14
|
const camera_service_1 = require("../../\uD83D\uDCD0services/camera.service");
|
|
15
15
|
const camera_gateway_1 = require("../camera.gateway");
|
|
16
16
|
let CameraController = class CameraController {
|
|
17
|
-
constructor(
|
|
18
|
-
this.
|
|
17
|
+
constructor(_cameraService) {
|
|
18
|
+
this._cameraService = _cameraService;
|
|
19
19
|
}
|
|
20
20
|
createCamera() {
|
|
21
|
-
return this.
|
|
21
|
+
return this._cameraService.createCamera().id;
|
|
22
22
|
}
|
|
23
23
|
update(time, delta) {
|
|
24
|
-
this.
|
|
24
|
+
this._cameraService.update(time, delta);
|
|
25
25
|
}
|
|
26
26
|
setPosition(position) {
|
|
27
|
-
this.
|
|
27
|
+
this._cameraService.setPosition(position);
|
|
28
28
|
}
|
|
29
29
|
setTransition(options) {
|
|
30
|
-
this.
|
|
30
|
+
this._cameraService.setTransition(options);
|
|
31
31
|
}
|
|
32
32
|
getCameraPosition() {
|
|
33
|
-
return this.
|
|
33
|
+
return this._cameraService.getCameraPosition();
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
exports.CameraController = CameraController;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare enum CameraLayer {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
BackgroundScreen = "backgroundScreen",
|
|
3
|
+
Background = "background",
|
|
4
|
+
Main = "main",
|
|
5
|
+
Foreground = "foreground",
|
|
6
|
+
ForegroundScreen = "foregroundScreen"
|
|
7
7
|
}
|
|
8
8
|
export declare enum FocusingAnimation {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Instant = 1,
|
|
10
|
+
EaseInOut = 2,
|
|
11
|
+
EaseOut = 3
|
|
12
12
|
}
|
|
13
13
|
export interface FocusingOptions {
|
|
14
14
|
duration?: number;
|
|
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FocusingAnimation = exports.CameraLayer = void 0;
|
|
4
4
|
var CameraLayer;
|
|
5
5
|
(function (CameraLayer) {
|
|
6
|
-
CameraLayer["
|
|
7
|
-
CameraLayer["
|
|
8
|
-
CameraLayer["
|
|
9
|
-
CameraLayer["
|
|
10
|
-
CameraLayer["
|
|
6
|
+
CameraLayer["BackgroundScreen"] = "backgroundScreen";
|
|
7
|
+
CameraLayer["Background"] = "background";
|
|
8
|
+
CameraLayer["Main"] = "main";
|
|
9
|
+
CameraLayer["Foreground"] = "foreground";
|
|
10
|
+
CameraLayer["ForegroundScreen"] = "foregroundScreen";
|
|
11
11
|
})(CameraLayer || (exports.CameraLayer = CameraLayer = {}));
|
|
12
12
|
var FocusingAnimation;
|
|
13
13
|
(function (FocusingAnimation) {
|
|
14
|
-
FocusingAnimation["
|
|
15
|
-
FocusingAnimation["
|
|
16
|
-
FocusingAnimation["
|
|
14
|
+
FocusingAnimation[FocusingAnimation["Instant"] = 1] = "Instant";
|
|
15
|
+
FocusingAnimation[FocusingAnimation["EaseInOut"] = 2] = "EaseInOut";
|
|
16
|
+
FocusingAnimation[FocusingAnimation["EaseOut"] = 3] = "EaseOut";
|
|
17
17
|
})(FocusingAnimation || (exports.FocusingAnimation = FocusingAnimation = {}));
|
|
18
18
|
//# sourceMappingURL=requests.dto.js.map
|
|
@@ -7,6 +7,6 @@ export declare class CameraService {
|
|
|
7
7
|
setPosition(position: Vector): void;
|
|
8
8
|
setTransition(options: FocusingOptions): void;
|
|
9
9
|
update(time: number, delta: number): void;
|
|
10
|
-
private
|
|
11
|
-
private
|
|
10
|
+
private _iterateOnFocusingNewTarget;
|
|
11
|
+
private _completeFocusingNewTarget;
|
|
12
12
|
}
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.CameraService = void 0;
|
|
10
10
|
const helpers_lib_1 = require("helpers-lib");
|
|
11
11
|
const game_entities_1 = require("../../../../game-entities");
|
|
12
|
-
const
|
|
12
|
+
const animations_1 = require("../../../../utilities/animator/animations");
|
|
13
13
|
const game_1 = require("../../../game");
|
|
14
14
|
const __gateways_1 = require("../\u269C\uFE0Fgateways");
|
|
15
15
|
const camera_entity_1 = require("../\uD83E\uDDCAentities/camera.entity");
|
|
@@ -35,7 +35,7 @@ let CameraService = class CameraService {
|
|
|
35
35
|
position: cameraEntity.position.value,
|
|
36
36
|
roundPosition: options?.roundPosition ?? false,
|
|
37
37
|
roundPositionThreshold: options?.roundPositionThreshold ?? 0,
|
|
38
|
-
focusingAnimation: options?.animation ?? __gateways_1.FocusingAnimation.
|
|
38
|
+
focusingAnimation: options?.animation ?? __gateways_1.FocusingAnimation.Instant
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
update(time, delta) {
|
|
@@ -43,30 +43,30 @@ let CameraService = class CameraService {
|
|
|
43
43
|
let targetPosition = cameraEntity.targetPosition.value;
|
|
44
44
|
if (targetPosition) {
|
|
45
45
|
if (cameraEntity.focusingNewTargetInfo.value) {
|
|
46
|
-
this.
|
|
46
|
+
this._iterateOnFocusingNewTarget(cameraEntity, targetPosition, time);
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
49
|
cameraEntity.position.value = targetPosition;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
_iterateOnFocusingNewTarget(cameraEntity, targetPosition, time) {
|
|
54
54
|
let focusingNewTargetInfo = cameraEntity.focusingNewTargetInfo.value;
|
|
55
|
-
if (focusingNewTargetInfo.focusingAnimation === __gateways_1.FocusingAnimation.
|
|
56
|
-
this.
|
|
55
|
+
if (focusingNewTargetInfo.focusingAnimation === __gateways_1.FocusingAnimation.Instant) {
|
|
56
|
+
this._completeFocusingNewTarget(cameraEntity, targetPosition);
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
let animationTime = (time - focusingNewTargetInfo.time) / focusingNewTargetInfo.duration;
|
|
60
60
|
if (animationTime >= 1) {
|
|
61
|
-
this.
|
|
61
|
+
this._completeFocusingNewTarget(cameraEntity, targetPosition);
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
64
|
let interpolatedTime;
|
|
65
|
-
if (focusingNewTargetInfo.focusingAnimation === __gateways_1.FocusingAnimation.
|
|
66
|
-
interpolatedTime =
|
|
65
|
+
if (focusingNewTargetInfo.focusingAnimation === __gateways_1.FocusingAnimation.EaseInOut) {
|
|
66
|
+
interpolatedTime = animations_1.AnimationInterpolationFunctions.easeInOut(animationTime);
|
|
67
67
|
}
|
|
68
|
-
else if (focusingNewTargetInfo.focusingAnimation === __gateways_1.FocusingAnimation.
|
|
69
|
-
interpolatedTime =
|
|
68
|
+
else if (focusingNewTargetInfo.focusingAnimation === __gateways_1.FocusingAnimation.EaseOut) {
|
|
69
|
+
interpolatedTime = animations_1.AnimationInterpolationFunctions.easeOut(animationTime);
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
72
|
interpolatedTime = 1;
|
|
@@ -84,7 +84,7 @@ let CameraService = class CameraService {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
_completeFocusingNewTarget(cameraEntity, targetPosition) {
|
|
88
88
|
cameraEntity.position.value = targetPosition;
|
|
89
89
|
cameraEntity.focusingNewTargetInfo.value = undefined;
|
|
90
90
|
}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
+
import { SingleEvent } from 'actions-lib';
|
|
1
2
|
import { View } from '../../../../game-entities';
|
|
2
3
|
import { CameraAppearTransitionType, CameraLayer } from '../⚜️gateways';
|
|
3
4
|
import { CameraEntity } from '../🧊entities/camera.entity';
|
|
4
5
|
export declare class CameraView extends View {
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
constructor(
|
|
6
|
+
private _entity;
|
|
7
|
+
private _sceneContainer;
|
|
8
|
+
private _blackScreen;
|
|
9
|
+
private _backgroundScreen;
|
|
10
|
+
private _cameraOffsetLayer;
|
|
11
|
+
private _foregroundScreenLayer;
|
|
12
|
+
private _cameraLayer;
|
|
13
|
+
private _foreground;
|
|
14
|
+
private _mainLayer;
|
|
15
|
+
private _backgroundLayer;
|
|
16
|
+
private _alphaAnimator;
|
|
17
|
+
private _blackScreenAnimator;
|
|
18
|
+
constructor(_entity: CameraEntity);
|
|
18
19
|
destroy(): void;
|
|
19
|
-
getLayers(): Record<CameraLayer,
|
|
20
|
-
appear(value: boolean, type: CameraAppearTransitionType):
|
|
21
|
-
private
|
|
20
|
+
getLayers(): Record<CameraLayer, number>;
|
|
21
|
+
appear(value: boolean, type: CameraAppearTransitionType): SingleEvent;
|
|
22
|
+
private _convertToCameraPosition;
|
|
22
23
|
}
|
|
@@ -10,99 +10,100 @@ 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
|
+
_convertToCameraPosition(positionInWorld) {
|
|
106
107
|
return helpers_lib_1.Vector.fromTo(positionInWorld, game_1.Game.instance.getScreenSizeCenter());
|
|
107
108
|
}
|
|
108
109
|
};
|
|
@@ -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
|
+
};
|