void CCMotionStreakCreator::endNode(CCNode* pNode) { CCMotionStreak* pMotionStreak = (CCMotionStreak*)pNode; pMotionStreak->initWithFade(ccXmlAttrParse::toFloat(mAttrMap["fade"].c_str()), ccXmlAttrParse::toFloat(mAttrMap["segment"].c_str()), ccXmlAttrParse::toFloat(mAttrMap["stroke"].c_str()), ccXmlAttrParse::toColor3B(mAttrMap["color"].c_str()), mAttrMap["file"].c_str()); CCNodeCreator::setAttribute(pNode); }
CCMotionStreak * CCMotionStreak::streakWithFade(float fade, float seg, StreamSource* source, float width, float length, const ccColor4B& color) { CCMotionStreak *pRet = new CCMotionStreak(); if(pRet && pRet->initWithFade(fade, seg, source, width, length, color)) { pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet) return NULL; }
CCMotionStreak* CCMotionStreak::create(float fade, float minSeg, float stroke, const ccColor3B& color, CCTexture2D* texture) { CCMotionStreak *pRet = new CCMotionStreak(); if (pRet && pRet->initWithFade(fade, minSeg, stroke, color, texture)) { CC_SAFE_AUTORELEASE(pRet); return pRet; } CC_SAFE_DELETE(pRet); return NULL; }
CCMotionStreak* CCMotionStreak::create(float fade, float minSeg, float stroke, ccColor3B color, const char* path) { CCMotionStreak *pRet = new CCMotionStreak(); if (pRet && pRet->initWithFade(fade, minSeg, stroke, color, path)) { pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet); return NULL; }