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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Menu = void 0;
|
|
4
|
+
const actions_lib_1 = require("actions-lib");
|
|
5
|
+
const helpers_lib_1 = require("helpers-lib");
|
|
6
|
+
const utilities_1 = require("../../../utilities");
|
|
7
|
+
const display_object_1 = require("../../display-object");
|
|
8
|
+
const game_1 = require("../../game");
|
|
9
|
+
class Menu extends display_object_1.Container {
|
|
10
|
+
static { this._transitioning = false; }
|
|
11
|
+
static closeAll() {
|
|
12
|
+
return Menu._openWindow ? Menu._openWindow.close() : actions_lib_1.SingleEvent.instant();
|
|
13
|
+
}
|
|
14
|
+
constructor(background, partialOptions) {
|
|
15
|
+
super();
|
|
16
|
+
this._onOpen = new actions_lib_1.SingleAction();
|
|
17
|
+
this.onOpen = this._onOpen.notifier;
|
|
18
|
+
this._onClose = new actions_lib_1.SingleAction();
|
|
19
|
+
this.onClose = this._onClose.notifier;
|
|
20
|
+
let options = {
|
|
21
|
+
closeOnBackgroundClick: true,
|
|
22
|
+
appearAnimationDuration: 150,
|
|
23
|
+
darkeningAlpha: 0.3,
|
|
24
|
+
...partialOptions
|
|
25
|
+
};
|
|
26
|
+
this.setZIndex(100).setAlpha(0);
|
|
27
|
+
this._animator = new utilities_1.Animator(this, 'alpha', {
|
|
28
|
+
animation: utilities_1.Animations.easeInOutCubic,
|
|
29
|
+
duration: options.appearAnimationDuration,
|
|
30
|
+
reAnimateHandling: utilities_1.ReAnimateHandlingType.CompletePrevious,
|
|
31
|
+
completionHandling: utilities_1.AnimationsCompletionHandlingType.StayInCurrentState
|
|
32
|
+
});
|
|
33
|
+
this._background = display_object_1.Graphics.createRectangle(new helpers_lib_1.Vector(1, 1), helpers_lib_1.ColorHelper.black)
|
|
34
|
+
.toSprite({ cache: true })
|
|
35
|
+
.setAlpha(options.darkeningAlpha)
|
|
36
|
+
.setInteractive(true)
|
|
37
|
+
.displayParent(this)
|
|
38
|
+
.attach(this);
|
|
39
|
+
this._menu = display_object_1.Sprite.createByName(background)
|
|
40
|
+
.setPosition(new helpers_lib_1.Vector(0, 0))
|
|
41
|
+
.setInteractive(true)
|
|
42
|
+
.displayParent(this)
|
|
43
|
+
.attach(this);
|
|
44
|
+
game_1.Game.instance.screenSize
|
|
45
|
+
.subscribe(value => {
|
|
46
|
+
this._background.aspectRatio = value.x / value.y;
|
|
47
|
+
this._background.scale = Math.max(value.x, value.y);
|
|
48
|
+
this._background.setPosition(helpers_lib_1.Vector.zero, { holdFrom: helpers_lib_1.Vector.half });
|
|
49
|
+
this.setPosition(value.multiplyNumber(0.5));
|
|
50
|
+
})
|
|
51
|
+
.attach(this);
|
|
52
|
+
Menu._openWindow = this;
|
|
53
|
+
this.onDestroy()
|
|
54
|
+
.tap(() => {
|
|
55
|
+
Menu._openWindow = undefined;
|
|
56
|
+
})
|
|
57
|
+
.attachToRoot();
|
|
58
|
+
if (options.closeOnBackgroundClick) {
|
|
59
|
+
this._background
|
|
60
|
+
.on(display_object_1.ContainerEventType.Click, () => {
|
|
61
|
+
if (!Menu._transitioning) {
|
|
62
|
+
this._appear(false);
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
.attach(this);
|
|
66
|
+
}
|
|
67
|
+
this._appear(true);
|
|
68
|
+
}
|
|
69
|
+
getBoundingMask() {
|
|
70
|
+
return this._menu.getBoundingMask();
|
|
71
|
+
}
|
|
72
|
+
close() {
|
|
73
|
+
return this._appear(false);
|
|
74
|
+
}
|
|
75
|
+
_appear(appear) {
|
|
76
|
+
if (Menu._transitioning) {
|
|
77
|
+
throw new Error('WindowUI: cannot iterate while in transition');
|
|
78
|
+
}
|
|
79
|
+
Menu._transitioning = true;
|
|
80
|
+
return this._animator
|
|
81
|
+
.animate({ alpha: appear ? 1 : 0 })
|
|
82
|
+
.chain(this)
|
|
83
|
+
.tap(() => {
|
|
84
|
+
Menu._transitioning = false;
|
|
85
|
+
if (appear) {
|
|
86
|
+
this._onOpen.resolve();
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this._onClose.resolve();
|
|
90
|
+
this.destroy();
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
.chainToRoot();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.Menu = Menu;
|
|
97
|
+
//# sourceMappingURL=menu.ui.js.map
|
|
@@ -4,8 +4,8 @@ import { Container } from '../display-object/container';
|
|
|
4
4
|
export declare class MouseWheelListenerUI extends Container {
|
|
5
5
|
readonly _onWheel: Action<number>;
|
|
6
6
|
readonly onWheel: import("actions-lib").Notifier<number>;
|
|
7
|
-
private
|
|
8
|
-
private
|
|
7
|
+
private _wheelListener;
|
|
8
|
+
private _handler;
|
|
9
9
|
constructor(size: Vector);
|
|
10
10
|
destroy(): void;
|
|
11
11
|
}
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.MouseWheelListenerUI = void 0;
|
|
27
27
|
const actions_lib_1 = require("actions-lib");
|
|
28
|
-
const
|
|
28
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
29
29
|
const game_entities_1 = require("../../game-entities");
|
|
30
30
|
const container_1 = require("../display-object/container");
|
|
31
31
|
const mouse_service_1 = require("../services/mouse/mouse.service");
|
|
@@ -34,9 +34,9 @@ class MouseWheelListenerUI extends container_1.Container {
|
|
|
34
34
|
super();
|
|
35
35
|
this._onWheel = new actions_lib_1.Action();
|
|
36
36
|
this.onWheel = this._onWheel.notifier;
|
|
37
|
-
this.
|
|
37
|
+
this._handler = ((event) => {
|
|
38
38
|
let mouseScreenPosition = game_entities_1.Service.get(mouse_service_1.MouseService).getScreenPosition();
|
|
39
|
-
let bounds = this.
|
|
39
|
+
let bounds = this._wheelListener.getBounds();
|
|
40
40
|
if (mouseScreenPosition.x >= bounds.x &&
|
|
41
41
|
mouseScreenPosition.x <= bounds.x + bounds.width &&
|
|
42
42
|
mouseScreenPosition.y >= bounds.y &&
|
|
@@ -44,18 +44,18 @@ class MouseWheelListenerUI extends container_1.Container {
|
|
|
44
44
|
this._onWheel.trigger(event.deltaY);
|
|
45
45
|
}
|
|
46
46
|
}).bind(this);
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.pixiContainer.addChild(this.
|
|
52
|
-
window.addEventListener('wheel', this.
|
|
47
|
+
this._wheelListener = new Pixi.Graphics();
|
|
48
|
+
this._wheelListener.beginFill(0x000000, 0.000000001);
|
|
49
|
+
this._wheelListener.drawRect(0, 0, size.x, size.y);
|
|
50
|
+
this._wheelListener.endFill();
|
|
51
|
+
this.pixiContainer.addChild(this._wheelListener);
|
|
52
|
+
window.addEventListener('wheel', this._handler);
|
|
53
53
|
}
|
|
54
54
|
destroy() {
|
|
55
55
|
if (!this.destroyed) {
|
|
56
|
-
this.wheelListener.destroy();
|
|
57
|
-
window.removeEventListener('wheel', this.handler);
|
|
58
56
|
super.destroy();
|
|
57
|
+
this._wheelListener.destroy();
|
|
58
|
+
window.removeEventListener('wheel', this._handler);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -13,7 +13,7 @@ class ScrollAreaUI extends container_1.Container {
|
|
|
13
13
|
return this._contentAreaSize;
|
|
14
14
|
}
|
|
15
15
|
get contentSize() {
|
|
16
|
-
return this.
|
|
16
|
+
return this._scroller.contentSize;
|
|
17
17
|
}
|
|
18
18
|
constructor(scrollAreaSize, partialOptions = {}) {
|
|
19
19
|
super();
|
|
@@ -32,23 +32,23 @@ class ScrollAreaUI extends container_1.Container {
|
|
|
32
32
|
let wrapper = new container_1.Container().displayParent(this).attach(this);
|
|
33
33
|
new scroll_mask_ui_1.ScrollMaskUI(wrapper, scrollAreaSize, options.padding).attach(this);
|
|
34
34
|
let content = new container_1.Container().displayParent(wrapper).attach(this);
|
|
35
|
-
this.
|
|
36
|
-
this._contentAreaSize = new helpers_lib_1.Vector(scrollAreaSize.x, this.
|
|
35
|
+
this._scroller = new smooth_scroller_1.SmoothScroller(content, scrollAreaSize.y, options.padding, options.smallContentAlign);
|
|
36
|
+
this._contentAreaSize = new helpers_lib_1.Vector(scrollAreaSize.x, this._scroller.scrollHeight);
|
|
37
37
|
let scrollArea = new mouse_wheel_listener_ui_1.MouseWheelListenerUI(scrollAreaSize).displayParent(wrapper).attach(this);
|
|
38
|
-
scrollArea.onWheel.subscribe(scrollDelta => this.
|
|
39
|
-
game_entities_1.UpdateCycle.afterSceneUpdateAction.subscribe(event => this.
|
|
38
|
+
scrollArea.onWheel.subscribe(scrollDelta => this._scroller.onWheel(scrollDelta)).attach(this);
|
|
39
|
+
game_entities_1.UpdateCycle.afterSceneUpdateAction.subscribe(event => this._scroller.update(event.delta)).attach(this);
|
|
40
40
|
this.addChildTo = content;
|
|
41
41
|
}
|
|
42
42
|
scrollToTop(options) {
|
|
43
|
-
this.
|
|
43
|
+
this._scroller.scrollToTop();
|
|
44
44
|
if (options?.instant) {
|
|
45
|
-
this.
|
|
45
|
+
this._scroller.jumpToTarget();
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
scrollToBottom(options) {
|
|
49
|
-
this.
|
|
49
|
+
this._scroller.scrollToBottom();
|
|
50
50
|
if (options?.instant) {
|
|
51
|
-
this.
|
|
51
|
+
this._scroller.jumpToTarget();
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Vector } from 'helpers-lib';
|
|
2
|
-
import {
|
|
2
|
+
import { ScrollDirection } from '../../utilities';
|
|
3
|
+
import { AnimatorAnimation } from '../../utilities/animator/animations';
|
|
3
4
|
import { Container } from '../display-object/container';
|
|
4
5
|
export declare class AnimationEaseInOutFlatter implements AnimatorAnimation {
|
|
5
6
|
start(): void;
|
|
6
7
|
multiplierFunction(t: number): number;
|
|
7
8
|
}
|
|
8
9
|
export declare class ScrollMaskUI extends Container {
|
|
9
|
-
private static
|
|
10
|
-
private
|
|
11
|
-
constructor(container: Container, size: Vector, padding: number, direction?:
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
10
|
+
private static _drawnTextureCache;
|
|
11
|
+
private _maskSprite;
|
|
12
|
+
constructor(container: Container, size: Vector, padding: number, direction?: ScrollDirection);
|
|
13
|
+
private _createVecticalMask;
|
|
14
|
+
private _createHorizontalMask;
|
|
15
|
+
private _createGradientSprite;
|
|
16
|
+
private _createGradientTexture;
|
|
16
17
|
}
|
|
@@ -25,7 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ScrollMaskUI = exports.AnimationEaseInOutFlatter = void 0;
|
|
27
27
|
const helpers_lib_1 = require("helpers-lib");
|
|
28
|
-
const
|
|
28
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
29
|
+
const utilities_1 = require("../../utilities");
|
|
29
30
|
const container_1 = require("../display-object/container");
|
|
30
31
|
const graphics_1 = require("../display-object/objects/graphics/graphics");
|
|
31
32
|
const sprite_1 = require("../display-object/objects/sprite/sprite");
|
|
@@ -38,8 +39,8 @@ class AnimationEaseInOutFlatter {
|
|
|
38
39
|
}
|
|
39
40
|
exports.AnimationEaseInOutFlatter = AnimationEaseInOutFlatter;
|
|
40
41
|
class ScrollMaskUI extends container_1.Container {
|
|
41
|
-
static { this.
|
|
42
|
-
constructor(container, size, padding, direction =
|
|
42
|
+
static { this._drawnTextureCache = new Map(); }
|
|
43
|
+
constructor(container, size, padding, direction = utilities_1.ScrollDirection.Vertical) {
|
|
43
44
|
super();
|
|
44
45
|
if (padding < 0) {
|
|
45
46
|
throw new Error(`The padding of the scroll mask cannot be lower than '0'`);
|
|
@@ -48,19 +49,19 @@ class ScrollMaskUI extends container_1.Container {
|
|
|
48
49
|
throw new Error(`The height of the scroll mask cannot be lower than '${padding * 2}'`);
|
|
49
50
|
}
|
|
50
51
|
let maskContainer = new container_1.Container();
|
|
51
|
-
if (direction ===
|
|
52
|
-
this.
|
|
52
|
+
if (direction === utilities_1.ScrollDirection.Horizontal) {
|
|
53
|
+
this._createHorizontalMask(size, padding, maskContainer);
|
|
53
54
|
}
|
|
54
55
|
else {
|
|
55
|
-
this.
|
|
56
|
+
this._createVecticalMask(size, padding, maskContainer);
|
|
56
57
|
}
|
|
57
|
-
this.
|
|
58
|
+
this._maskSprite = sprite_1.Sprite.createSnapshotSprite(maskContainer).attach(this);
|
|
58
59
|
maskContainer.destroy();
|
|
59
|
-
container.setMask(this.
|
|
60
|
+
container.setMask(this._maskSprite);
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
+
_createVecticalMask(size, padding, container) {
|
|
62
63
|
if (padding > 0) {
|
|
63
|
-
this.
|
|
64
|
+
this._createGradientSprite(new helpers_lib_1.Vector(size.x, padding)).displayParent(container).attach(container);
|
|
64
65
|
}
|
|
65
66
|
graphics_1.Graphics.createRectangle(new helpers_lib_1.Vector(size.x, size.y - padding * 2), helpers_lib_1.ColorHelper.white)
|
|
66
67
|
.toSprite()
|
|
@@ -68,16 +69,16 @@ class ScrollMaskUI extends container_1.Container {
|
|
|
68
69
|
.displayParent(container)
|
|
69
70
|
.attach(container);
|
|
70
71
|
if (padding > 0) {
|
|
71
|
-
this.
|
|
72
|
+
this._createGradientSprite(new helpers_lib_1.Vector(size.x, padding))
|
|
72
73
|
.setPosition(new helpers_lib_1.Vector(size.x, size.y), { round: false })
|
|
73
74
|
.setRotation(helpers_lib_1.Radian.get180)
|
|
74
75
|
.displayParent(container)
|
|
75
76
|
.attach(container);
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
+
_createHorizontalMask(size, padding, container) {
|
|
79
80
|
if (padding > 0) {
|
|
80
|
-
this.
|
|
81
|
+
this._createGradientSprite(new helpers_lib_1.Vector(size.y, padding))
|
|
81
82
|
.setPosition(new helpers_lib_1.Vector(0, size.y), { round: false })
|
|
82
83
|
.setRotation(helpers_lib_1.Radian.get270)
|
|
83
84
|
.displayParent(container)
|
|
@@ -89,22 +90,22 @@ class ScrollMaskUI extends container_1.Container {
|
|
|
89
90
|
.displayParent(container)
|
|
90
91
|
.attach(container);
|
|
91
92
|
if (padding > 0) {
|
|
92
|
-
this.
|
|
93
|
+
this._createGradientSprite(new helpers_lib_1.Vector(size.y, padding))
|
|
93
94
|
.setPosition(new helpers_lib_1.Vector(size.x, 0), { round: false })
|
|
94
95
|
.setRotation(helpers_lib_1.Radian.get90)
|
|
95
96
|
.displayParent(container)
|
|
96
97
|
.attach(container);
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
|
-
|
|
100
|
-
let
|
|
101
|
-
let spriteDefinition = { id:
|
|
100
|
+
_createGradientSprite(size) {
|
|
101
|
+
let textureID = this._createGradientTexture(size.y);
|
|
102
|
+
let spriteDefinition = { id: textureID, scale: 1, size, anchor: { x: 0, y: 0 }, boundingShapes: undefined };
|
|
102
103
|
return new sprite_1.Sprite(spriteDefinition, { textureSize: size, ignoreAnchor: true });
|
|
103
104
|
}
|
|
104
|
-
|
|
105
|
+
_createGradientTexture(length) {
|
|
105
106
|
let cacheName = JSON.stringify({ type: 'gradient', length });
|
|
106
|
-
let
|
|
107
|
-
if (!
|
|
107
|
+
let textureID = ScrollMaskUI._drawnTextureCache.get(cacheName);
|
|
108
|
+
if (!textureID) {
|
|
108
109
|
let canvas = document.createElement('canvas');
|
|
109
110
|
canvas.width = 1;
|
|
110
111
|
canvas.height = length;
|
|
@@ -116,15 +117,15 @@ class ScrollMaskUI extends container_1.Container {
|
|
|
116
117
|
ctx.fillStyle = color;
|
|
117
118
|
ctx.fillRect(0, index, 1, 1);
|
|
118
119
|
});
|
|
119
|
-
let texture =
|
|
120
|
-
|
|
121
|
-
ScrollMaskUI.
|
|
120
|
+
let texture = Pixi.Texture.from(canvas);
|
|
121
|
+
textureID = game_assets_1.GameAssets.insertAsset(texture);
|
|
122
|
+
ScrollMaskUI._drawnTextureCache.set(cacheName, textureID);
|
|
122
123
|
}
|
|
123
124
|
else {
|
|
124
125
|
throw new Error('Canvas context is null');
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
|
-
return
|
|
128
|
+
return textureID;
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
exports.ScrollMaskUI = ScrollMaskUI;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IAttachment, IDAttachable } from 'actions-lib';
|
|
2
2
|
import { Radian, Vector } from 'helpers-lib';
|
|
3
|
-
import * as
|
|
3
|
+
import * as Pixi from 'pixi.js';
|
|
4
4
|
export declare enum ContainerEventType {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
Click = "click",
|
|
6
|
+
MouseOver = "mouseover",
|
|
7
|
+
MouseOut = "mouseout",
|
|
8
|
+
PointerDown = "pointerdown",
|
|
9
|
+
PointerUp = "pointerup",
|
|
10
|
+
PointerUpOutside = "pointerupoutside",
|
|
11
|
+
PointerMove = "pointermove",
|
|
12
|
+
PointerCancel = "pointercancel",
|
|
13
|
+
PointerOver = "pointerover",
|
|
14
|
+
PointerOut = "pointerout",
|
|
15
|
+
PointerEnter = "pointerenter",
|
|
16
|
+
PointerLeave = "pointerleave",
|
|
17
|
+
Added = "added",
|
|
18
|
+
Removed = "removed",
|
|
19
|
+
Update = "update",
|
|
20
|
+
Change = "change"
|
|
21
21
|
}
|
|
22
22
|
export declare enum Cursor {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Default = "default",
|
|
24
|
+
Pointer = "pointer"
|
|
25
25
|
}
|
|
26
|
-
export declare abstract class ContainerAttributes extends
|
|
27
|
-
protected pixiContainer: PIXI.Container;
|
|
26
|
+
export declare abstract class ContainerAttributes extends IDAttachable {
|
|
28
27
|
protected constructor();
|
|
29
28
|
get size(): Vector;
|
|
30
29
|
set size(value: Vector);
|
|
@@ -46,7 +45,7 @@ export declare abstract class ContainerAttributes extends Attachable {
|
|
|
46
45
|
set x(value: number);
|
|
47
46
|
get y(): number;
|
|
48
47
|
set y(value: number);
|
|
49
|
-
on(eventType: ContainerEventType, callback: () => void):
|
|
48
|
+
on(eventType: ContainerEventType, callback: () => void): IAttachment;
|
|
50
49
|
setRotation(value: Radian): this;
|
|
51
50
|
get rotation(): Radian;
|
|
52
51
|
set rotation(value: Radian);
|
|
@@ -76,7 +75,7 @@ export declare abstract class ContainerAttributes extends Attachable {
|
|
|
76
75
|
setCursor(value: Cursor): this;
|
|
77
76
|
get cursor(): Cursor;
|
|
78
77
|
set cursor(value: Cursor);
|
|
79
|
-
protected getMask():
|
|
78
|
+
protected getMask(): Pixi.Container;
|
|
80
79
|
private _mask;
|
|
81
80
|
setMask(mask: ContainerAttributes | undefined): this;
|
|
82
81
|
hitTest(stagePosition: Vector): boolean;
|
|
@@ -96,5 +95,5 @@ export declare abstract class ContainerAttributes extends Attachable {
|
|
|
96
95
|
setAspectRatio(value: number): this;
|
|
97
96
|
get aspectRatio(): number;
|
|
98
97
|
set aspectRatio(value: number);
|
|
99
|
-
private
|
|
98
|
+
private _updateScale;
|
|
100
99
|
}
|
|
@@ -26,32 +26,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.ContainerAttributes = exports.Cursor = exports.ContainerEventType = void 0;
|
|
27
27
|
const actions_lib_1 = require("actions-lib");
|
|
28
28
|
const helpers_lib_1 = require("helpers-lib");
|
|
29
|
-
const
|
|
29
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
30
30
|
var ContainerEventType;
|
|
31
31
|
(function (ContainerEventType) {
|
|
32
|
-
ContainerEventType["
|
|
33
|
-
ContainerEventType["
|
|
34
|
-
ContainerEventType["
|
|
35
|
-
ContainerEventType["
|
|
36
|
-
ContainerEventType["
|
|
37
|
-
ContainerEventType["
|
|
38
|
-
ContainerEventType["
|
|
39
|
-
ContainerEventType["
|
|
40
|
-
ContainerEventType["
|
|
41
|
-
ContainerEventType["
|
|
42
|
-
ContainerEventType["
|
|
43
|
-
ContainerEventType["
|
|
44
|
-
ContainerEventType["
|
|
45
|
-
ContainerEventType["
|
|
46
|
-
ContainerEventType["
|
|
47
|
-
ContainerEventType["
|
|
32
|
+
ContainerEventType["Click"] = "click";
|
|
33
|
+
ContainerEventType["MouseOver"] = "mouseover";
|
|
34
|
+
ContainerEventType["MouseOut"] = "mouseout";
|
|
35
|
+
ContainerEventType["PointerDown"] = "pointerdown";
|
|
36
|
+
ContainerEventType["PointerUp"] = "pointerup";
|
|
37
|
+
ContainerEventType["PointerUpOutside"] = "pointerupoutside";
|
|
38
|
+
ContainerEventType["PointerMove"] = "pointermove";
|
|
39
|
+
ContainerEventType["PointerCancel"] = "pointercancel";
|
|
40
|
+
ContainerEventType["PointerOver"] = "pointerover";
|
|
41
|
+
ContainerEventType["PointerOut"] = "pointerout";
|
|
42
|
+
ContainerEventType["PointerEnter"] = "pointerenter";
|
|
43
|
+
ContainerEventType["PointerLeave"] = "pointerleave";
|
|
44
|
+
ContainerEventType["Added"] = "added";
|
|
45
|
+
ContainerEventType["Removed"] = "removed";
|
|
46
|
+
ContainerEventType["Update"] = "update";
|
|
47
|
+
ContainerEventType["Change"] = "change";
|
|
48
48
|
})(ContainerEventType || (exports.ContainerEventType = ContainerEventType = {}));
|
|
49
49
|
var Cursor;
|
|
50
50
|
(function (Cursor) {
|
|
51
|
-
Cursor["
|
|
52
|
-
Cursor["
|
|
51
|
+
Cursor["Default"] = "default";
|
|
52
|
+
Cursor["Pointer"] = "pointer";
|
|
53
53
|
})(Cursor || (exports.Cursor = Cursor = {}));
|
|
54
|
-
class ContainerAttributes extends actions_lib_1.
|
|
54
|
+
class ContainerAttributes extends actions_lib_1.IDAttachable {
|
|
55
55
|
constructor() {
|
|
56
56
|
super();
|
|
57
57
|
// --------------------- Scale ---------------------
|
|
@@ -59,7 +59,7 @@ class ContainerAttributes extends actions_lib_1.Attachable {
|
|
|
59
59
|
this._flip = false;
|
|
60
60
|
this._scale = 1;
|
|
61
61
|
this._aspectRatio = 1;
|
|
62
|
-
this.pixiContainer = new
|
|
62
|
+
this.pixiContainer = new Pixi.Container();
|
|
63
63
|
}
|
|
64
64
|
get size() {
|
|
65
65
|
return this.getSize();
|
|
@@ -258,7 +258,7 @@ class ContainerAttributes extends actions_lib_1.Attachable {
|
|
|
258
258
|
}
|
|
259
259
|
set mirror(value) {
|
|
260
260
|
this._mirror = value;
|
|
261
|
-
this.
|
|
261
|
+
this._updateScale();
|
|
262
262
|
}
|
|
263
263
|
setFlip(flip = false) {
|
|
264
264
|
this.flip = flip;
|
|
@@ -269,7 +269,7 @@ class ContainerAttributes extends actions_lib_1.Attachable {
|
|
|
269
269
|
}
|
|
270
270
|
set flip(value) {
|
|
271
271
|
this._flip = value;
|
|
272
|
-
this.
|
|
272
|
+
this._updateScale();
|
|
273
273
|
}
|
|
274
274
|
setScale(value) {
|
|
275
275
|
this.scale = value;
|
|
@@ -280,7 +280,7 @@ class ContainerAttributes extends actions_lib_1.Attachable {
|
|
|
280
280
|
}
|
|
281
281
|
set scale(value) {
|
|
282
282
|
this._scale = value;
|
|
283
|
-
this.
|
|
283
|
+
this._updateScale();
|
|
284
284
|
}
|
|
285
285
|
setAspectRatio(value) {
|
|
286
286
|
this.aspectRatio = value;
|
|
@@ -291,9 +291,9 @@ class ContainerAttributes extends actions_lib_1.Attachable {
|
|
|
291
291
|
}
|
|
292
292
|
set aspectRatio(value) {
|
|
293
293
|
this._aspectRatio = value;
|
|
294
|
-
this.
|
|
294
|
+
this._updateScale();
|
|
295
295
|
}
|
|
296
|
-
|
|
296
|
+
_updateScale() {
|
|
297
297
|
this.pixiContainer.scale.set(this._scale, this._scale);
|
|
298
298
|
if (this._aspectRatio < 1) {
|
|
299
299
|
this.pixiContainer.scale.x *= this._aspectRatio;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Rectangle } from 'helpers-lib';
|
|
2
2
|
import { ContainerAttributes } from './container-attributes';
|
|
3
3
|
import { Filters } from './filters';
|
|
4
|
-
import { Sprite } from './objects/sprite/sprite';
|
|
4
|
+
import type { Sprite } from './objects/sprite/sprite';
|
|
5
5
|
export interface SetParentOptions {
|
|
6
6
|
addUnder: boolean;
|
|
7
7
|
cropOverflowingParts: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare class Container extends ContainerAttributes {
|
|
10
|
-
protected static allContainers: Map<
|
|
10
|
+
protected static allContainers: Map<number, Container>;
|
|
11
11
|
readonly filters: Filters;
|
|
12
12
|
protected addChildTo: Container;
|
|
13
13
|
protected defaultChildOptions: {
|
|
@@ -17,6 +17,6 @@ export declare class Container extends ContainerAttributes {
|
|
|
17
17
|
constructor();
|
|
18
18
|
destroy(): void;
|
|
19
19
|
getBoundingMask(): Sprite;
|
|
20
|
-
displayParent(parent: Container |
|
|
20
|
+
displayParent(parent: Container | number, partialOptions?: Partial<SetParentOptions>): this;
|
|
21
21
|
get boundingBox(): Rectangle;
|
|
22
22
|
}
|
|
@@ -18,9 +18,9 @@ class Container extends container_attributes_1.ContainerAttributes {
|
|
|
18
18
|
}
|
|
19
19
|
destroy() {
|
|
20
20
|
if (!this.destroyed) {
|
|
21
|
+
super.destroy();
|
|
21
22
|
Container.allContainers.delete(this.id);
|
|
22
23
|
!this.pixiContainer.destroyed && this.pixiContainer.destroy();
|
|
23
|
-
super.destroy();
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
getBoundingMask() {
|
|
@@ -33,7 +33,7 @@ class Container extends container_attributes_1.ContainerAttributes {
|
|
|
33
33
|
}
|
|
34
34
|
displayParent(parent, partialOptions) {
|
|
35
35
|
let parentContainer;
|
|
36
|
-
if (helpers_lib_1.Comparator.
|
|
36
|
+
if (helpers_lib_1.Comparator.isNumber(parent)) {
|
|
37
37
|
parentContainer = Container.allContainers.get(parent);
|
|
38
38
|
if (!parentContainer) {
|
|
39
39
|
throw new Error(`Container: parent not found! id: ${parent}`);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Vector } from 'helpers-lib';
|
|
2
|
-
import * as
|
|
3
|
-
export declare class BlurFilter extends
|
|
4
|
-
private
|
|
5
|
-
private
|
|
6
|
-
private
|
|
7
|
-
constructor(
|
|
8
|
-
apply(filterManager:
|
|
9
|
-
get blendMode():
|
|
10
|
-
set blendMode(value:
|
|
2
|
+
import * as Pixi from 'pixi.js';
|
|
3
|
+
export declare class BlurFilter extends Pixi.Filter {
|
|
4
|
+
private _strength;
|
|
5
|
+
private _horizontalFilter;
|
|
6
|
+
private _verticalFilter;
|
|
7
|
+
constructor(_strength?: Vector);
|
|
8
|
+
apply(filterManager: Pixi.FilterSystem, input: Pixi.RenderTexture, output: Pixi.RenderTexture, clearMode: Pixi.CLEAR_MODES): void;
|
|
9
|
+
get blendMode(): Pixi.BLEND_MODES;
|
|
10
|
+
set blendMode(value: Pixi.BLEND_MODES);
|
|
11
11
|
}
|