![]() |
cocos2d-iphone
1.0.1
Improved Cocos2D API Reference (iOS version) for Kobold2D developers
|
#include <CCMotionStreak.h>
Public Member Functions | |
id | initWithFade:minSeg:image:width:length:color: (float fade,[minSeg] float seg,[image] NSString *path,[width] float width,[length] float length,[color] ccColor4B color) |
void | update: (ccTime delta) |
Static Public Member Functions | |
id | streakWithFade:minSeg:image:width:length:color: (float fade,[minSeg] float seg,[image] NSString *path,[width] float width,[length] float length,[color] ccColor4B color) |
Protected Attributes | |
CCRibbon * | ribbon_ |
float | segThreshold_ |
float | width_ |
CGPoint | lastLocation_ |
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 CCMotionStreak::initWithFade:minSeg:image:width:length:color: | ( | float | fade, |
[minSeg] float | seg, | ||
[image] NSString * | path, | ||
[width] float | width, | ||
[length] float | length, | ||
[color] ccColor4B | color | ||
) | [virtual] |
initializes a MotionStreak. The file will be loaded using the TextureMgr.
id CCMotionStreak::streakWithFade:minSeg:image:width:length:color: | ( | float | fade, |
[minSeg] float | seg, | ||
[image] NSString * | path, | ||
[width] float | width, | ||
[length] float | length, | ||
[color] ccColor4B | color | ||
) | [static, virtual] |
creates the a MotionStreak. The image will be loaded using the TextureMgr.
void CCMotionStreak::update: | ( | ccTime | delta | ) | [virtual] |
polling function
CCRibbon* CCMotionStreak::ribbon [read, assign] |
Ribbon used by MotionStreak (weak reference)