for(int i=;i<;i++){
char str[];
sprintf(str,"%d",i); char totalFilename[];
strcpy(totalFilename, "game_loading") ;
const char* suffix = ".png";
strcat(totalFilename, str);
strcat(totalFilename, suffix);
log(totalFilename);
animation->setDelayPerUnit(0.2f);
log("%d",sizeof(str[])); char t = 'q';
log("char %d",sizeof(t)); float a = 10.30; log("t %d",sizeof(&a)); animation->addSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName(totalFilename));
}

读取XML

Dictionary* dic = Dictionary::createWithContentsOfFile("chineseString.xml");
String* strchinese = (String*)dic->objectForKey("startGame"); <?xml version="1.0" encoding="utf-8"?>
<plist version="1.0"> <dict> <key>startGame</key> <string>从XML里面读取的东东</string> <key>japanese</key> <string>地方</string>
</dict>
</plist>

创建动画Animation

Animation* HelloWorld::getAnimation(const char* stts[],int l,float delay){
Animation* ac = Animation::create();
ac->setDelayPerUnit(delay);
for(int i=;i<l;i++){
ac->addSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName(stts[i]));
}
return ac;
} Animation* HelloWorld::getAnimation(const std::string stts[],int l,float delay){
Animation* ac = Animation::create();
ac->setDelayPerUnit(delay);
for(int i=;i<l;i++){
ac->addSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName(stts[i]));
}
return ac;
}

最新文章

  1. iOSQuartz2D-04-手动剪裁图片并保存到相册
  2. Java 中正确使用 hashCode 和 equals 方法
  3. [Javascript] Object.assign()
  4. js 动态切换视频
  5. django 创建一个通用视图
  6. 数据挖掘学习笔记--AdaBoost算法(一)
  7. [HDU1001] Sum Problem
  8. js 实现倒计时效果
  9. oracle 权限
  10. V4L2驱动的移植与应用(二)
  11. 新概念英语(1-97)A Small Blue Case
  12. JProfiler的详细使用介绍
  13. element-ui中table表头表格错误问题解决
  14. Python爬虫利器二之Beautiful Soup的用法
  15. pytest三:fixture_conftest.py 自定义测试用例的预置条件(setup)
  16. java JDBC (六) org.apache.commons.dbutils 增删改
  17. 【BZOJ】1831: [AHOI2008]逆序对
  18. The Django Book第六章(Admin)随笔
  19. php 统计一维数组中重复的元素个数
  20. 【Linux】目录文件权限的查看和修改【转】

热门文章

  1. 使用离线包部署kubernetes 1.9.0、kubernetes-dashboard 1.8
  2. 14 Go&#39;s Declaration Syntax go语言声明语法
  3. Windows 10安装MongoDB(安装&amp;启动)
  4. docker使用Dockerfile构建ssh容器
  5. django(1)安装及配置
  6. ZOJ 3537 Cake(凸包+区间DP)
  7. 题解-python-CodeForces 1A
  8. win7下scheme环境配置
  9. HTML5移动应用左右滑动touchmove touchmove touchend 实例
  10. JSON解析代码