cocos2d-iphone  1.0.1
Improved Cocos2D API Reference (iOS version) for Kobold2D developers
CCMotionStreak Interface Reference

#include <CCMotionStreak.h>

+ Inheritance diagram for CCMotionStreak:
+ Collaboration diagram for CCMotionStreak:

List of all members.

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

CCRibbonribbon_
float segThreshold_
float width_
CGPoint lastLocation_

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


Property Documentation

CCRibbon* CCMotionStreak::ribbon [read, assign]

Ribbon used by MotionStreak (weak reference)


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