1681-engine 0.6.3 → 0.6.5
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/CHANGELOG.md +8 -0
- package/dist/core/Group.js +12 -8
- package/dist/types/core/Group.d.ts +6 -2
- package/dist/types/core/Group.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this package are written here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
4
4
|
and versions follow [Semantic Versioning](https://semver.org/); before 1.0 a minor version may break the API.
|
|
5
5
|
|
|
6
|
+
## 0.6.5
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- `Group.moveAbove` / `moveBelow` do nothing when the child is already directly above / below the other. Taking it out
|
|
11
|
+
and putting it back marked the render group's structure changed, so Pixi rebuilt its draw instructions that frame:
|
|
12
|
+
a game ordering a held weapon against its body every frame rebuilt them every frame.
|
|
13
|
+
|
|
6
14
|
## 0.6.3
|
|
7
15
|
|
|
8
16
|
### Changed
|
package/dist/core/Group.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Container as
|
|
2
|
-
import { GameObject as
|
|
3
|
-
class
|
|
1
|
+
import { Container as i } from "pixi.js";
|
|
2
|
+
import { GameObject as r } from "./gameObject.js";
|
|
3
|
+
class d extends r(i) {
|
|
4
4
|
get list() {
|
|
5
5
|
return this.children;
|
|
6
6
|
}
|
|
@@ -14,15 +14,19 @@ class a extends i(r) {
|
|
|
14
14
|
remove(t, e = !1) {
|
|
15
15
|
return t.parent === this && this.removeChild(t), e && t.destroy({ children: !0, context: !0 }), this;
|
|
16
16
|
}
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Puts `child` directly below `other` in the draw order. Already there, it does nothing: taking a child out and
|
|
19
|
+
* putting it back marks the render group's structure changed, and Pixi rebuilds its draw instructions for that
|
|
20
|
+
* frame — a held weapon ordered against its body every frame did it every frame.
|
|
21
|
+
*/
|
|
18
22
|
moveBelow(t, e) {
|
|
19
|
-
return t.parent !== this || e.parent !== this || t === e ? this : (this.removeChild(t), this.addChildAt(t, this.getChildIndex(e)), this);
|
|
23
|
+
return t.parent !== this || e.parent !== this || t === e ? this : this.getChildIndex(t) === this.getChildIndex(e) - 1 ? this : (this.removeChild(t), this.addChildAt(t, this.getChildIndex(e)), this);
|
|
20
24
|
}
|
|
21
|
-
/** Puts `child` directly above `other` in the draw order. */
|
|
25
|
+
/** Puts `child` directly above `other` in the draw order; already there, it does nothing (see `moveBelow`). */
|
|
22
26
|
moveAbove(t, e) {
|
|
23
|
-
return t.parent !== this || e.parent !== this || t === e ? this : (this.removeChild(t), this.addChildAt(t, this.getChildIndex(e) + 1), this);
|
|
27
|
+
return t.parent !== this || e.parent !== this || t === e ? this : this.getChildIndex(t) === this.getChildIndex(e) + 1 ? this : (this.removeChild(t), this.addChildAt(t, this.getChildIndex(e) + 1), this);
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
export {
|
|
27
|
-
|
|
31
|
+
d as Group
|
|
28
32
|
};
|
|
@@ -6,9 +6,13 @@ export declare class Group extends Group_base {
|
|
|
6
6
|
add(child: PixiContainer | PixiContainer[]): this;
|
|
7
7
|
addAt(child: PixiContainer, index: number): this;
|
|
8
8
|
remove(child: PixiContainer, destroy?: boolean): this;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Puts `child` directly below `other` in the draw order. Already there, it does nothing: taking a child out and
|
|
11
|
+
* putting it back marks the render group's structure changed, and Pixi rebuilds its draw instructions for that
|
|
12
|
+
* frame — a held weapon ordered against its body every frame did it every frame.
|
|
13
|
+
*/
|
|
10
14
|
moveBelow(child: PixiContainer, other: PixiContainer): this;
|
|
11
|
-
/** Puts `child` directly above `other` in the draw order. */
|
|
15
|
+
/** Puts `child` directly above `other` in the draw order; already there, it does nothing (see `moveBelow`). */
|
|
12
16
|
moveAbove(child: PixiContainer, other: PixiContainer): this;
|
|
13
17
|
}
|
|
14
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../src/core/Group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;;AAGrE,yFAAyF;AACzF,qBAAa,KAAM,SAAQ,UAAqB;IAC9C,IAAI,IAAI,IAAI,aAAa,EAAE,CAE1B;IAED,GAAG,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,IAAI;IAKjD,KAAK,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAKhD,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,UAAQ,GAAG,IAAI;IAMnD
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../src/core/Group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;;AAGrE,yFAAyF;AACzF,qBAAa,KAAM,SAAQ,UAAqB;IAC9C,IAAI,IAAI,IAAI,aAAa,EAAE,CAE1B;IAED,GAAG,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,EAAE,GAAG,IAAI;IAKjD,KAAK,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAKhD,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,UAAQ,GAAG,IAAI;IAMnD;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI;IAQ3D,+GAA+G;IAC/G,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI;CAO5D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "1681-engine",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "A 2D game engine on PixiJS 8 for any art style: scenes and a fast ECS, a fixed-step loop, asset loading, Tiled maps, sprite animation, input actions, camera follow, audio and deterministic, server-replayable movement, plus Dither, an optional pixel-art module (pixel-perfect effects, dithered lighting).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|