2D Toolkit Forum

2D Toolkit => Support => Topic started by: SirJson on December 15, 2013, 07:24:03 pm

Title: Random gaps between aligned sprites
Post by: SirJson on December 15, 2013, 07:24:03 pm
Hi,

When I align two or more sprites and then move the ingame camera around I can see sometimes gaps between my sprites. I aligned my sprites with vertex snapping.

When everything is fine it looks like this:
(http://pixeltastic.de/files/okframe.png)

But in the next frame it looks like this:
(http://pixeltastic.de/files/brokenframe.png)

I already tried the following things:

Unfortunately I have absolutely no idea what is causing these problems... is someone out there who knows how I can fix this?
Title: Re: Random gaps between aligned sprites
Post by: unikronsoftware on December 15, 2013, 07:50:53 pm
1. Are you using a perspective camera?
2. Are you absolutely sure the are perfectly aligned? Zoom in really really close to check - I've seen vertex alignment not actually perfectly align things in the past.
Title: Re: Random gaps between aligned sprites
Post by: SirJson on December 15, 2013, 08:17:12 pm
Thank you for your quick reply! I didn't check the most obvious reason for that problem. :) There are indeed real gaps between the sprites...

Is there a better method to align sprites? Vertex snapping seems to be too unreliable.
Title: Re: Random gaps between aligned sprites
Post by: unikronsoftware on December 15, 2013, 08:35:48 pm
I usually just a little editor script to do this... a little menu item with a shortcut usually works pretty well - you will want to snap to a grid, or texelSize (sprite.CurrentSprite.texelSize).