How could I get the image file path of a sprite in string form in cocos2d?
Are there any classes or methods that specifically do this? The easiest and simplest way would be appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You must get texture of sprite (
CCTexture2DorCCTextureAtlas). It would be value for some string key inCCTextureCachetextures. This key is your path.As I see in Cocos2d,
CCTextureCachehas no property/method to access its textures, so you need to expand this (for example in category):@end
So, to get path for some sprite: