---
title: "CCMotionStreak轨迹"
author: "rayln"
date: "2013-12-04T21:12:00Z"
tags: []
categories: ["移动开发"]
slug: "ccmotionstreak"
draft: false
lastmod: "2013-12-04T21:12:37Z"
id: 1985328
url: "https://rayln.iteye.com/blog/1985328"
---

```c++

//参数1：轨迹持续时间
//参数2：轨迹的步长（每个轨迹的间隔）
//参数3：轨迹的高度
//参数4：颜色
//参数5：轨迹对应图片
CCMotionStreak *streak = CCMotionStreak::create(2.0f, 1, 20, ccc3(255,0,0),"/res/helloworld.png");

this->addChild(streak);
streak.setPosition(ccp(200,200));//设定位置后，轨迹才会被显示

```