Sort by absolute position
This commit is contained in:
parent
0c10347c78
commit
7956d2bb51
|
|
@ -22,7 +22,9 @@ export class TextDisplaySystem extends System {
|
||||||
y: viewport.worldY - viewport.screenY,
|
y: viewport.worldY - viewport.screenY,
|
||||||
} : { x: 0, y: 0 };
|
} : { x: 0, y: 0 };
|
||||||
|
|
||||||
const sprites = Array.from(world.query(Sprite, Position)).sort((a, b) => a[2].state.z - b[2].state.z);
|
const sprites = Array.from(world.query(Sprite, Position))
|
||||||
|
.sort((a, b) => Number(a[2].absolute) - Number(b[2].absolute) || a[2].z - b[2].z);
|
||||||
|
|
||||||
for (const [e, sprite, pos] of sprites) {
|
for (const [e, sprite, pos] of sprites) {
|
||||||
if (e.has(Hidden)) continue;
|
if (e.has(Hidden)) continue;
|
||||||
const image = sprite.image;
|
const image = sprite.image;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue