Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: woox on December 19, 2013, 08:09:09 PM
-
So I was building my game in Unity using NGUI, and I ended up making game optimized for iPad 3, and now want to optimize the GUI for Ipad2.
I have my sprites decreased by 50% from my iPad 3 GUI sprites, but how can I switch between HD and SD GUI atlases?
I watched this video (https://www.youtube.com/watch?v=ARfmGCMbJr8)to maybe help solve my problem.
After creating my reference atlas to switch between SD and HD, do I need to reassign each GUI game object from the reference atlas, as this can be very lengthy for us because we have 20 scenes.
Is there a script or anything I can run to simplify the process of reassigning each GUI game object from the reference atlas?
Thanks
-
I would suggest you to convert your current atlas into a reference atlas. Create a copy of it -- this will be your actual HD atlas. Now change the current atlas (which is referenced by all the widgets) to be a Reference atlas, pointing to your copy. You don't need to change all your widgets this way.
-
Hi Aren,
I had to confess to being a little confused, how is this supposed to work?
I have three Atlases:
Atlas_HD
Atlas_SD
Atlas_Reference (created from a duplicated HD).
The HD sprites appear correctly when HD is mapped to Reference, but the SD assets don't appear at all when Atlas_SD is mapped to Reference (I get empty frames), unless they're specifically assigned in the Sprite's pop-up Sprite property... which continues to show the HD sprite's name regardless of Atlas mapping.
How do we propagate/maintain Sprite assignments between Atlas references? Or is this broken perhaps?
NGUI 3.0.7 f3 (Unity 4.3.2f1)
-
Atlas_Reference should not be created from a duplicated atlas. It should be the renamed atlas you had before. This way you don't need to go through all your widgets and change their atlas.
Atlas_HD should be the duplicated atlas.
As long as both atlases have sprites with identical names, everything is automatic. When you switch the atlas the reference atlas is pointing to, all widgets will change automatically.
-
What renamed atlas?
Doing it as you suggest doesn't change anything I'm getting.
Let's see if I have this right:
Reference atlas is blank - it's just a state, points to whatever atlas you assign to it. It works, but it doesn't switch between the two other atlas's sprites, which leads me to:
The sprite names aren't the same between HD and SD, as they're suffixed _HD / _SD - are you saying they have to be named the same?
I'm not sure if my NGUI install is even working properly. If I change the ref atlas Atlas Type to Reference, then click away and click back, it returns to Normal.
No doubt I have something all wrong in my head - is there no documentation for the UI (not just classes)?
-
Let's start over.
1. You have an HD atlas. Your widgets reference this atlas. Let's say it's called "Atlas".
2. Rename "Atlas" to "Reference".
3. Open it in explorer and duplicate it, creating a copy. Call it "HD".
4. Change your "Reference" atlas to be a reference, pointing to your "HD" atlas. If you don't drag & drop the reference to the atlas it should point to, it won't actually switch.
5. Create your "SD" atlas. Make sure you use the same sprite names. Don't prefix them with anything. The sprite names must match.
That's it.
-
Bingo, all good now - it was the suffixed sprite/filenames.
Obvious in hindsight, but I'm not used to using the same named files for two art sets - I was expecting it to be using indexed sprite numbers. No worries though, job done ;)
Thanks again!