Welcome,
Guest
. Please
login
or
register
.
September 07, 2024, 12:07:34 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Check if a spritename exists in a UISprite
« previous
next »
Print
Pages: [
1
]
Author
Topic: Check if a spritename exists in a UISprite (Read 1868 times)
Tatanan
Jr. Member
Thank You
-Given: 11
-Receive: 0
Posts: 81
Check if a spritename exists in a UISprite
«
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?
Logged
Game developer on
Casual Arena
.
r.pedra
Full Member
Thank You
-Given: 7
-Receive: 20
Posts: 131
Re: Check if a spritename exists in a UISprite
«
Reply #1 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
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Check if a spritename exists in a UISprite