Repository navigation
|
Hi folks, I've been building out a little Pokemon fan game using I'm not sure if I've maybe run into a bug with the tiled plugin or if I've goofed a config somewhere. Here's a screen capture where I've modified my simple game to use a red background on my map Scenes to make it a bit easier to see the tearing effect. Screencast.From.2026-01-11.22-27-22.mp4Source code: https://github.com/keawade/fan-game/tree/d72ff8ae0c209aebc2971411a9effb662849f596 |
Replies: 4 comments 1 reply
|
@keawade Yah that looks rough! I'll look into this source code asap, my first guess is there is something goofy happening with the filtering/sampling. |
|
@keawade Try this const game = new MyEngine({
canvasElementId: "game",
width: 240,
height: 160,
// artificially bump the physical resolution by 4x to give the sampler more pixels to work with, the logical rez stays 240x160
pixelRatio: 4,
// antialiasing: false sets the sampler to nearest neighbor which can have a tough time when you're moving sub-pixel amounts
// pixelArt: true does some fancy sub-pixel filtering but preserves the pixel art look
pixelArt: true,
displayMode: DisplayMode.FitScreen,
scenes: {
world: World,
playerHouse01: PlayerHouse01,
playerHouse02: PlayerHouse02,
pokecenter: PokeCenter,
battle: Battle,
},
}); |
|
The other option if you want to keep the
You can set the engine to pixel snapping (it can cause other issues tho) const game = new ex.Engine({
...
snapToPixel: true
}); |
|
I'll have time to dig in closer later to get a more definitive reason this is happening, but my theory is I think it's floating point messing with nearest neighbor sampling, and we're having sampler bleed into transparent pixels on certain tiles... |
@keawade Try this