Public Member Functions | Static Public Member Functions | Properties

CCMotionStreak Class Reference

#import "CCMotionStreak.h"

Inherits CCNode, and CCTextureProtocol-p.

Collaboration diagram for CCMotionStreak:
[legend]

List of all members.

Public Member Functions

(id) - initWithFade:minSeg:image:width:length:color:
(void) - update:

Static Public Member Functions

(id) + streakWithFade:minSeg:image:width:length:color:

Properties

CCRibbonribbon

Detailed Description

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}];

Since:
v0.8.1

Member Function Documentation

- (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


Property Documentation

- (CCRibbon*) ribbon [read, assign]

Ribbon used by MotionStreak (weak reference)


The documentation for this class was generated from the following file: