Author Topic: Referencing Sprites without using Strings?  (Read 1697 times)

Tranas

  • Guest
Referencing Sprites without using Strings?
« on: February 12, 2013, 07:42:57 PM »
First off, NGUI is incredible.
My entire work on this current game project has been with using NGUI and I have to say it's made my life (and job) ridiculously easier.

However, I've run up against a wall here.
And I'm almost 100% certain you can only reference sprites from the atlas by sprite name (String), but why?
Is there a reason that there isn't a more secure method of programatically referencing sprites from the atlas?
I wouldn't imagine using ID Numbers would be far more secure?

Thanks Aren, you rock.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Referencing Sprites without using Strings?
« Reply #1 on: February 13, 2013, 01:52:09 PM »
String names were used for simplicity. It's a lot easier to remember sprite "ABC" than sprite "54263". That said, it's less of an issue now that there is a visual sprite selection dialog.

Tranas

  • Guest
Re: Referencing Sprites without using Strings?
« Reply #2 on: February 13, 2013, 03:28:00 PM »
Very true. I wasn't aware that once upon a time there wasn't a visualization for this sort of thing.
I would suggest adding in sprite IDs for atlas makers so that they could be referenced like that as well for more air-tight programming standards.

Thanks for the speedy reply!!