Author Topic: dummy fonts and atlases  (Read 3452 times)

Alan Gray

  • Guest
dummy fonts and atlases
« on: June 29, 2012, 09:05:55 PM »
I have my atlas and font swapping NOT using dummy atlases or fonts. I'm seeing some strange things and I'm wondering if it due to not using dummies. We are using a triple-atlas scheme. Everything is designed with the middle atlas. When a scene starts, I check the screen resolution and set the replacement on the real atlas to the alternate atlas. One thing I occasionally see is error messages like the one below for sprites that aren't even in that particular atlas (we're using several atlases).

Can't find the sprite 'Interstate-64' in UIAtlas on "AtlasR2_Common"

Another thing is that our git client often says the font prefabs have been modified after running in the editor and font swapping. Will dummy fonts and atlases make everything all better?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: dummy fonts and atlases
« Reply #1 on: June 29, 2012, 10:21:25 PM »
You should use a reference atlas anyway. Pure reference atlas. The idea is that before deploying, you can clear the reference atlas's pointer, and do a build. Then when you actually run your scene, none of your atlases will be in memory until you explicitly choose one and Resources.Load it. With your approach you will have two atlases in memory at the same time, which is bad. Plus each atlas prefab has its own data, so that gets duplicated too... with the reference atlas, it's empty, so you don't get this.

All atlases need to have identical sprites. Instead of "Interstate-64" use "Interstate", for example -- something that doesn't have a number that changes between your atlases.

Alan Gray

  • Guest
Re: dummy fonts and atlases
« Reply #2 on: June 30, 2012, 12:36:21 PM »
OK - the memory is a strong argument for using references. How would that work for fonts? Does the setup below look correct?

Real atlases and fonts:
Atlas1 (low res)
Atlas2 (medium res)
Atlas3 (hi res)
FontA1 (uses Atlas1)
FontA2 (uses Atlas2)
FontA3 (uses Atlas3)
FontB1 (uses Atlas1)
FontB2 (uses Atlas2)
FontB3 (uses Atlas3)

Dummy default setup:
AtlasDummy -> Atlas2
FontADummy -> FontA2
FontBDummy -> FontB2

Switching to hi-res atlases and fonts (3):
AtlasDummy.replacement = Atlas3;
FontADummy.replacement = FontA3;
FontBDummy.replacement = FontB3;

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: dummy fonts and atlases
« Reply #3 on: June 30, 2012, 01:54:00 PM »
Looks proper.