CCLayerGradient Class Reference
Inherits from | CCLayerColor : CCLayerRGBA : CCLayer : CCNode : NSObject |
Declared in | CCLayer.h |
Overview
CCLayerGradient is a subclass of CCLayerColor that draws gradients across the background.
All features from CCLayerColor are valid, plus the following new features: – direction – final color – interpolation mode
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.
Tasks
-
+ layerWithColor:fadingTo:
Creates a full-screen CCLayer with a gradient between start and end.
-
+ layerWithColor:fadingTo:alongVector:
Creates a full-screen CCLayer with a gradient between start and end in the direction of v.
-
– initWithColor:fadingTo:
Initializes the CCLayer with a gradient between start and end.
-
– initWithColor:fadingTo:alongVector:
Initializes the CCLayer with a gradient between start and end in the direction of v.
-
startColor
The starting color.
property -
endColor
The ending color.
property -
startOpacity
The starting opacity.
property -
endOpacity
The ending color.
property -
vector
The vector along which to fade color.
property -
compressedInterpolation
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
property
Properties
compressedInterpolation
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
@property (nonatomic, readwrite) BOOL compressedInterpolation
Declared In
CCLayer.h
endColor
The ending color.
@property (nonatomic, readwrite) ccColor3B endColor
Declared In
CCLayer.h
endOpacity
The ending color.
@property (nonatomic, readwrite) GLubyte endOpacity
Declared In
CCLayer.h
startColor
The starting color.
@property (nonatomic, readwrite) ccColor3B startColor
Declared In
CCLayer.h