Problem with 9-patch

Hello everyone. I was making my game today when I discovered a bug.
My game is pixel-perfect. But the 9-patch gets anti-aliased. I don’t know why but this happens.
See for yourself:
13hFa7Xmrg
Can anyone tell me why this is happening? And how can I fix this?

That’s not anti-aliasing. That’s subpixel rendering. Basically your resolution is so low that when you move the position of the object has to be at a subpixel (location between two pixels). This causes some render blurring.

You can probably fix this by forcing your camera’s positioning to be rounded rather than exactly matching the player’s position, or you can round your player’s position.

Unfortunately, the pixel rounding option in the platformer behavior does not appear to work currently (there’s a bug report on GIthub about it), so you’d need to do either of the above workarounds for now.

1 Like

Why don’t you use tiles or tile maps instead of patch-9?
Tiles or tile maps has better performance and remember the workabound of round positions in player.

That’s because I am making grass object with edges different from the rest.

Sure I understand but what I mean is the difference is between 1 image or 9 if you really use 9 images then is another thing. If you only use middle, left, right in patch-9 then is better to replace that patch-9 for 3 tile images left,middle, right in A Pixel Adventure Legion or in Alanna the princess of puzzles is what i did, my first attempt as you’re doing was with a patch-9 but I ended using tiles because of the size of the levels some of them 2000x800 so the game lags as he-ll.

just an advice I’m not saying this is not going to work for your game.

OK, but I don’t think I will do this in this project because it will be a lot of hassle and I have to complete it in 5 days, but I will remember you advice Mr. @UlisesFreitas

Just let me know when you upload the game so I can vote is for the LOWREZJAM right?

Yes :grinning::grinning:

Thank you