Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Tatanan on May 04, 2015, 10:09:04 AM
Title:
Check if a spritename exists in a UISprite
Post by:
Tatanan
on
May 04, 2015, 10:09:04 AM
If I make
uiSprite
.
spriteName
=
"xxx"
;
I'm changing the sprite of a UISprite object.
But, how could I know if "xxx" is indeed in the atlas, ie, if it exists?
Title:
Re: Check if a spritename exists in a UISprite
Post by:
r.pedra
on
May 04, 2015, 10:15:43 AM
if
(
atlas
.
GetSprite
(
"spriteName"
)
!=
null
)
Where atlas is the atlas. If you have multiple atlas and need to find in which atlas it is, you have to do the test on each atlas