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.
//example
new cc.MotionStreak(2, 3, 32, cc.color.GREEN, s_streak);

Field Detail

{Boolean} fastMode
- Indicate whether use fast mode.
{Boolean} startingPositionInitialized
- Indicate whether starting position initialized.
{cc.Texture2D} texture
- Texture used for the motion streak.

Method Detail

  • <static> {cc.MotionStreak} cc.MotionStreak.create(fade, minSeg, stroke, color, texture)
    Please use new cc.MotionStreak instead.
    Creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename or texture
    //example
    new cc.MotionStreak(2, 3, 32, cc.color.GREEN, s_streak);
    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
    Deprecated:
    since v3.0 please use new cc.MotionStreak instead.
    Returns:
    {cc.MotionStreak}
  • ctor(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
    Constructor of cc.MotionStreak
    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
  • {cc.BlendFunc} getBlendFunc()
    Gets the blend func.
    Returns:
    {cc.BlendFunc}
  • {number} getOpacity()
    Gets opacity.
    Returns:
    {number}
  • {Number} getPositionX()
    Gets the position.x
    Returns:
    {Number}
  • {Number} getPositionY()
    Gets the position.y
    Returns:
    {Number}
  • {cc.Texture2D} getTexture()
    Gets the texture.
    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}
  • {boolean} isFastMode()
    Checking fast mode.
    Returns:
    {boolean}
  • {boolean} isOpacityModifyRGB()
    Checking OpacityModifyRGB.
    Returns:
    {boolean}
  • {boolean} isStartingPositionInitialized()
    Checking starting position initialized.
    Returns:
    {boolean}
  • reset()
    Remove all living segments of the ribbon
  • setBlendFunc(src, dst)
    Set the blend func.
    Parameters:
    {Number} src
    {Number} dst
  • setFastMode(fastMode)
    set fast mode
    Parameters:
    {Boolean} fastMode
  • setOpacity(opacity)
    Set opacity.
    Parameters:
    opacity
  • setOpacityModifyRGB(value)
    set opacity modify RGB.
    Parameters:
    value
  • setPosition(position, yValue)
    Set the position.
    Parameters:
    {cc.Point|Number} position
    {Number} yValue Optional, Default: undefined
    If not exists, the first parameter must be cc.Point.
  • setPositionX(x)
    Set the position.x
    Parameters:
    {Number} x
  • setPositionY(y)
    Set the position.y
    Parameters:
    {Number} y
  • setStartingPositionInitialized(startingPositionInitialized)
    Set Starting Position Initialized.
    Parameters:
    {Boolean} startingPositionInitialized
  • setTexture(texture)
    Set the texture.
    Parameters:
    {cc.Texture2D} texture
  • tintWithColor(color)
    color used for the tint
    Parameters:
    {cc.Color} color
  • update(delta)

    schedules the "update" method.
    It will use the order number 0. This method will be called every frame.
    Scheduled methods with a lower order value will be called before the ones that have a higher order value.
    Only one "update" method could be scheduled per node.

    Parameters:
    {Number} delta