contentScaling making tile-based games impossible?

Hi,

I’m doing a tile-based platform game at the moment, and I’m running into an issue I’ve seen discussed here before: vertical lines inbetween my tiles.

So far, the two same suggestion always pop-up:

  1. Use power of two images - I understand this, and why
  2. Don’t use content scaling.

The thing is, and this is what I’m running into at the moment: doesn’t this make universal build impossible by consequence? If I want my app to work on both iPad and iPhone 4 (I’m ruling out the 3G and 3GS because my game is too processor-intensive for these devices), I HAVE to use content-scaling.

Carlos, Walter, anyone: any way to work around this? I can see where this is coming from, dynamic content scaling and all that, but it’s a pity this is impossible… Can’t we just render to an OpenGL canvas and scale that canvas up to fill the screen instead of converting all the scales and positions internally (which is where I’m assuming rounding errors cause the bug).

Cheers,
Thomas [import]uid: 70134 topic_id: 16139 reply_id: 316139[/import]

You could try putting a one or two pixel transparent border around your tile textures. If you’re using spritesheets TexturePacker has a way to automate creating the border if you don’t want to change the original art.

I believe the issue is an artifact of OpenGL rendering textures to a polygon.
[import]uid: 9422 topic_id: 16139 reply_id: 60058[/import]

Hi XenonBL,

Yup, that was my next recourse, but I’m sort of assuming that this will introduce transparent lines. Well, I’ll give it a try!

Thanks,
Thomas [import]uid: 70134 topic_id: 16139 reply_id: 60140[/import]

If you use spritesheets and a tool like TexturePacker to separate the sprites with a 2 px border you won’t get transparent lines. The sprites themselves will be the same dimensions, but the pixels around them on the parent texture will be transparent.

If you add the transp. by going into each tile image individually and adding the border then you’ll probably have to slightly overlap the sprites on screen if you don’t want any visible gaps.

The 1st method is better (and easier) in the long run, but the 2nd method is useful for a quick test to make sure that indeed fixes your problem. [import]uid: 9422 topic_id: 16139 reply_id: 60161[/import]