• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

/depot/cocosdocs/cocos2d-iphone-0.99.5/cocos2d/CCLayer.h

00001 /*
00002  * cocos2d for iPhone: http://www.cocos2d-iphone.org
00003  *
00004  * Copyright (c) 2008-2010 Ricardo Quesada
00005  * 
00006  * Permission is hereby granted, free of charge, to any person obtaining a copy
00007  * of this software and associated documentation files (the "Software"), to deal
00008  * in the Software without restriction, including without limitation the rights
00009  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00010  * copies of the Software, and to permit persons to whom the Software is
00011  * furnished to do so, subject to the following conditions:
00012  * 
00013  * The above copyright notice and this permission notice shall be included in
00014  * all copies or substantial portions of the Software.
00015  * 
00016  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00019  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00020  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00021  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00022  * THE SOFTWARE.
00023  *
00024  */
00025 
00026 
00027 
00028 #import <Availability.h>
00029 #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
00030 #import <UIKit/UIKit.h>                                        // Needed for UIAccelerometerDelegate
00031 #import "Platforms/iOS/CCTouchDelegateProtocol.h"              // Touches only supported on iOS
00032 #elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
00033 #import "Platforms/Mac/CCEventDispatcher.h"
00034 #endif
00035 
00036 #import "CCProtocols.h"
00037 #import "CCNode.h"
00038 
00039 //
00040 // CCLayer
00041 //
00048 #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
00049 @interface CCLayer : CCNode <UIAccelerometerDelegate, CCStandardTouchDelegate, CCTargetedTouchDelegate>
00050 {
00051          BOOL isTouchEnabled_;
00052          BOOL isAccelerometerEnabled_;
00053 }
00067 -(void) registerWithTouchDispatcher;
00068 
00077 @property(nonatomic,assign) BOOL isTouchEnabled;
00085 @property(nonatomic,assign) BOOL isAccelerometerEnabled;
00086 
00087 #elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
00088 
00089 
00090 @interface CCLayer : CCNode <CCKeyboardEventDelegate, CCMouseEventDelegate>
00091 {
00092          BOOL     isMouseEnabled_;
00093          BOOL     isKeyboardEnabled_;
00094 }
00095 
00100 @property (nonatomic, readwrite) BOOL isMouseEnabled;
00101 
00106 @property (nonatomic, readwrite) BOOL isKeyboardEnabled;
00107 
00114 -(NSInteger) mouseDelegatePriority;
00115 
00122 -(NSInteger) keyboardDelegatePriority;
00123 
00124 #endif // mac
00125 
00126 
00127 @end
00128 
00129 //
00130 // CCLayerColor
00131 //
00138 @interface CCLayerColor : CCLayer <CCRGBAProtocol, CCBlendProtocol>
00139 {
00140          GLubyte           opacity_;
00141          ccColor3B         color_;  
00142          GLfloat squareVertices[4 * 2];
00143          GLubyte squareColors[4 * 4];
00144          
00145          ccBlendFunc       blendFunc_;
00146 }
00147 
00149 + (id) layerWithColor: (ccColor4B)color width:(GLfloat)w height:(GLfloat)h;
00151 + (id) layerWithColor: (ccColor4B)color;
00152 
00154 - (id) initWithColor:(ccColor4B)color width:(GLfloat)w height:(GLfloat)h;
00156 - (id) initWithColor:(ccColor4B)color;
00157 
00159 -(void) changeWidth: (GLfloat)w;
00161 -(void) changeHeight: (GLfloat)h;
00165 -(void) changeWidth:(GLfloat)w height:(GLfloat)h;
00166 
00168 @property (nonatomic,readonly) GLubyte opacity;
00170 @property (nonatomic,readonly) ccColor3B color;
00172 @property (nonatomic,readwrite) ccBlendFunc blendFunc;
00173 @end
00174 
00180 DEPRECATED_ATTRIBUTE @interface CCColorLayer : CCLayerColor
00181 @end
00182 
00183 
00184 //
00185 // CCLayerGradient
00186 //
00205 @interface CCLayerGradient : CCLayerColor
00206 {
00207          ccColor3B endColor_;
00208          GLubyte startOpacity_;
00209          GLubyte endOpacity_;
00210          CGPoint vector_;
00211 }
00212 
00214 + (id) layerWithColor: (ccColor4B) start fadingTo: (ccColor4B) end;
00216 + (id) layerWithColor: (ccColor4B) start fadingTo: (ccColor4B) end alongVector: (CGPoint) v;
00217 
00219 - (id) initWithColor: (ccColor4B) start fadingTo: (ccColor4B) end;
00221 - (id) initWithColor: (ccColor4B) start fadingTo: (ccColor4B) end alongVector: (CGPoint) v;
00222 
00224 - (ccColor3B) startColor;
00225 - (void) setStartColor:(ccColor3B)colors;
00226 
00228 @property (nonatomic, readwrite) ccColor3B endColor;
00230 @property (nonatomic, readwrite) GLubyte startOpacity;
00232 @property (nonatomic, readwrite) GLubyte endOpacity;
00234 @property (nonatomic, readwrite) CGPoint vector;
00235 
00236 @end
00237 
00243 @interface CCMultiplexLayer : CCLayer
00244 {
00245          unsigned int enabledLayer;
00246          NSMutableArray *layers;
00247 }
00248 
00250 +(id) layerWithLayers: (CCLayer*) layer, ... NS_REQUIRES_NIL_TERMINATION;
00252 -(id) initWithLayers: (CCLayer*) layer vaList:(va_list) params;
00256 -(void) switchTo: (unsigned int) n;
00260 -(void) switchToAndReleaseMe: (unsigned int) n;
00261 @end

Generated on Tue Jan 25 2011 13:01:43 for Unofficial Cocos2D for iOS 0.99.5 API Reference by  doxygen 1.7.1