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,11 +25,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.BlurFilter = void 0;
|
|
27
27
|
const helpers_lib_1 = require("helpers-lib");
|
|
28
|
-
const
|
|
29
|
-
const
|
|
28
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
29
|
+
const pixi_definitions_1 = require("../../../pixi-definitions");
|
|
30
30
|
const gaussian_values_helper_1 = require("../helpers/gaussian-values.helper");
|
|
31
|
-
class BlurFilterPass extends
|
|
32
|
-
static
|
|
31
|
+
class BlurFilterPass extends Pixi.Filter {
|
|
32
|
+
static _getVertexShader() {
|
|
33
33
|
return `
|
|
34
34
|
attribute vec2 aVertexPosition;
|
|
35
35
|
attribute vec2 aTextureCoord;
|
|
@@ -44,7 +44,7 @@ class BlurFilterPass extends PIXI.Filter {
|
|
|
44
44
|
}
|
|
45
45
|
`;
|
|
46
46
|
}
|
|
47
|
-
static
|
|
47
|
+
static _getFragmentShader(multipliers, isHorizontal) {
|
|
48
48
|
let shader = `
|
|
49
49
|
uniform sampler2D uSampler;
|
|
50
50
|
|
|
@@ -71,44 +71,44 @@ class BlurFilterPass extends PIXI.Filter {
|
|
|
71
71
|
`;
|
|
72
72
|
return shader;
|
|
73
73
|
}
|
|
74
|
-
constructor(strength,
|
|
75
|
-
super(BlurFilterPass.
|
|
76
|
-
this.
|
|
77
|
-
this.resolution =
|
|
74
|
+
constructor(strength, _horizontal) {
|
|
75
|
+
super(BlurFilterPass._getVertexShader(), BlurFilterPass._getFragmentShader(gaussian_values_helper_1.GaussianValuesHelper.getValuesForLinearSamplingGauss(strength), _horizontal));
|
|
76
|
+
this._horizontal = _horizontal;
|
|
77
|
+
this.resolution = pixi_definitions_1.DEFAULT_RESOLUTION;
|
|
78
78
|
}
|
|
79
79
|
apply(filterManager, input, output, clearMode) {
|
|
80
|
-
this.uniforms.pixelSize = this.
|
|
80
|
+
this.uniforms.pixelSize = this._horizontal ? 1 / (input.width * pixi_definitions_1.DEFAULT_RESOLUTION) : 1 / (input.height * pixi_definitions_1.DEFAULT_RESOLUTION);
|
|
81
81
|
filterManager.applyFilter(this, input, output, clearMode);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
class BlurFilter extends
|
|
85
|
-
constructor(
|
|
84
|
+
class BlurFilter extends Pixi.Filter {
|
|
85
|
+
constructor(_strength = new helpers_lib_1.Vector(2, 2)) {
|
|
86
86
|
super();
|
|
87
|
-
this.
|
|
88
|
-
this.resolution =
|
|
89
|
-
this.
|
|
90
|
-
if (this.
|
|
87
|
+
this._strength = _strength;
|
|
88
|
+
this.resolution = pixi_definitions_1.DEFAULT_RESOLUTION;
|
|
89
|
+
this._strength = _strength.multiplyNumber(pixi_definitions_1.DEFAULT_RESOLUTION).floor();
|
|
90
|
+
if (this._strength.x < 0 || this._strength.y < 0) {
|
|
91
91
|
throw new Error('BlurFilterLinearSampling: Strength * Resolution must be greater than 0');
|
|
92
92
|
}
|
|
93
|
-
else if (this.
|
|
93
|
+
else if (this._strength.x > 100 || this._strength.y > 100) {
|
|
94
94
|
throw new Error('BlurFilterLinearSampling: Strength * Resolution cannot be higher than 100');
|
|
95
95
|
}
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
this.padding = Math.max(this.
|
|
96
|
+
this._horizontalFilter = new BlurFilterPass(this._strength.x, true);
|
|
97
|
+
this._verticalFilter = new BlurFilterPass(this._strength.y, false);
|
|
98
|
+
this.padding = Math.max(this._strength.x, this._strength.y);
|
|
99
99
|
}
|
|
100
100
|
apply(filterManager, input, output, clearMode) {
|
|
101
101
|
let renderTarget = filterManager.getFilterTexture();
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
102
|
+
this._verticalFilter.apply(filterManager, input, renderTarget, Pixi.CLEAR_MODES.CLEAR);
|
|
103
|
+
this._horizontalFilter.apply(filterManager, renderTarget, output, clearMode);
|
|
104
104
|
filterManager.returnFilterTexture(renderTarget);
|
|
105
105
|
}
|
|
106
106
|
get blendMode() {
|
|
107
|
-
return this.
|
|
107
|
+
return this._horizontalFilter.blendMode;
|
|
108
108
|
}
|
|
109
109
|
set blendMode(value) {
|
|
110
|
-
this.
|
|
111
|
-
this.
|
|
110
|
+
this._horizontalFilter.blendMode = value;
|
|
111
|
+
this._verticalFilter.blendMode = value;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
exports.BlurFilter = BlurFilter;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RGBColor } from 'helpers-lib';
|
|
2
|
-
import * as
|
|
3
|
-
export declare class ExpandWithColorFilter extends
|
|
4
|
-
private
|
|
5
|
-
private static
|
|
6
|
-
private static
|
|
7
|
-
constructor(
|
|
8
|
-
apply(filterManager:
|
|
2
|
+
import * as Pixi from 'pixi.js';
|
|
3
|
+
export declare class ExpandWithColorFilter extends Pixi.Filter {
|
|
4
|
+
private _expand;
|
|
5
|
+
private static _getVertexShader;
|
|
6
|
+
private static _getFragmentShader;
|
|
7
|
+
constructor(_expand: number, color: RGBColor);
|
|
8
|
+
apply(filterManager: Pixi.FilterSystem, input: Pixi.RenderTexture, output: Pixi.RenderTexture, clearMode: Pixi.CLEAR_MODES): void;
|
|
9
9
|
}
|
|
@@ -25,10 +25,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ExpandWithColorFilter = void 0;
|
|
27
27
|
const helpers_lib_1 = require("helpers-lib");
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
class ExpandWithColorFilter extends
|
|
31
|
-
static
|
|
28
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
29
|
+
const pixi_definitions_1 = require("../../../pixi-definitions");
|
|
30
|
+
class ExpandWithColorFilter extends Pixi.Filter {
|
|
31
|
+
static _getVertexShader() {
|
|
32
32
|
return `
|
|
33
33
|
attribute vec2 aVertexPosition;
|
|
34
34
|
attribute vec2 aTextureCoord;
|
|
@@ -43,7 +43,7 @@ class ExpandWithColorFilter extends PIXI.Filter {
|
|
|
43
43
|
}
|
|
44
44
|
`;
|
|
45
45
|
}
|
|
46
|
-
static
|
|
46
|
+
static _getFragmentShader(expand) {
|
|
47
47
|
let shader = `
|
|
48
48
|
uniform sampler2D uSampler;
|
|
49
49
|
uniform vec2 pixelSize;
|
|
@@ -75,27 +75,27 @@ class ExpandWithColorFilter extends PIXI.Filter {
|
|
|
75
75
|
}`;
|
|
76
76
|
return shader;
|
|
77
77
|
}
|
|
78
|
-
constructor(
|
|
79
|
-
super(ExpandWithColorFilter.
|
|
80
|
-
this.
|
|
81
|
-
this.resolution =
|
|
82
|
-
this.
|
|
83
|
-
if (this.
|
|
78
|
+
constructor(_expand, color) {
|
|
79
|
+
super(ExpandWithColorFilter._getVertexShader(), ExpandWithColorFilter._getFragmentShader(_expand * pixi_definitions_1.DEFAULT_RESOLUTION));
|
|
80
|
+
this._expand = _expand;
|
|
81
|
+
this.resolution = pixi_definitions_1.DEFAULT_RESOLUTION;
|
|
82
|
+
this._expand = _expand * pixi_definitions_1.DEFAULT_RESOLUTION;
|
|
83
|
+
if (this._expand < 0) {
|
|
84
84
|
throw new Error('ExpandWithColorFilter: Expand * resolution cannot be smaller than 0');
|
|
85
85
|
}
|
|
86
|
-
else if (this.
|
|
86
|
+
else if (this._expand > 10) {
|
|
87
87
|
throw new Error('ExpandWithColorFilter: Expand * resolution cannot be higher than 10');
|
|
88
88
|
}
|
|
89
|
-
if (!helpers_lib_1.Comparator.isInteger(this.
|
|
90
|
-
this.
|
|
89
|
+
if (!helpers_lib_1.Comparator.isInteger(this._expand)) {
|
|
90
|
+
this._expand = Math.floor(this._expand);
|
|
91
91
|
}
|
|
92
92
|
let normalizedColor = helpers_lib_1.ColorHelper.normalize(color);
|
|
93
93
|
this.uniforms.color = new Float32Array([normalizedColor.red, normalizedColor.green, normalizedColor.blue]);
|
|
94
|
-
this.uniforms.expandSquared = this.
|
|
95
|
-
this.padding = this.
|
|
94
|
+
this.uniforms.expandSquared = this._expand * this._expand;
|
|
95
|
+
this.padding = this._expand;
|
|
96
96
|
}
|
|
97
97
|
apply(filterManager, input, output, clearMode) {
|
|
98
|
-
this.uniforms.pixelSize = new Float32Array([1 / (input.width *
|
|
98
|
+
this.uniforms.pixelSize = new Float32Array([1 / (input.width * pixi_definitions_1.DEFAULT_RESOLUTION), 1 / (input.height * pixi_definitions_1.DEFAULT_RESOLUTION)]);
|
|
99
99
|
filterManager.applyFilter(this, input, output, clearMode);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { GlowOptions } from '
|
|
3
|
-
export declare class GlowFilter extends
|
|
4
|
-
private
|
|
5
|
-
private
|
|
1
|
+
import * as Pixi from 'pixi.js';
|
|
2
|
+
import { GlowOptions } from '../../../pixi-definitions';
|
|
3
|
+
export declare class GlowFilter extends Pixi.Filter {
|
|
4
|
+
private _expandWithColorFilter;
|
|
5
|
+
private _blurFilter;
|
|
6
6
|
constructor(partialOptions?: Partial<GlowOptions>);
|
|
7
|
-
apply(filterManager:
|
|
7
|
+
apply(filterManager: Pixi.FilterSystem, input: Pixi.RenderTexture, output: Pixi.RenderTexture, clearMode: Pixi.CLEAR_MODES): void;
|
|
8
8
|
}
|
|
@@ -25,34 +25,33 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.GlowFilter = void 0;
|
|
27
27
|
const helpers_lib_1 = require("helpers-lib");
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const game_1 = require("../../../game");
|
|
28
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
29
|
+
const pixi_definitions_1 = require("../../../pixi-definitions");
|
|
31
30
|
const blur_filter_1 = require("../base-filters/blur.filter");
|
|
32
31
|
const expand_with_color_filter_1 = require("../base-filters/expand-with-color.filter");
|
|
33
|
-
class GlowFilter extends
|
|
32
|
+
class GlowFilter extends Pixi.Filter {
|
|
34
33
|
constructor(partialOptions) {
|
|
35
34
|
super();
|
|
36
|
-
this.resolution =
|
|
35
|
+
this.resolution = pixi_definitions_1.DEFAULT_RESOLUTION;
|
|
37
36
|
let options = {
|
|
38
37
|
blurRadius: 1,
|
|
39
38
|
expand: 0,
|
|
40
39
|
color: helpers_lib_1.ColorHelper.white,
|
|
41
|
-
blendMode:
|
|
40
|
+
blendMode: pixi_definitions_1.BlendMode.Screen,
|
|
42
41
|
...partialOptions
|
|
43
42
|
};
|
|
44
|
-
this.
|
|
43
|
+
this._expandWithColorFilter = new expand_with_color_filter_1.ExpandWithColorFilter(options.expand, options.color);
|
|
45
44
|
let blurRadiusVector = helpers_lib_1.Comparator.isNumber(options.blurRadius)
|
|
46
45
|
? new helpers_lib_1.Vector(options.blurRadius, options.blurRadius)
|
|
47
46
|
: options.blurRadius;
|
|
48
|
-
this.
|
|
47
|
+
this._blurFilter = new blur_filter_1.BlurFilter(blurRadiusVector);
|
|
49
48
|
this.padding = Math.max(blurRadiusVector.x, blurRadiusVector.y) + options.expand;
|
|
50
|
-
this.
|
|
49
|
+
this._blurFilter.blendMode = Pixi.BLEND_MODES.SCREEN;
|
|
51
50
|
}
|
|
52
51
|
apply(filterManager, input, output, clearMode) {
|
|
53
52
|
let renderTarget = filterManager.getFilterTexture();
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
53
|
+
this._expandWithColorFilter.apply(filterManager, input, renderTarget, Pixi.CLEAR_MODES.CLEAR);
|
|
54
|
+
this._blurFilter.apply(filterManager, renderTarget, output, clearMode);
|
|
56
55
|
filterManager.returnFilterTexture(renderTarget);
|
|
57
56
|
}
|
|
58
57
|
}
|
|
@@ -3,8 +3,8 @@ export interface BlurFilterMultipliers {
|
|
|
3
3
|
multiplier: number;
|
|
4
4
|
}
|
|
5
5
|
export declare class GaussianValuesHelper {
|
|
6
|
-
private static
|
|
6
|
+
private static _gaussianKernel;
|
|
7
7
|
static getValuesForLinearSamplingPascal(strength: number): BlurFilterMultipliers[];
|
|
8
8
|
static getValuesForLinearSamplingGauss(strength: number): BlurFilterMultipliers[];
|
|
9
|
-
private static
|
|
9
|
+
private static _convertValuesToDiscreteSampling;
|
|
10
10
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GaussianValuesHelper = void 0;
|
|
4
4
|
const helpers_lib_1 = require("helpers-lib");
|
|
5
5
|
class GaussianValuesHelper {
|
|
6
|
-
static
|
|
6
|
+
static _gaussianKernel(x, sigma) {
|
|
7
7
|
let sigmaSquared = sigma * sigma;
|
|
8
8
|
let coefficient = 1 / (helpers_lib_1.PI_360 * sigmaSquared);
|
|
9
9
|
let exponent = -(x * x) / (2 * sigmaSquared);
|
|
@@ -25,7 +25,7 @@ class GaussianValuesHelper {
|
|
|
25
25
|
});
|
|
26
26
|
let multiplier = 1 / sumOfRow;
|
|
27
27
|
let values = acceptedValues.map(value => value * multiplier);
|
|
28
|
-
return this.
|
|
28
|
+
return this._convertValuesToDiscreteSampling(values);
|
|
29
29
|
}
|
|
30
30
|
static getValuesForLinearSamplingGauss(strength) {
|
|
31
31
|
if (strength === 0) {
|
|
@@ -38,14 +38,14 @@ class GaussianValuesHelper {
|
|
|
38
38
|
];
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
let values = helpers_lib_1.ArrayHelper.createIntegerArray(Math.ceil(strength * 0.75)).map(x => this.
|
|
41
|
+
let values = helpers_lib_1.ArrayHelper.createIntegerArray(Math.ceil(strength * 0.75)).map(x => this._gaussianKernel(x, strength * 0.4));
|
|
42
42
|
let sum = values.reduce((acc, value) => acc + value, 0);
|
|
43
43
|
sum = sum * 2 - values[0];
|
|
44
44
|
values = values.map(value => value / sum);
|
|
45
|
-
return this.
|
|
45
|
+
return this._convertValuesToDiscreteSampling(values);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
static
|
|
48
|
+
static _convertValuesToDiscreteSampling(values) {
|
|
49
49
|
let result = [{ offset: 0, multiplier: values[0] }];
|
|
50
50
|
for (let i = 1; i < values.length - 1; i += 2) {
|
|
51
51
|
let multiplier = values[i] + values[i + 1];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export declare class CheckingNeighborsTemplate extends
|
|
3
|
-
private static
|
|
4
|
-
private static
|
|
1
|
+
import * as Pixi from 'pixi.js';
|
|
2
|
+
export declare class CheckingNeighborsTemplate extends Pixi.Filter {
|
|
3
|
+
private static _getVertexShader;
|
|
4
|
+
private static _getFragmentShader;
|
|
5
5
|
constructor();
|
|
6
|
-
apply(filterManager:
|
|
6
|
+
apply(filterManager: Pixi.FilterSystem, input: Pixi.RenderTexture, output: Pixi.RenderTexture, clearMode: Pixi.CLEAR_MODES): void;
|
|
7
7
|
}
|
|
@@ -24,10 +24,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.CheckingNeighborsTemplate = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
class CheckingNeighborsTemplate extends
|
|
30
|
-
static
|
|
27
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
28
|
+
const pixi_definitions_1 = require("../../../pixi-definitions");
|
|
29
|
+
class CheckingNeighborsTemplate extends Pixi.Filter {
|
|
30
|
+
static _getVertexShader() {
|
|
31
31
|
return `
|
|
32
32
|
attribute vec2 aVertexPosition;
|
|
33
33
|
attribute vec2 aTextureCoord;
|
|
@@ -42,7 +42,7 @@ class CheckingNeighborsTemplate extends PIXI.Filter {
|
|
|
42
42
|
}
|
|
43
43
|
`;
|
|
44
44
|
}
|
|
45
|
-
static
|
|
45
|
+
static _getFragmentShader() {
|
|
46
46
|
return `
|
|
47
47
|
uniform sampler2D uSampler;
|
|
48
48
|
uniform vec2 pixelSize;
|
|
@@ -62,11 +62,11 @@ class CheckingNeighborsTemplate extends PIXI.Filter {
|
|
|
62
62
|
`;
|
|
63
63
|
}
|
|
64
64
|
constructor() {
|
|
65
|
-
super(CheckingNeighborsTemplate.
|
|
66
|
-
this.resolution =
|
|
65
|
+
super(CheckingNeighborsTemplate._getVertexShader(), CheckingNeighborsTemplate._getFragmentShader());
|
|
66
|
+
this.resolution = pixi_definitions_1.DEFAULT_RESOLUTION;
|
|
67
67
|
}
|
|
68
68
|
apply(filterManager, input, output, clearMode) {
|
|
69
|
-
this.uniforms.pixelSize = new Float32Array([1 / (input.width *
|
|
69
|
+
this.uniforms.pixelSize = new Float32Array([1 / (input.width * pixi_definitions_1.DEFAULT_RESOLUTION), 1 / (input.height * pixi_definitions_1.DEFAULT_RESOLUTION)]);
|
|
70
70
|
filterManager.applyFilter(this, input, output, clearMode);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
export declare class PlaneTemplate extends
|
|
3
|
-
private static
|
|
4
|
-
private static
|
|
1
|
+
import * as Pixi from 'pixi.js';
|
|
2
|
+
export declare class PlaneTemplate extends Pixi.Filter {
|
|
3
|
+
private static _getVertexShader;
|
|
4
|
+
private static _getFragmentShader;
|
|
5
5
|
constructor();
|
|
6
|
-
apply(filterManager:
|
|
6
|
+
apply(filterManager: Pixi.FilterSystem, input: Pixi.RenderTexture, output: Pixi.RenderTexture, clearMode: Pixi.CLEAR_MODES): void;
|
|
7
7
|
}
|
|
@@ -24,10 +24,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.PlaneTemplate = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
class PlaneTemplate extends
|
|
30
|
-
static
|
|
27
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
28
|
+
const pixi_definitions_1 = require("../../../pixi-definitions");
|
|
29
|
+
class PlaneTemplate extends Pixi.Filter {
|
|
30
|
+
static _getVertexShader() {
|
|
31
31
|
return `
|
|
32
32
|
attribute vec2 aVertexPosition;
|
|
33
33
|
attribute vec2 aTextureCoord;
|
|
@@ -42,7 +42,7 @@ class PlaneTemplate extends PIXI.Filter {
|
|
|
42
42
|
}
|
|
43
43
|
`;
|
|
44
44
|
}
|
|
45
|
-
static
|
|
45
|
+
static _getFragmentShader() {
|
|
46
46
|
return `
|
|
47
47
|
uniform sampler2D uSampler;
|
|
48
48
|
|
|
@@ -54,8 +54,8 @@ class PlaneTemplate extends PIXI.Filter {
|
|
|
54
54
|
`;
|
|
55
55
|
}
|
|
56
56
|
constructor() {
|
|
57
|
-
super(PlaneTemplate.
|
|
58
|
-
this.resolution =
|
|
57
|
+
super(PlaneTemplate._getVertexShader(), PlaneTemplate._getFragmentShader());
|
|
58
|
+
this.resolution = pixi_definitions_1.DEFAULT_RESOLUTION;
|
|
59
59
|
}
|
|
60
60
|
apply(filterManager, input, output, clearMode) {
|
|
61
61
|
filterManager.applyFilter(this, input, output, clearMode);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Vector } from 'helpers-lib';
|
|
2
|
-
import * as
|
|
2
|
+
import * as Pixi from 'pixi.js';
|
|
3
3
|
export declare class Filters {
|
|
4
|
-
private
|
|
5
|
-
private
|
|
4
|
+
private _container;
|
|
5
|
+
private _colorMatrix;
|
|
6
6
|
private _red;
|
|
7
7
|
get red(): number;
|
|
8
8
|
set red(value: number);
|
|
@@ -18,12 +18,12 @@ export declare class Filters {
|
|
|
18
18
|
private _contrast;
|
|
19
19
|
get contrast(): number;
|
|
20
20
|
set contrast(value: number);
|
|
21
|
-
private
|
|
21
|
+
private _blurFilter;
|
|
22
22
|
private _blur;
|
|
23
23
|
get blur(): Vector | undefined;
|
|
24
24
|
set blur(value: Vector | number | undefined);
|
|
25
|
-
constructor(
|
|
25
|
+
constructor(_container: Pixi.Container);
|
|
26
26
|
removeColorFilter(): void;
|
|
27
|
-
private
|
|
28
|
-
private
|
|
27
|
+
private _refreshColorMatrix;
|
|
28
|
+
private _onFilterChange;
|
|
29
29
|
}
|
|
@@ -25,8 +25,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Filters = void 0;
|
|
27
27
|
const helpers_lib_1 = require("helpers-lib");
|
|
28
|
-
const
|
|
29
|
-
const
|
|
28
|
+
const Pixi = __importStar(require("pixi.js"));
|
|
29
|
+
const pixi_definitions_1 = require("../pixi-definitions");
|
|
30
30
|
const blur_filter_1 = require("./filters/base-filters/blur.filter");
|
|
31
31
|
class Filters {
|
|
32
32
|
get red() {
|
|
@@ -34,35 +34,35 @@ class Filters {
|
|
|
34
34
|
}
|
|
35
35
|
set red(value) {
|
|
36
36
|
this._red = value;
|
|
37
|
-
this.
|
|
37
|
+
this._refreshColorMatrix();
|
|
38
38
|
}
|
|
39
39
|
get green() {
|
|
40
40
|
return this._green;
|
|
41
41
|
}
|
|
42
42
|
set green(value) {
|
|
43
43
|
this._green = value;
|
|
44
|
-
this.
|
|
44
|
+
this._refreshColorMatrix();
|
|
45
45
|
}
|
|
46
46
|
get blue() {
|
|
47
47
|
return this._blue;
|
|
48
48
|
}
|
|
49
49
|
set blue(value) {
|
|
50
50
|
this._blue = value;
|
|
51
|
-
this.
|
|
51
|
+
this._refreshColorMatrix();
|
|
52
52
|
}
|
|
53
53
|
get brightness() {
|
|
54
54
|
return this._brightness;
|
|
55
55
|
}
|
|
56
56
|
set brightness(value) {
|
|
57
57
|
this._brightness = value;
|
|
58
|
-
this.
|
|
58
|
+
this._refreshColorMatrix();
|
|
59
59
|
}
|
|
60
60
|
get contrast() {
|
|
61
61
|
return this._contrast;
|
|
62
62
|
}
|
|
63
63
|
set contrast(value) {
|
|
64
64
|
this._contrast = value;
|
|
65
|
-
this.
|
|
65
|
+
this._refreshColorMatrix();
|
|
66
66
|
}
|
|
67
67
|
get blur() {
|
|
68
68
|
return this._blur;
|
|
@@ -73,46 +73,46 @@ class Filters {
|
|
|
73
73
|
(this._blur && !blurVector) ||
|
|
74
74
|
(!this._blur && blurVector)) {
|
|
75
75
|
this._blur = blurVector;
|
|
76
|
-
if (this.
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
76
|
+
if (this._blurFilter) {
|
|
77
|
+
this._blurFilter.destroy();
|
|
78
|
+
this._blurFilter = undefined;
|
|
79
79
|
}
|
|
80
80
|
if (blurVector) {
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
81
|
+
this._blurFilter = new blur_filter_1.BlurFilter(blurVector);
|
|
82
|
+
this._onFilterChange();
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
constructor(
|
|
87
|
-
this.
|
|
86
|
+
constructor(_container) {
|
|
87
|
+
this._container = _container;
|
|
88
88
|
this._red = 1;
|
|
89
89
|
this._green = 1;
|
|
90
90
|
this._blue = 1;
|
|
91
91
|
this._brightness = 1;
|
|
92
92
|
this._contrast = 1;
|
|
93
|
-
this.
|
|
93
|
+
this._onFilterChange();
|
|
94
94
|
}
|
|
95
95
|
removeColorFilter() {
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
96
|
+
this._colorMatrix?.destroy();
|
|
97
|
+
this._colorMatrix = undefined;
|
|
98
|
+
this._onFilterChange();
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
_refreshColorMatrix() {
|
|
101
101
|
if (this._red === 1 && this._green === 1 && this._blue === 1 && this._brightness === 1 && this._contrast === 1) {
|
|
102
|
-
if (this.
|
|
103
|
-
this.
|
|
104
|
-
this.
|
|
105
|
-
this.
|
|
102
|
+
if (this._colorMatrix) {
|
|
103
|
+
this._colorMatrix.destroy();
|
|
104
|
+
this._colorMatrix = undefined;
|
|
105
|
+
this._onFilterChange();
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
else {
|
|
109
|
-
if (!this.
|
|
110
|
-
this.
|
|
111
|
-
this.
|
|
112
|
-
this.
|
|
109
|
+
if (!this._colorMatrix) {
|
|
110
|
+
this._colorMatrix = new Pixi.ColorMatrixFilter();
|
|
111
|
+
this._colorMatrix.resolution = pixi_definitions_1.DEFAULT_RESOLUTION;
|
|
112
|
+
this._onFilterChange();
|
|
113
113
|
}
|
|
114
114
|
// prettier-ignore
|
|
115
|
-
this.
|
|
115
|
+
this._colorMatrix.matrix = [
|
|
116
116
|
this._red * this._contrast,
|
|
117
117
|
0,
|
|
118
118
|
0,
|
|
@@ -136,15 +136,15 @@ class Filters {
|
|
|
136
136
|
];
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
_onFilterChange() {
|
|
140
140
|
let filters = [];
|
|
141
|
-
if (this.
|
|
142
|
-
filters.push(this.
|
|
141
|
+
if (this._blurFilter) {
|
|
142
|
+
filters.push(this._blurFilter);
|
|
143
143
|
}
|
|
144
|
-
if (this.
|
|
145
|
-
filters.push(this.
|
|
144
|
+
if (this._colorMatrix) {
|
|
145
|
+
filters.push(this._colorMatrix);
|
|
146
146
|
}
|
|
147
|
-
this.
|
|
147
|
+
this._container.filters = filters;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
exports.Filters = Filters;
|
|
@@ -4,6 +4,6 @@ export { Graphics } from './objects/graphics/graphics';
|
|
|
4
4
|
export { CreateDashedLineOptions } from './objects/graphics/helpers/dashed-line.helper';
|
|
5
5
|
export { Placeholder } from './objects/placeholder';
|
|
6
6
|
export { Sprite } from './objects/sprite/sprite';
|
|
7
|
-
export { DropShadowOptions, PartialTextOptions, TextOptions } from './objects/text/helpers/process-steps/1-data-in-converter/pixi-text-style-converter';
|
|
7
|
+
export { DropShadowOptions, PartialTextOptions, TextAlignment, TextOptions } from './objects/text/helpers/process-steps/1-data-in-converter/pixi-text-style-converter';
|
|
8
8
|
export { RichText, RichTextOptions, RichTextRectangleCut, RichTextStyles } from './objects/text/rich-text';
|
|
9
9
|
export { Text } from './objects/text/text';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RGBColor, Vector } from 'helpers-lib';
|
|
2
|
-
import * as
|
|
3
|
-
import { PolygonDefinition } from '
|
|
2
|
+
import * as Pixi from 'pixi.js';
|
|
3
|
+
import { PolygonDefinition } from '../../../pixi-definitions';
|
|
4
4
|
import { Container } from '../../container';
|
|
5
5
|
import { Sprite } from '../sprite/sprite';
|
|
6
6
|
import { CreateDashedLineOptions } from './helpers/dashed-line.helper';
|
|
7
7
|
export interface TextureOfGraphics {
|
|
8
|
-
readonly
|
|
8
|
+
readonly assetID: string;
|
|
9
9
|
readonly bounds: Vector;
|
|
10
10
|
}
|
|
11
11
|
export interface ToSpriteOptions {
|
|
@@ -14,7 +14,7 @@ export interface ToSpriteOptions {
|
|
|
14
14
|
readonly keepBounds: boolean;
|
|
15
15
|
}
|
|
16
16
|
export declare class Graphics extends Container {
|
|
17
|
-
private static
|
|
17
|
+
private static _drawnTextureCache;
|
|
18
18
|
static createArrow(size: number, color: RGBColor): Graphics;
|
|
19
19
|
static createDashedLine(from: Vector, to: Vector, partialOptions?: Partial<CreateDashedLineOptions>): Graphics;
|
|
20
20
|
static createVector(from: Vector, to: Vector, color: RGBColor): Graphics;
|
|
@@ -24,11 +24,11 @@ export declare class Graphics extends Container {
|
|
|
24
24
|
static createElipse(size: Vector, color: RGBColor): Graphics;
|
|
25
25
|
static createPolygon(polygon: PolygonDefinition, color: RGBColor): Graphics;
|
|
26
26
|
static createRegularPolygon(sides: number, radius: number, color: RGBColor): Graphics;
|
|
27
|
-
readonly pixiGraphics:
|
|
28
|
-
private
|
|
29
|
-
protected constructor(pixiGraphics:
|
|
27
|
+
readonly pixiGraphics: Pixi.Graphics;
|
|
28
|
+
private _cacheName;
|
|
29
|
+
protected constructor(pixiGraphics: Pixi.Graphics, cacheName: string);
|
|
30
30
|
destroy(): void;
|
|
31
31
|
toSprite(partialOptions?: Partial<ToSpriteOptions>): Sprite;
|
|
32
|
-
private
|
|
33
|
-
private
|
|
32
|
+
private _getTexture;
|
|
33
|
+
private _createTextureFromGraphics;
|
|
34
34
|
}
|