#import "CCMotionStreak.h"
Inherits CCNode, and CCTextureProtocol-p.
Public Member Functions | |
(id) | - initWithFade:minSeg:image:width:length:color: |
(void) | - update: |
Static Public Member Functions | |
(id) | + streakWithFade:minSeg:image:width:length:color: |
Properties | |
CCRibbon * | ribbon |
CCMotionStreak manages a Ribbon based on it's motion in absolute space. You construct it with a fadeTime, minimum segment size, texture path, texture length and color. The fadeTime controls how long it takes each vertex in the streak to fade out, the minimum segment size it how many pixels the streak will move before adding a new ribbon segement, and the texture length is the how many pixels the texture is stretched across. The texture is vertically aligned along the streak segemnts.
Limitations: CCMotionStreak, by default, will use the GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA blending function. This blending function might not be the correct one for certain textures. But you can change it by using: [obj setBlendFunc: (ccBlendfunc) {new_src_blend_func, new_dst_blend_func}];
- (id) initWithFade: | (float) | fade | ||
minSeg: | (float) | seg | ||
image: | (NSString *) | path | ||
width: | (float) | width | ||
length: | (float) | length | ||
color: | (ccColor4B) | color | ||
initializes a MotionStreak. The file will be loaded using the TextureMgr.
+ (id) streakWithFade: | (float) | fade | ||
minSeg: | (float) | seg | ||
image: | (NSString *) | path | ||
width: | (float) | width | ||
length: | (float) | length | ||
color: | (ccColor4B) | color | ||
creates the a MotionStreak. The image will be loaded using the TextureMgr.
- (void) update: | (ccTime) | delta |
polling function
- (CCRibbon*) ribbon [read, assign] |
Ribbon used by MotionStreak (weak reference)