Class cc.MotionStreak

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.MotionStreak manages a Ribbon based on it's motion in absolute space.

Method Summary

Class Detail

cc.MotionStreak()
cc.MotionStreak 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 segment, and the texture
length is the how many pixels the texture is stretched across. The texture
is vertically aligned along the streak segment.

Method Detail

  • <static> {cc.MotionStreak} cc.MotionStreak.create(fade, minSeg, stroke, color, texture)
    creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename or texture
    Parameters:
    {Number} fade
    time to fade
    {Number} minSeg
    minimum segment size
    {Number} stroke
    stroke's width
    {Number} color
    {string|cc.Texture2D} texture
    texture filename or texture
    Returns:
    {cc.MotionStreak}
  • ctor()
    Constructor
  • draw(ctx)
    Parameters:
    {WebGLRenderingContext} ctx
  • {cc.BlendFunc} getBlendFunc()
    Returns:
    {cc.BlendFunc}
  • {cc.Texture2D} getTexture()
    Returns:
    {cc.Texture2D}
  • {Boolean} initWithFade(fade, minSeg, stroke, color, texture)
    initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture filename or texture
    Parameters:
    {Number} fade
    time to fade
    {Number} minSeg
    minimum segment size
    {Number} stroke
    stroke's width
    {Number} color
    {string|cc.Texture2D} texture
    texture filename or texture
    Returns:
    {Boolean}
  • reset()
    Remove all living segments of the ribbon
  • setBlendFunc(src, dst)
    Parameters:
    {Number} src
    {Number} dst
  • setFastMode(fastMode)
    set fast mode
    Parameters:
    {Boolean} fastMode
  • setPosition(position, yValue)
    Parameters:
    {cc.Point} position
    yValue
  • setTexture(texture)
    Parameters:
    {cc.Texture2D} texture
  • tintWithColor(colors)
    color used for the tint
    Parameters:
    {cc.Color3B} colors
  • update(delta)
    Parameters:
    {Number} delta