1
0
forked from noxious/client

Image quality bs

This commit is contained in:
Dennis Postma 2024-09-29 01:37:33 +02:00
parent 5b31729f64
commit 9cf872b7e2
2 changed files with 9 additions and 9 deletions

View File

@ -6,10 +6,7 @@ export function useCameraControls(scene: Phaser.Scene): any {
const gameStore = useGameStore() const gameStore = useGameStore()
const zoneStore = useZoneStore() const zoneStore = useZoneStore()
const camera = scene.cameras.main const camera = scene.cameras.main
// Might improve image quality
camera.setRoundPixels(true)
function onPointerDown(pointer: Phaser.Input.Pointer) { function onPointerDown(pointer: Phaser.Input.Pointer) {
gameStore.setPlayerDraggingCamera(true) gameStore.setPlayerDraggingCamera(true)
} }

View File

@ -4,7 +4,7 @@
<GmPanel v-if="gameStore.character?.role === 'gm'" /> <GmPanel v-if="gameStore.character?.role === 'gm'" />
<div v-if="!zoneEditorStore.active"> <div v-if="!zoneEditorStore.active">
<Game :config="gameConfig" @create="createGame" style="image-rendering: pixelated"> <Game :config="gameConfig" @create="createGame">
<Scene name="main" @preload="preloadScene" @create="createScene"> <Scene name="main" @preload="preloadScene" @create="createScene">
<div v-if="isLoaded"> <div v-if="isLoaded">
<Inventory /> <Inventory />
@ -61,10 +61,7 @@ const gameConfig = {
width: window.innerWidth, width: window.innerWidth,
height: window.innerHeight, height: window.innerHeight,
type: Phaser.AUTO, // AUTO, CANVAS, WEBGL, HEADLESS type: Phaser.AUTO, // AUTO, CANVAS, WEBGL, HEADLESS
resolution: 3, resolution: 5,
scale: { mode: Phaser.Scale.RESIZE },
pixelArt: true,
roundPixels: true,
} }
const createGame = (game: Phaser.Game) => { const createGame = (game: Phaser.Game) => {
@ -160,3 +157,9 @@ onBeforeUnmount(() => {
gameStore.disconnectSocket() gameStore.disconnectSocket()
}) })
</script> </script>
<style lang="scss">
canvas {
image-rendering: pixelated;
}
</style>