![]() |
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
|
#import <CCLayer.h>
Public Member Functions | |
(id) | - initWithColor:fadingTo: |
(id) | - initWithColor:fadingTo:alongVector: |
Static Public Member Functions | |
(id) | + layerWithColor:fadingTo: |
(id) | + layerWithColor:fadingTo:alongVector: |
Protected Attributes | |
GLubyte | _startOpacity |
GLubyte | _endOpacity |
CGPoint | _vector |
BOOL | _compressedInterpolation |
Properties | |
ccColor3B | _endColor |
ccColor3B | startColor |
ccColor3B | endColor |
GLubyte | startOpacity |
GLubyte | endOpacity |
CGPoint | vector |
BOOL | compressedInterpolation |
CCLayerGradient is a subclass of CCLayerColor that draws gradients across the background.
All features from CCLayerColor are valid, plus the following new features:
Color is interpolated between the startColor and endColor along the given vector (starting at the origin, ending at the terminus). If no vector is supplied, it defaults to (0, -1) -- a fade from top to bottom.
If 'compressedInterpolation' is disabled, you will not see either the start or end color for non-cardinal vectors; a smooth gradient implying both end points will be still be drawn, however.
If ' compressedInterpolation' is enabled (default mode) you will see both the start and end colors of the gradient.
- (id) initWithColor: | (ccColor4B) | start | |
fadingTo: | (ccColor4B) | end | |
Initializes the CCLayer with a gradient between start and end.
- (id) initWithColor: | (ccColor4B) | start | |
fadingTo: | (ccColor4B) | end | |
alongVector: | (CGPoint) | v | |
Initializes the CCLayer with a gradient between start and end in the direction of v.
+ (id) layerWithColor: | (ccColor4B) | start | |
fadingTo: | (ccColor4B) | end | |
Creates a full-screen CCLayer with a gradient between start and end.
+ (id) layerWithColor: | (ccColor4B) | start | |
fadingTo: | (ccColor4B) | end | |
alongVector: | (CGPoint) | v | |
Creates a full-screen CCLayer with a gradient between start and end in the direction of v.
- (BOOL) compressedInterpolation [read, write, assign] |
Whether or not the interpolation will be compressed in order to display all the colors of the gradient both in canonical and non canonical vectors Default: YES
- (GLubyte) endOpacity [read, write, assign] |
The ending color.
- (ccColor3B) startColor [read, write, assign] |
The starting color.
- (GLubyte) startOpacity [read, write, assign] |
The starting opacity.
- (CGPoint) vector [read, write, assign] |
The vector along which to fade color.