fix: z-sorting

This commit is contained in:
cha0s 2024-06-27 13:57:18 -05:00
parent b12183a6ee
commit d63f835ebd
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,5 @@
import {Container} from '@pixi/react';
import Entity from './entity.jsx';
export default function Entities({entities}) {
@ -10,5 +12,11 @@ export default function Entities({entities}) {
/>
);
}
return <>{renderables}</>;
return (
<Container
sortableChildren
>
{renderables}
</Container>
);
}

View File

@ -35,7 +35,9 @@ function Entities({entity}) {
return false;
}
return (
<Container>
<Container
zIndex={entity.Position?.y}
>
{entity.Sprite && (
<Sprite
entity={entity}