fix zorder system

This commit is contained in:
Ronja 2020-02-19 23:17:03 +01:00
parent 89920e0b8e
commit 3f730301fe

View file

@ -2,6 +2,7 @@ import { PixiRepresentation } from "../../Components/rendering/pixiRepresentatio
import { Entity, System } from "ecsy";
import { Position } from "../../Components/position";
import { OrderZ } from "../../Components/rendering/orderZ";
import globals from "../../globals";
export class ZOrderSystem extends System {
@ -24,6 +25,8 @@ export class ZOrderSystem extends System {
let pos = entity.getComponent(Position).value
representation.zIndex = pos.y + order.offset
});
if(this.queries.objects.changed.length > 0)
globals.app.stage.sortChildren()
}
static queries = {