|
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 Matt Oswald 00005 * 00006 * Copyright (c) 2009-2010 Ricardo Quesada 00007 * Copyright (c) 2011 Zynga Inc. 00008 * 00009 * Permission is hereby granted, free of charge, to any person obtaining a copy 00010 * of this software and associated documentation files (the "Software"), to deal 00011 * in the Software without restriction, including without limitation the rights 00012 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00013 * copies of the Software, and to permit persons to whom the Software is 00014 * furnished to do so, subject to the following conditions: 00015 * 00016 * The above copyright notice and this permission notice shall be included in 00017 * all copies or substantial portions of the Software. 00018 * 00019 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00020 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00021 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00022 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00023 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00024 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00025 * THE SOFTWARE. 00026 * 00027 */ 00028 00029 00030 #import "CCNode.h" 00031 #import "CCProtocols.h" 00032 #import "CCTextureAtlas.h" 00033 #import "ccMacros.h" 00034 00035 #pragma mark CCSpriteBatchNode 00036 00037 @class CCSprite; 00038 00054 @interface CCSpriteBatchNode : CCNode <CCTextureProtocol> 00055 { 00056 CCTextureAtlas *textureAtlas_; 00057 ccBlendFunc blendFunc_; 00058 00059 // all descendants: chlidren, gran children, etc... 00060 CCArray *descendants_; 00061 } 00062 00064 @property (nonatomic,readwrite,retain) CCTextureAtlas * textureAtlas; 00065 00067 @property (nonatomic,readwrite) ccBlendFunc blendFunc; 00068 00070 @property (nonatomic,readonly) CCArray *descendants; 00071 00075 +(id)batchNodeWithTexture:(CCTexture2D *)tex; 00076 +(id)spriteSheetWithTexture:(CCTexture2D *)tex DEPRECATED_ATTRIBUTE; 00077 00081 +(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity; 00082 +(id)spriteSheetWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity DEPRECATED_ATTRIBUTE; 00083 00088 +(id)batchNodeWithFile:(NSString*) fileImage; 00089 +(id)spriteSheetWithFile:(NSString*) fileImage DEPRECATED_ATTRIBUTE; 00090 00095 +(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity; 00096 +(id)spriteSheetWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity DEPRECATED_ATTRIBUTE; 00097 00101 -(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity; 00106 -(id)initWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity; 00107 00108 -(void) increaseAtlasCapacity; 00109 00117 -(CCSprite*) createSpriteWithRect:(CGRect)rect DEPRECATED_ATTRIBUTE; 00118 00127 -(void) initSprite:(CCSprite*)sprite rect:(CGRect)rect DEPRECATED_ATTRIBUTE; 00128 00132 -(void)removeChildAtIndex:(NSUInteger)index cleanup:(BOOL)doCleanup; 00133 00137 -(void)removeChild: (CCSprite *)sprite cleanup:(BOOL)doCleanup; 00138 00139 -(void) insertChild:(CCSprite*)child inAtlasAtIndex:(NSUInteger)index; 00140 -(void) removeSpriteFromAtlas:(CCSprite*)sprite; 00141 00142 -(NSUInteger) rebuildIndexInOrder:(CCSprite*)parent atlasIndex:(NSUInteger)index; 00143 -(NSUInteger) atlasIndexForChild:(CCSprite*)sprite atZ:(NSInteger)z; 00144 00145 @end