Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Phong on June 25, 2012, 11:53:02 AM

Title: Best Practices for Atlas Switching
Post by: Phong on June 25, 2012, 11:53:02 AM
I watched the video on atlas switching and searched the forums but I still have a few questions. Here is my setup

AtlasRef
AtlasHD
AtlasSD
FontRef
FontHD
FontSD

Question 1 Which atlas should the FontHD and the FontSD reference? Is it OK for them to reference the AtlasRef?

Question 2 What is the best approach for creating the SD atlas and fonts? I tried:
Is there an easier or better approach for creating the SD atlas?
Is it dangerous to create atlases by duplicating an existing atlas instead of using the atlas maker?
Is there an easier way to create smaller fonts or fix a font's reference in the atlas?

What is the best way of doing this?

O.K. Way more than two questions. Advice would be very much appreciated thanks!
Title: Re: Best Practices for Atlas Switching
Post by: ArenMook on June 25, 2012, 12:54:06 PM
1: No. HD and SD atlases should not reference anything. They should be actual atlases. AtlasRef should point to one of them. When designing, have it point to whatever is your "default" atlas that you'll be creating your UI in. When deploying, set it to reference nothing, and in Awake() of your loading script, check the resolution and Resources.Load the appropriate atlas -- HD or SD -- then set the AtlasRef to point to that atlas.

2: If you switch the atlas to use texture coordinates instead of pixels, you can shrink the atlas texture safely without having to re-do all the sprite coordinates. Generally your artist will provide you with HD and SD versions of each texture though. Shrinking it manually will degrade quality.

Duplicating an atlas prefab is just fine.