2D Toolkit Forum

2D Toolkit => Support => Topic started by: fsadeq on April 04, 2014, 05:13:01 pm

Title: Pixel alignment issue with camera
Post by: fsadeq on April 04, 2014, 05:13:01 pm
Hello, I'm working on a pixel perfect game and have a camera that follows the player. I used to use a 1:1 pixel projection ratio - but things were getting too massive to work with, so I recently switched to a 1:64 projection. Everything is working great, except now when the camera moves or smooth follows the player, the tiles are sometimes slightly distorted because of what I'm assuming is the camera sitting on half pixels sometimes. I fixed this before by just rounding the values, but since now the scale is way smaller I can't round any of the positions. Are there any suggestions on what to do about this? Thanks.
Title: Re: Pixel alignment issue with camera
Post by: unikronsoftware on April 06, 2014, 12:14:41 pm
You just need to round to 1/64 of a pixel, instead of 1 pixel. Eg. round(pos.x * 64) / 64.