MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, const std::string& path) { MotionStreak *ret = new (std::nothrow) MotionStreak(); if (ret && ret->initWithFade(fade, minSeg, stroke, color, path)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }
MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture) { MotionStreak *ret = new MotionStreak(); if (ret && ret->initWithFade(fade, minSeg, stroke, color, texture)) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }
MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, const char* path) { MotionStreak *pRet = new MotionStreak(); if (pRet && pRet->initWithFade(fade, minSeg, stroke, color, path)) { pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet); return NULL; }