Skip to content

Instantly share code, notes, and snippets.

@marcin-maciukiewicz
Created November 9, 2010 12:31
Show Gist options
  • Save marcin-maciukiewicz/669032 to your computer and use it in GitHub Desktop.
Save marcin-maciukiewicz/669032 to your computer and use it in GitHub Desktop.
// starts at line no. 214
//
// assume propertyValue='impact-normal-italic-26-green.png'
NSString *textureAtlasName = [CCFileUtils fullPathFromRelativePath:propertyValue];
// at this point textureAtlasName=absolute path to the file
// e.g.
// /Users/ciukes/Library/Application Support/iPhone Simulator/4.0.1/Applications/ \
// B4DF07F2-1155-450C-9BE8-103821559323/CFFontServer-Test.app/impact-normal-italic-26-green.png
//
// Why the following is used?
NSString *relDirPathOfTextureAtlas = [fntFile stringByDeletingLastPathComponent];
//
atlasName = [relDirPathOfTextureAtlas stringByAppendingPathComponent:textureAtlasName];
// Now atlasName is invalid. it contains relDirPathOfTextureAtlas+textureAtlasName
// where:
// - 'relDirPathOfTextureAtlas' is a folder
// - 'textureAtlasName' is a absolute path to the texture file,
// e.g.
// /Users/ciukes/Library/Application Support/iPhone Simulator/4.0.1/Applications/ \
// B4DF07F2-1155-450C-9BE8-103821559323/CFFontServer-Test.app/Users/ciukes/Library/Application Support/ \
// iPhone Simulator/4.0.1/Applications/B4DF07F2-1155-450C-9BE8-103821559323/CFFontServer-Test.app/ \
// impact-normal-italic-26-green.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment