2D Toolkit Forum

2D Toolkit => Support => Topic started by: willeml85 on January 20, 2013, 03:38:21 pm

Title: Tilemap + camera uv problem [solved]
Post by: willeml85 on January 20, 2013, 03:38:21 pm
Hello everyone,
I would like to ask if there is a solution for the behavior that is occuring in the following example image.

(http://s2.postimage.org/jm81fomop/example.png)

It seems that the UV's are overlapping/moving when the camera moves.

Thank you
Title: Re: Tilemap + camera uv problem
Post by: willeml85 on January 21, 2013, 02:38:25 pm
I solved this by using ragepixel's camera.

self.position = new Vector3(Mathf.RoundToInt(player.position.x) + 0.05f, Mathf.RoundToInt(player.position.y) - 0.05f, self.position.z);

with just this line, it works good now.
Title: Re: Tilemap + camera uv problem
Post by: unikronsoftware on January 21, 2013, 02:44:21 pm
That just makes sure the camera is always snaps to the closest pixel on screen instead of interpolating between pixel fractions, etc. Its always good to do that, and also make sure your sprites are on pixel boundaries too.