|
cocos2d for iPhone 1.0.0
2D engine for iOS and OS X
|
00001 /* 00002 * cocos2d for iPhone: http://www.cocos2d-iphone.org 00003 * 00004 * Copyright (c) 2009 Jason Booth 00005 * 00006 * Copyright (c) 2009 Robert J Payne 00007 * 00008 * Copyright (c) 2008-2010 Ricardo Quesada 00009 * Copyright (c) 2011 Zynga Inc. 00010 * 00011 * 00012 * Permission is hereby granted, free of charge, to any person obtaining a copy 00013 * of this software and associated documentation files (the "Software"), to deal 00014 * in the Software without restriction, including without limitation the rights 00015 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00016 * copies of the Software, and to permit persons to whom the Software is 00017 * furnished to do so, subject to the following conditions: 00018 * 00019 * The above copyright notice and this permission notice shall be included in 00020 * all copies or substantial portions of the Software. 00021 * 00022 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00023 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00024 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00025 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00026 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00027 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00028 * THE SOFTWARE. 00029 * 00030 */ 00031 00032 00033 /* 00034 * To create sprite frames and texture atlas, use this tool: 00035 * http://zwoptex.zwopple.com/ 00036 */ 00037 00038 #import <Foundation/Foundation.h> 00039 00040 #import "CCSpriteFrame.h" 00041 #import "CCTexture2D.h" 00042 00043 @class CCSprite; 00044 00049 @interface CCSpriteFrameCache : NSObject 00050 { 00051 NSMutableDictionary *spriteFrames_; 00052 NSMutableDictionary *spriteFramesAliases_; 00053 } 00054 00056 + (CCSpriteFrameCache *) sharedSpriteFrameCache; 00057 00060 +(void)purgeSharedSpriteFrameCache; 00061 00062 00065 -(void) addSpriteFramesWithDictionary:(NSDictionary*)dictionary texture:(CCTexture2D*)texture; 00066 00071 -(void) addSpriteFramesWithFile:(NSString*)plist; 00072 00075 -(void) addSpriteFramesWithFile:(NSString*)plist texture:(CCTexture2D*)texture; 00076 00080 -(void) addSpriteFramesWithFile:(NSString*)plist textureFile:(NSString*)textureFileName; 00081 00085 -(void) addSpriteFrame:(CCSpriteFrame*)frame name:(NSString*)frameName; 00086 00087 00094 -(void) removeSpriteFrames; 00095 00100 -(void) removeUnusedSpriteFrames; 00101 00104 -(void) removeSpriteFrameByName:(NSString*)name; 00105 00111 - (void) removeSpriteFramesFromFile:(NSString*) plist; 00112 00116 - (void) removeSpriteFramesFromDictionary:(NSDictionary*) dictionary; 00117 00122 - (void) removeSpriteFramesFromTexture:(CCTexture2D*) texture; 00123 00128 -(CCSpriteFrame*) spriteFrameByName:(NSString*)name; 00129 00135 -(CCSprite*) createSpriteWithFrameName:(NSString*)name DEPRECATED_ATTRIBUTE; 00136 00137 @end