bard-legends-framework 0.9.6 → 0.9.7
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/_interfaces/index.d.ts +2 -2
- package/dist/_interfaces/index.js +2 -3
- package/dist/game-entities/attachable/attachable.d.ts +6 -6
- package/dist/game-entities/attachable/attachable.js +28 -30
- package/dist/game-entities/attachable/attachable.spec.js +129 -128
- package/dist/game-entities/attachable/attachable.store.d.ts +5 -5
- package/dist/game-entities/attachable/attachable.store.js +34 -32
- package/dist/game-entities/attachable/attachable.test.js +132 -131
- package/dist/game-entities/attachable/destroyable.d.ts +13 -13
- package/dist/game-entities/attachable/destroyable.js +64 -69
- package/dist/game-entities/attachable/helpers/decorate-actions-lib.d.ts +15 -15
- package/dist/game-entities/attachable/helpers/decorate-actions-lib.js +125 -116
- package/dist/game-entities/attachable/helpers/referance-variable.d.ts +15 -15
- package/dist/game-entities/attachable/helpers/referance-variable.js +47 -48
- package/dist/game-entities/attachable/interfaces.d.ts +6 -6
- package/dist/game-entities/attachable/interfaces.js +2 -3
- package/dist/game-entities/base/helpers/decorate-actions-lib.js +0 -1
- package/dist/game-entities/controller/controller.js +0 -1
- package/dist/game-entities/controller/controller.spec.js +128 -125
- package/dist/game-entities/entity/entity.spec.js +263 -293
- package/dist/game-entities/entity/helpers/view-creation.helper.d.ts +7 -7
- package/dist/game-entities/entity/helpers/view-creation.helper.js +48 -48
- package/dist/game-entities/scene/scene.spec.js +219 -223
- package/dist/game-entities/service/service.js +0 -4
- package/dist/game-entities/service/service.spec.js +265 -237
- package/dist/game-entities/service/service.test.js +4 -2
- package/dist/game-entities/update-loop.d.ts +18 -18
- package/dist/game-entities/update-loop.js +46 -28
- package/dist/game-entities/view/view.spec.js +490 -506
- package/dist/game-entities/view/view.test.js +1 -1
- package/dist/lib/animator/animations.d.ts +13 -13
- package/dist/lib/animator/animations.js +43 -40
- package/dist/lib/animator/animator.d.ts +41 -41
- package/dist/lib/animator/animator.js +194 -197
- package/dist/lib/animator/animator.spec.js +699 -612
- package/dist/lib/animator/index.js +24 -19
- package/dist/lib/libraries/animator/animations.d.ts +13 -13
- package/dist/lib/libraries/animator/animations.js +43 -40
- package/dist/lib/libraries/animator/animator.d.ts +41 -41
- package/dist/lib/libraries/animator/animator.js +194 -197
- package/dist/lib/libraries/animator/animator.spec.js +699 -612
- package/dist/lib/libraries/animator/index.js +24 -19
- package/dist/lib/libraries/path-finder/path-finder.d.ts +2 -2
- package/dist/lib/libraries/path-finder/path-finder.js +19 -20
- package/dist/lib/path-finder/path-finder.d.ts +2 -2
- package/dist/lib/path-finder/path-finder.js +19 -20
- package/dist/lib/services/keyboard/keyboard.d.ts +4 -4
- package/dist/lib/services/keyboard/keyboard.js +39 -31
- package/dist/lib/services/mouse/mouse.service.d.ts +8 -8
- package/dist/lib/services/mouse/mouse.service.js +65 -53
- package/dist/lib/services/mouse/mouser-target-focus.service.d.ts +11 -11
- package/dist/lib/services/mouse/mouser-target-focus.service.js +83 -81
- package/dist/lib/update-loop.d.ts +10 -10
- package/dist/lib/update-loop.js +35 -27
- package/dist/physics/entitity-types/immovable-physics-entity.d.ts +6 -6
- package/dist/physics/entitity-types/immovable-physics-entity.js +23 -24
- package/dist/physics/entitity-types/movable-entity.d.ts +6 -6
- package/dist/physics/entitity-types/movable-entity.js +21 -22
- package/dist/physics/entitity-types/movable-physics-entity.d.ts +14 -14
- package/dist/physics/entitity-types/movable-physics-entity.js +83 -88
- package/dist/physics/entitity-types/physics-entity.d.ts +23 -23
- package/dist/physics/entitity-types/physics-entity.js +97 -88
- package/dist/physics/helpers/closest-available-space.helper.d.ts +16 -16
- package/dist/physics/helpers/closest-available-space.helper.js +98 -96
- package/dist/physics/helpers/closest-available-space.helper.spec.js +115 -68
- package/dist/physics/helpers/p2js.helper.d.ts +3 -3
- package/dist/physics/helpers/p2js.helper.js +21 -22
- package/dist/physics/helpers/shape-factory.d.ts +9 -4
- package/dist/physics/helpers/shape-factory.js +99 -75
- package/dist/physics/libs/p2js.helper.js +1 -1
- package/dist/physics/libs/position-to-grid-position-converter.d.ts +3 -3
- package/dist/physics/libs/position-to-grid-position-converter.js +15 -13
- package/dist/physics/module//360/237/223/220services/availability-grid.service.d.ts +10 -5
- package/dist/physics/module//360/237/223/220services/availability-grid.service.js +77 -57
- package/dist/physics/module//360/237/223/220services/border.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/border.service.js +57 -37
- package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.js +1 -1
- package/dist/physics/module//360/237/223/220services/collisions.service.d.ts +7 -7
- package/dist/physics/module//360/237/223/220services/collisions.service.js +110 -98
- package/dist/physics/module//360/237/223/220services/debug-visuals.service.d.ts +28 -6
- package/dist/physics/module//360/237/223/220services/debug-visuals.service.js +121 -89
- package/dist/physics/module//360/237/223/220services/eliptic-explosion.service.d.ts +15 -7
- package/dist/physics/module//360/237/223/220services/eliptic-explosion.service.js +117 -93
- package/dist/physics/module//360/237/223/220services/explosion.service.d.ts +14 -7
- package/dist/physics/module//360/237/223/220services/explosion.service.js +102 -77
- package/dist/physics/module//360/237/223/220services/explosions/eliptic-explosion.service.d.ts +15 -7
- package/dist/physics/module//360/237/223/220services/explosions/eliptic-explosion.service.js +117 -93
- package/dist/physics/module//360/237/223/220services/explosions/explosion.service.d.ts +14 -7
- package/dist/physics/module//360/237/223/220services/explosions/explosion.service.js +102 -77
- package/dist/physics/module//360/237/223/220services/explosions/helpers/ray-cast-hit-converter.d.ts +3 -3
- package/dist/physics/module//360/237/223/220services/explosions/helpers/ray-cast-hit-converter.js +71 -67
- package/dist/physics/module//360/237/223/220services/helpers/ray-cast-hit-converter.d.ts +3 -3
- package/dist/physics/module//360/237/223/220services/helpers/ray-cast-hit-converter.js +71 -67
- package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.js +1 -1
- package/dist/physics/module//360/237/223/220services/materials.service.d.ts +16 -11
- package/dist/physics/module//360/237/223/220services/materials.service.js +118 -108
- package/dist/physics/module//360/237/223/220services/path-finder.service.d.ts +19 -8
- package/dist/physics/module//360/237/223/220services/path-finder.service.js +121 -82
- package/dist/physics/module//360/237/223/220services/physics-world.service.d.ts +30 -15
- package/dist/physics/module//360/237/223/220services/physics-world.service.js +122 -100
- package/dist/physics/module//360/237/223/220services/ray-casting.service.d.ts +3 -3
- package/dist/physics/module//360/237/223/220services/ray-casting.service.js +87 -86
- package/dist/physics/module//360/237/223/220services/shape-creation.service.d.ts +9 -4
- package/dist/physics/module//360/237/223/220services/shape-creation.service.js +113 -84
- package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.js +2 -1
- package/dist/physics/module//360/237/247/212entities/data-structures/availability-grid-cache.d.ts +8 -8
- package/dist/physics/module//360/237/247/212entities/data-structures/availability-grid-cache.js +32 -33
- package/dist/physics/physics-world.d.ts +50 -34
- package/dist/physics/physics-world.js +142 -133
- package/dist/physics/sub-elements/available-spaces/helpers/availability-grid.helper.d.ts +3 -3
- package/dist/physics/sub-elements/available-spaces/helpers/availability-grid.helper.js +15 -13
- package/dist/physics/sub-elements/available-spaces/physics-availability-grid.d.ts +9 -9
- package/dist/physics/sub-elements/available-spaces/physics-availability-grid.js +82 -77
- package/dist/physics/sub-elements/available-spaces/physics-available-spaces.d.ts +18 -14
- package/dist/physics/sub-elements/available-spaces/physics-available-spaces.js +91 -79
- package/dist/physics/sub-elements/collisions/contact-equation-orginiser.d.ts +11 -11
- package/dist/physics/sub-elements/collisions/contact-equation-orginiser.js +84 -76
- package/dist/physics/sub-elements/collisions/physics-collision.d.ts +7 -7
- package/dist/physics/sub-elements/collisions/physics-collision.js +43 -44
- package/dist/physics/sub-elements/elements/physics-body-groups.d.ts +11 -11
- package/dist/physics/sub-elements/elements/physics-body-groups.js +54 -54
- package/dist/physics/sub-elements/elements/physics-materials.d.ts +15 -10
- package/dist/physics/sub-elements/elements/physics-materials.js +101 -100
- package/dist/physics/sub-elements/elements/physics-world-borders.d.ts +3 -3
- package/dist/physics/sub-elements/elements/physics-world-borders.js +69 -45
- package/dist/physics/sub-elements/physics-body-groups.d.ts +8 -8
- package/dist/physics/sub-elements/physics-body-groups.js +41 -42
- package/dist/physics/sub-elements/physics-collision.d.ts +16 -16
- package/dist/physics/sub-elements/physics-collision.js +141 -121
- package/dist/physics/sub-elements/physics-materials.d.ts +15 -10
- package/dist/physics/sub-elements/physics-materials.js +101 -100
- package/dist/physics/sub-elements/physics-world-borders.d.ts +2 -2
- package/dist/physics/sub-elements/physics-world-borders.js +25 -26
- package/dist/physics/sub-elements/raycasting/physics-body-explosion-hit.d.ts +15 -11
- package/dist/physics/sub-elements/raycasting/physics-body-explosion-hit.js +59 -59
- package/dist/physics/sub-elements/raycasting/physics-explosion.d.ts +13 -6
- package/dist/physics/sub-elements/raycasting/physics-explosion.js +108 -73
- package/dist/physics/sub-elements/raycasting/ray-cast.d.ts +19 -19
- package/dist/physics/sub-elements/raycasting/ray-cast.js +93 -98
- package/dist/pixi/display-object/components/filters.d.ts +18 -18
- package/dist/pixi/display-object/components/filters.js +106 -81
- package/dist/pixi/display-object/components/glow-effect.d.ts +8 -8
- package/dist/pixi/display-object/components/glow-effect.js +33 -36
- package/dist/pixi/display-object/components/glow-filter.d.ts +8 -8
- package/dist/pixi/display-object/components/glow-filter.js +33 -36
- package/dist/pixi/display-object/container-attributes.js +1 -1
- package/dist/pixi/display-object/display-object-attributes.d.ts +41 -41
- package/dist/pixi/display-object/display-object-attributes.js +148 -150
- package/dist/pixi/display-object/display-object.d.ts +17 -17
- package/dist/pixi/display-object/display-object.js +79 -75
- package/dist/pixi/display-object/filters/base-filters/alpha-primer-color.filter.d.ts +9 -4
- package/dist/pixi/display-object/filters/base-filters/alpha-primer-color.filter.js +89 -77
- package/dist/pixi/display-object/filters/base-filters/blur.filter.js +30 -30
- package/dist/pixi/display-object/filters/base-filters/contrast-filter.d.ts +9 -4
- package/dist/pixi/display-object/filters/base-filters/contrast-filter.js +62 -53
- package/dist/pixi/display-object/filters/base-filters/expand-with-alpha-color.d.ts +10 -5
- package/dist/pixi/display-object/filters/base-filters/expand-with-alpha-color.js +93 -81
- package/dist/pixi/display-object/filters/base-filters/expand-with-color-gradient.d.ts +12 -7
- package/dist/pixi/display-object/filters/base-filters/expand-with-color-gradient.js +120 -109
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.d.ts +10 -5
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.js +32 -32
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.js +92 -85
- package/dist/pixi/display-object/filters/templates/checking-neighbors.template.js +28 -28
- package/dist/pixi/display-object/filters/templates/plane.template.js +20 -20
- package/dist/pixi/display-object/filters.js +20 -4
- package/dist/pixi/display-object/objects/components/filters.d.ts +18 -18
- package/dist/pixi/display-object/objects/components/filters.js +106 -81
- package/dist/pixi/display-object/objects/container.d.ts +2 -2
- package/dist/pixi/display-object/objects/container.js +39 -30
- package/dist/pixi/display-object/objects/graphics.d.ts +28 -28
- package/dist/pixi/display-object/objects/graphics.js +218 -202
- package/dist/pixi/display-object/objects/helpers/filters.d.ts +25 -25
- package/dist/pixi/display-object/objects/helpers/filters.js +150 -124
- package/dist/pixi/display-object/objects/helpers/glow-sprite-generator.d.ts +7 -7
- package/dist/pixi/display-object/objects/helpers/glow-sprite-generator.js +114 -95
- package/dist/pixi/display-object/objects/premade-objects/sprite-with-glowing-shapes.d.ts +5 -5
- package/dist/pixi/display-object/objects/premade-objects/sprite-with-glowing-shapes.js +81 -57
- package/dist/pixi/display-object/objects/sprite.d.ts +43 -43
- package/dist/pixi/display-object/objects/sprite.js +248 -233
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.js +1 -1
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.test.js +9 -9
- package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.d.ts +1 -1
- package/dist/pixi/display-object/objects/text.d.ts +25 -25
- package/dist/pixi/display-object/objects/text.js +111 -102
- package/dist/pixi/display-object/premade-objects/sprite-with-glowing-shapes.d.ts +13 -9
- package/dist/pixi/display-object/premade-objects/sprite-with-glowing-shapes.js +96 -67
- package/dist/pixi/game.d.ts +1 -1
- package/dist/pixi/game.js +2 -2
- package/dist/pixi/helpers/glow-sprite-generator.d.ts +6 -6
- package/dist/pixi/helpers/glow-sprite-generator.js +99 -84
- package/dist/pixi/helpers/pixi-container.helper.d.ts +1 -1
- package/dist/pixi/helpers/pixi-container.helper.js +10 -8
- package/dist/pixi/helpers/screen-position-to-stage.helper.d.ts +1 -1
- package/dist/pixi/helpers/screen-position-to-stage.helper.js +12 -12
- package/dist/pixi/helpers/screen-position-to-stage.helper.test.js +174 -79
- package/dist/pixi/modules/CAMERA/index.d.ts +1 -1
- package/dist/pixi/modules/CAMERA/index.js +3 -3
- package/dist/services/keyboard/keyboard.d.ts +4 -4
- package/dist/services/keyboard/keyboard.js +39 -31
- package/dist/services/mouse/mouse.service.d.ts +8 -8
- package/dist/services/mouse/mouse.service.js +65 -53
- package/dist/services/mouse/mouser-target-focus.service.d.ts +11 -11
- package/dist/services/mouse/mouser-target-focus.service.js +83 -81
- package/dist/utilities/libraries/animator/animating-content/state-animation.d.ts +29 -26
- package/dist/utilities/libraries/animator/animating-content/state-animation.js +159 -165
- package/dist/utilities/libraries/animator/animating-content/state-animation.test.js +386 -375
- package/dist/utilities/libraries/animator/animator.spec.js +765 -656
- package/dist/utilities/libraries/binary-heap/binary-heap.d.ts +11 -11
- package/dist/utilities/libraries/binary-heap/binary-heap.js +79 -81
- package/dist/utilities/libraries/data-structures/binary-heap/binary-heap.d.ts +11 -11
- package/dist/utilities/libraries/data-structures/binary-heap/binary-heap.js +79 -81
- package/dist/utilities/libraries/data-structures/grid/grid.d.ts +35 -31
- package/dist/utilities/libraries/data-structures/grid/grid.js +128 -117
- package/dist/utilities/libraries/data-structures/grid/grid.spec.js +176 -138
- package/dist/utilities/libraries/data-structures/grid/grid.test.js +218 -141
- package/dist/utilities/libraries/data-structures/grid/position-to-grid-position-converter.d.ts +3 -3
- package/dist/utilities/libraries/data-structures/grid/position-to-grid-position-converter.js +15 -13
- package/dist/utilities/libraries/data-structures/queue/queue.d.ts +21 -21
- package/dist/utilities/libraries/data-structures/queue/queue.js +63 -66
- package/dist/utilities/libraries/data-structures/queue/queue.test.js +54 -55
- package/dist/utilities/libraries/grid-algorithms/closest-available-space/closest-available-space.helper.spec.js +122 -68
- package/dist/utilities/libraries/grid-algorithms/path-finder/path-finder.spec.js +140 -135
- package/dist/utilities/libraries/grid-algorithms/vector-field-path-finder/vector-field-path-finder.spec.js +293 -229
- package/dist/utilities/libraries/path-finder/path-finder.d.ts +7 -7
- package/dist/utilities/libraries/path-finder/path-finder.js +113 -109
- package/dist/utilities/libraries/path-finder/path-finder.spec.js +131 -106
- package/dist/utilities/services/keyboard/keyboard.d.ts +4 -4
- package/dist/utilities/services/keyboard/keyboard.js +42 -34
- package/dist/utilities/services/mouse/helpers/mouse-position.helper.d.ts +1 -1
- package/dist/utilities/services/mouse/helpers/mouse-position.helper.js +12 -12
- package/dist/utilities/services/mouse/helpers/mouse-position.helper.test.js +168 -73
- package/dist/utilities/services/mouse/mouse-target-focus.service.d.ts +15 -15
- package/dist/utilities/services/mouse/mouse-target-focus.service.js +79 -76
- package/dist/utilities/services/mouse/mouse.service.d.ts +9 -9
- package/dist/utilities/services/mouse/mouse.service.js +86 -72
- package/dist/utilities/services/mouse/mouser-target-focus.service.d.ts +11 -11
- package/dist/utilities/services/mouse/mouser-target-focus.service.js +83 -81
- package/package.json +4 -10
|
@@ -1,154 +1,152 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
2
|
exports.DisplayObjectAttributes = void 0;
|
|
4
|
-
const helpers_lib_1 = require(
|
|
3
|
+
const helpers_lib_1 = require('helpers-lib');
|
|
5
4
|
class DisplayObjectAttributes {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
5
|
+
constructor(pixiContainer) {
|
|
6
|
+
this.pixiContainer = pixiContainer;
|
|
7
|
+
this.isMirror = false;
|
|
8
|
+
}
|
|
9
|
+
get size() {
|
|
10
|
+
return new helpers_lib_1.Vector(this.pixiContainer.width, this.pixiContainer.height);
|
|
11
|
+
}
|
|
12
|
+
setPosition(value) {
|
|
13
|
+
this.position = value;
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
get position() {
|
|
17
|
+
return new helpers_lib_1.Vector(this.pixiContainer.x, this.pixiContainer.y);
|
|
18
|
+
}
|
|
19
|
+
set position(value) {
|
|
20
|
+
this.pixiContainer.position = value;
|
|
21
|
+
}
|
|
22
|
+
get x() {
|
|
23
|
+
return this.pixiContainer.x;
|
|
24
|
+
}
|
|
25
|
+
set x(value) {
|
|
26
|
+
this.x = value;
|
|
27
|
+
}
|
|
28
|
+
get y() {
|
|
29
|
+
return this.pixiContainer.y;
|
|
30
|
+
}
|
|
31
|
+
set y(value) {
|
|
32
|
+
this.pixiContainer.y = value;
|
|
33
|
+
}
|
|
34
|
+
setRotation(value) {
|
|
35
|
+
this.rotation = value;
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
get rotation() {
|
|
39
|
+
return new helpers_lib_1.Radian(this.pixiContainer.rotation);
|
|
40
|
+
}
|
|
41
|
+
set rotation(value) {
|
|
42
|
+
this.pixiContainer.rotation = value.value;
|
|
43
|
+
}
|
|
44
|
+
setZIndex(value) {
|
|
45
|
+
this.zIndex = value;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
get zIndex() {
|
|
49
|
+
return this.pixiContainer.zIndex;
|
|
50
|
+
}
|
|
51
|
+
set zIndex(value) {
|
|
52
|
+
this.pixiContainer.zIndex = value;
|
|
53
|
+
}
|
|
54
|
+
setSortableChildren(value) {
|
|
55
|
+
this.sortableChildren = value;
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
get sortableChildren() {
|
|
59
|
+
return this.pixiContainer.sortableChildren;
|
|
60
|
+
}
|
|
61
|
+
set sortableChildren(value) {
|
|
62
|
+
this.pixiContainer.sortableChildren = value;
|
|
63
|
+
}
|
|
64
|
+
setScale(value) {
|
|
65
|
+
this.scale = value;
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
get scale() {
|
|
69
|
+
if (this.pixiContainer.scale.x !== this.pixiContainer.scale.y) {
|
|
70
|
+
throw new Error(`DisplayObject: scale x and y are not equal!`);
|
|
71
|
+
}
|
|
72
|
+
return this.pixiContainer.scale.x;
|
|
73
|
+
}
|
|
74
|
+
set scale(value) {
|
|
75
|
+
this.pixiContainer.scale.set(value, value);
|
|
76
|
+
if (this.isMirror) {
|
|
77
|
+
this.pixiContainer.scale.x *= -1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
setAlpha(value) {
|
|
81
|
+
this.pixiContainer.alpha = value;
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
get alpha() {
|
|
85
|
+
return this.pixiContainer.alpha;
|
|
86
|
+
}
|
|
87
|
+
set alpha(value) {
|
|
88
|
+
this.pixiContainer.alpha = value;
|
|
89
|
+
}
|
|
90
|
+
setMirror(mirror = false) {
|
|
91
|
+
this.mirror = mirror;
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
get mirror() {
|
|
95
|
+
return this.isMirror;
|
|
96
|
+
}
|
|
97
|
+
set mirror(value) {
|
|
98
|
+
this.isMirror = value;
|
|
99
|
+
if (value) {
|
|
100
|
+
this.pixiContainer.scale.x *= -1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
setInteractive() {
|
|
104
|
+
this.interactive = true;
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
get interactive() {
|
|
108
|
+
return this.pixiContainer.interactive;
|
|
109
|
+
}
|
|
110
|
+
set interactive(value) {
|
|
111
|
+
this.pixiContainer.interactive = value;
|
|
112
|
+
}
|
|
113
|
+
setPointer() {
|
|
114
|
+
this.pointer = 'pointer';
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
get pointer() {
|
|
118
|
+
return this.pixiContainer.cursor;
|
|
119
|
+
}
|
|
120
|
+
set pointer(value) {
|
|
121
|
+
this.pixiContainer.cursor = value;
|
|
122
|
+
}
|
|
123
|
+
setEventMode(eventMode) {
|
|
124
|
+
this.eventMode = eventMode;
|
|
125
|
+
return this;
|
|
126
|
+
}
|
|
127
|
+
get eventMode() {
|
|
128
|
+
return this.pixiContainer.eventMode;
|
|
129
|
+
}
|
|
130
|
+
set eventMode(value) {
|
|
131
|
+
this.pixiContainer.eventMode = value;
|
|
132
|
+
}
|
|
133
|
+
getMask() {
|
|
134
|
+
throw new Error(`DisplayObjectAttributes: mask is not available!`);
|
|
135
|
+
}
|
|
136
|
+
setMask(mask) {
|
|
137
|
+
if (mask) {
|
|
138
|
+
this.pixiContainer.addChild(mask.pixiContainer);
|
|
139
|
+
this.pixiContainer.mask = mask.getMask();
|
|
140
|
+
this._mask = mask;
|
|
141
|
+
} else {
|
|
142
|
+
if (this._mask) {
|
|
143
|
+
this.pixiContainer.removeChild(this._mask.pixiContainer);
|
|
144
|
+
}
|
|
145
|
+
// eslint-disable-next-line no-null/no-null
|
|
146
|
+
this.pixiContainer.mask = null;
|
|
147
|
+
}
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
152
150
|
}
|
|
153
151
|
exports.DisplayObjectAttributes = DisplayObjectAttributes;
|
|
154
|
-
//# sourceMappingURL=display-object-attributes.js.map
|
|
152
|
+
//# sourceMappingURL=display-object-attributes.js.map
|
|
@@ -3,23 +3,23 @@ import { Rectangle } from 'helpers-lib';
|
|
|
3
3
|
import { DisplayObjectAttributes } from './display-object-attributes';
|
|
4
4
|
import { Attachable } from '../../game-entities';
|
|
5
5
|
export interface SetParentOptions {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
addUnder: boolean;
|
|
7
|
+
cropOverflowingParts: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare abstract class DisplayObject extends DisplayObjectAttributes {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
protected static allDisplayObjects: Map<string, DisplayObject>;
|
|
11
|
+
private static nextAvailableIds;
|
|
12
|
+
readonly id: string;
|
|
13
|
+
private attachIsCalled;
|
|
14
|
+
private attachedParent;
|
|
15
|
+
private _destroyed;
|
|
16
|
+
get destroyed(): boolean;
|
|
17
|
+
protected constructor(pixiContainer: PIXI.Container);
|
|
18
|
+
attach(parent: Attachable | string): this;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
protected getBoundingMask(): PIXI.Container;
|
|
21
|
+
parent(parent: DisplayObject | string, partialOptions?: Partial<SetParentOptions>): this;
|
|
22
|
+
skipAttachCheck(): this;
|
|
23
|
+
get boundingBox(): Rectangle;
|
|
24
|
+
private generateNextAvailableId;
|
|
25
25
|
}
|
|
@@ -1,83 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
2
|
exports.DisplayObject = void 0;
|
|
4
|
-
const helpers_lib_1 = require(
|
|
5
|
-
const display_object_attributes_1 = require(
|
|
6
|
-
const game_entities_1 = require(
|
|
3
|
+
const helpers_lib_1 = require('helpers-lib');
|
|
4
|
+
const display_object_attributes_1 = require('./display-object-attributes');
|
|
5
|
+
const game_entities_1 = require('../../game-entities');
|
|
7
6
|
class DisplayObject extends display_object_attributes_1.DisplayObjectAttributes {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
static {
|
|
8
|
+
DisplayObject.allDisplayObjects = new Map();
|
|
9
|
+
}
|
|
10
|
+
static {
|
|
11
|
+
DisplayObject.nextAvailableIds = new Map();
|
|
12
|
+
}
|
|
13
|
+
get destroyed() {
|
|
14
|
+
return this._destroyed;
|
|
15
|
+
}
|
|
16
|
+
constructor(pixiContainer) {
|
|
17
|
+
super(pixiContainer);
|
|
18
|
+
this.attachIsCalled = false;
|
|
19
|
+
this._destroyed = false;
|
|
20
|
+
this.id = this.generateNextAvailableId(this.constructor.name);
|
|
21
|
+
DisplayObject.allDisplayObjects.set(this.id, this);
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
if (!this.destroyed && !this.attachIsCalled && !this.pixiContainer.destroyed) {
|
|
24
|
+
throw new Error(`DisplayObject: it is not attached to anything! Name: "${this.constructor.name}", ID: "${this.id}"`);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
attach(parent) {
|
|
29
|
+
this.attachedParent = game_entities_1.Attachable.findAttachableParent(parent);
|
|
30
|
+
this.attachedParent['setAttachment'](this);
|
|
31
|
+
this.attachIsCalled = true;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
destroy() {
|
|
35
|
+
DisplayObject.allDisplayObjects.delete(this.id);
|
|
36
|
+
this.attachedParent?.['removeAttachment'](this);
|
|
37
|
+
if (this.pixiContainer && !this.pixiContainer.destroyed) {
|
|
38
|
+
this.pixiContainer.destroy();
|
|
12
39
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
40
|
+
}
|
|
41
|
+
getBoundingMask() {
|
|
42
|
+
throw new Error(`DisplayObject: bounding mask cannot be used without bounding shapes. Display Object: "${this.id}"!`);
|
|
43
|
+
}
|
|
44
|
+
parent(parent, partialOptions) {
|
|
45
|
+
const options = {
|
|
46
|
+
addUnder: false,
|
|
47
|
+
cropOverflowingParts: false,
|
|
48
|
+
...partialOptions
|
|
49
|
+
};
|
|
50
|
+
let parentDisplayObject;
|
|
51
|
+
if (helpers_lib_1.Comparator.isString(parent)) {
|
|
52
|
+
parentDisplayObject = DisplayObject.allDisplayObjects.get(parent);
|
|
53
|
+
if (!parentDisplayObject) {
|
|
54
|
+
throw new Error(`DisplayObject: parent not found! id: ${parent}`);
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
parentDisplayObject = parent;
|
|
24
58
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return this;
|
|
59
|
+
if (options.addUnder) {
|
|
60
|
+
parentDisplayObject.pixiContainer.addChildAt(this.pixiContainer, 0);
|
|
61
|
+
} else {
|
|
62
|
+
parentDisplayObject.pixiContainer.addChild(this.pixiContainer);
|
|
30
63
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.attachedParent?.['removeAttachment'](this);
|
|
34
|
-
if (this.pixiContainer && !this.pixiContainer.destroyed) {
|
|
35
|
-
this.pixiContainer.destroy();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
getBoundingMask() {
|
|
39
|
-
throw new Error(`DisplayObject: bounding mask cannot be used without bounding shapes. Display Object: "${this.id}"!`);
|
|
40
|
-
}
|
|
41
|
-
parent(parent, partialOptions) {
|
|
42
|
-
let options = {
|
|
43
|
-
addUnder: false,
|
|
44
|
-
cropOverflowingParts: false,
|
|
45
|
-
...partialOptions
|
|
46
|
-
};
|
|
47
|
-
let parentDisplayObject;
|
|
48
|
-
if (helpers_lib_1.Comparator.isString(parent)) {
|
|
49
|
-
parentDisplayObject = DisplayObject.allDisplayObjects.get(parent);
|
|
50
|
-
if (!parentDisplayObject) {
|
|
51
|
-
throw new Error(`DisplayObject: parent not found! id: ${parent}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
parentDisplayObject = parent;
|
|
56
|
-
}
|
|
57
|
-
if (options.addUnder) {
|
|
58
|
-
parentDisplayObject.pixiContainer.addChildAt(this.pixiContainer, 0);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
parentDisplayObject.pixiContainer.addChild(this.pixiContainer);
|
|
62
|
-
}
|
|
63
|
-
if (options.cropOverflowingParts) {
|
|
64
|
-
this.pixiContainer.mask = parentDisplayObject.getBoundingMask();
|
|
65
|
-
}
|
|
66
|
-
return this;
|
|
67
|
-
}
|
|
68
|
-
skipAttachCheck() {
|
|
69
|
-
this.attachIsCalled = true;
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
get boundingBox() {
|
|
73
|
-
let bounds = this.pixiContainer.getLocalBounds();
|
|
74
|
-
return new helpers_lib_1.Rectangle(new helpers_lib_1.Vector(bounds.x, bounds.y), new helpers_lib_1.Vector(bounds.x + bounds.width, bounds.y + bounds.height));
|
|
75
|
-
}
|
|
76
|
-
generateNextAvailableId(className) {
|
|
77
|
-
let id = DisplayObject.nextAvailableIds.get(className) || 1;
|
|
78
|
-
DisplayObject.nextAvailableIds.set(className, id + 1);
|
|
79
|
-
return `${className}:${id}`;
|
|
64
|
+
if (options.cropOverflowingParts) {
|
|
65
|
+
this.pixiContainer.mask = parentDisplayObject.getBoundingMask();
|
|
80
66
|
}
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
skipAttachCheck() {
|
|
70
|
+
this.attachIsCalled = true;
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
get boundingBox() {
|
|
74
|
+
const bounds = this.pixiContainer.getLocalBounds();
|
|
75
|
+
return new helpers_lib_1.Rectangle(
|
|
76
|
+
new helpers_lib_1.Vector(bounds.x, bounds.y),
|
|
77
|
+
new helpers_lib_1.Vector(bounds.x + bounds.width, bounds.y + bounds.height)
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
generateNextAvailableId(className) {
|
|
81
|
+
const id = DisplayObject.nextAvailableIds.get(className) || 1;
|
|
82
|
+
DisplayObject.nextAvailableIds.set(className, id + 1);
|
|
83
|
+
return `${className}:${id}`;
|
|
84
|
+
}
|
|
81
85
|
}
|
|
82
86
|
exports.DisplayObject = DisplayObject;
|
|
83
|
-
//# sourceMappingURL=display-object.js.map
|
|
87
|
+
//# sourceMappingURL=display-object.js.map
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import * as PIXI from 'pixi.js';
|
|
2
2
|
import { RGBColor } from 'helpers-lib';
|
|
3
3
|
export declare class AlphaPrimerColorFilter extends PIXI.Filter {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
private static vertexShader;
|
|
5
|
+
private static getFragmentShader;
|
|
6
|
+
constructor(expand: number, color: RGBColor);
|
|
7
|
+
apply(
|
|
8
|
+
filterManager: PIXI.FilterSystem,
|
|
9
|
+
input: PIXI.RenderTexture,
|
|
10
|
+
output: PIXI.RenderTexture,
|
|
11
|
+
clearMode: PIXI.CLEAR_MODES
|
|
12
|
+
): void;
|
|
8
13
|
}
|