Hello Guest

Author Topic: Multiple atlases for multiple resolutions  (Read 7319 times)

Game Whiz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Multiple atlases for multiple resolutions
« on: April 12, 2012, 10:16:34 pm »
Hi,

In NGUI there's the concept of a "dummy" atlas, an atlas that is merely a reference to another atlas. This way, at runtime and based on the device's type/resolution, I can point this dummy atlas to whatever atlas fits my needs.

I've looked around for a similar concept in 2D toolkit but can't find anything. From what I've read I'm supposed to design at the highest resolution and then allow 2D Toolkit to scale down. Is this correct? What is the most common approach to this problem in 2d Toolkit?

I've createad a tk2dcamera, set it up with size=1536, resolution override = 2048x1536 and forced resolution in editor and in this resolution all my sprites, particularly my diced sprites looked good.

Then I switched atlases manually, from an  ultra high resolution iPad 3 atlas, to an hd iphone atlas, and while most things work fine, diced sprites got filled with seams. This tells me that there's probably a better approach that a 2D Toolkit noob like me isn't seeing :)

How can I switch atlases and avoid these seams?

Best regards,
Alex

Game Whiz

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Multiple atlases for multiple resolutions
« Reply #1 on: April 12, 2012, 10:31:06 pm »
Solved my own problem by padding with 16 pixels, which makes all the sense in the world, since I'm downsizing from UHD to SD.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Multiple atlases for multiple resolutions
« Reply #2 on: April 12, 2012, 10:40:43 pm »
Hi,

I was just going to suggest the padding trick.

A later version will be able to automatically construct and load correct atlases, but this isn't ready for use yet.