例:local a = CCSprite:create("XXX.png")
local moveto = CCMoveTo:create(ccp(30, 20), 2)
a:runAction(moveto)
在 cocos2d-x 2.x 的 AssetsManager sample 范例中提供了一个 reset 方法,这个方法使用系统命令递归删除文件夹。void UpdateLayer::reset(cocos2d::CCObject *pSender)
{
pProgressLabel->setString(" ")
// Remove downloaded files
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)
string command = "rm -r "
// Path may include space.
command += "\"" + pathToSave + "\""
system(command.c_str())
#else
string command = "rd /s /q "
// Path may include space.
command += "\"" + pathToSave + "\""
system(command.c_str())
#endif
// Delete recorded version codes.
getAssetsManager()->deleteVersion()
createDownloadedDir()
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)