fix: pixel rounding
This commit is contained in:
parent
b40c80caff
commit
2ad8d492b5
|
@ -38,7 +38,10 @@ export default function EcsComponent() {
|
||||||
}
|
}
|
||||||
const {Camera} = mainEntity;
|
const {Camera} = mainEntity;
|
||||||
const {TileLayers} = ecs.get(1);
|
const {TileLayers} = ecs.get(1);
|
||||||
const [cx, cy] = [Camera.x - RESOLUTION.x / 2, Camera.y - RESOLUTION.y / 2];
|
const [cx, cy] = [
|
||||||
|
Math.round(Camera.x - RESOLUTION.x / 2),
|
||||||
|
Math.round(Camera.y - RESOLUTION.y / 2),
|
||||||
|
];
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<TileLayer
|
<TileLayer
|
||||||
|
|
|
@ -27,8 +27,8 @@ export default function Sprite({entity}) {
|
||||||
return (
|
return (
|
||||||
<PixiSprite
|
<PixiSprite
|
||||||
texture={texture}
|
texture={texture}
|
||||||
x={entity.Position.x}
|
x={Math.round(entity.Position.x)}
|
||||||
y={entity.Position.y}
|
y={Math.round(entity.Position.y)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user