// My Example 图片加密测试,images.pvr.ccz,images.plist
//88558730 4af885af f4539888 8ed3b5aa
ZipUtils::ccSetPvrEncryptionKey(0x88558730 , 0x4af885af , 0xf4539888 , 0x8ed3b5aa);
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("test.plist");
CCSprite* sprite = CCSprite::……继续阅读 »
sharezer
11年前 (2015-11-27) 4529浏览 0评论
2个赞
Andriod的CocoStudio和NetWork环境,要在Android.mk中增加:
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_gui_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
$(call impor……继续阅读 »
sharezer
11年前 (2015-11-27) 2484浏览 0评论
1个赞
参考:
http://www.cnblogs.com/andyque/archive/2012/03/18/2404651.html
http://www.cnblogs.com/bandok123/archive/2012/03/02/2377023.html
在Mac下,用终端转换音频格式:
背景(转aac)
gelivsoftmatoiMac:mp3 lsz$ find . -name '*.mp3' -exec afconvert -f caff -d 'aac' {} ;
音效(转ima4)
geli……继续阅读 »
sharezer
11年前 (2015-11-27) 2557浏览 0评论
1个赞
Cocos2d-x 3.0 以后,运行build_native.py 直接编译打包apk。
build_native.py会将Resources中的内容直接拷贝assets中,如果Resoucres有版本控制。.svn文件夹一样会被拷贝过去。
当assets目录中已经存在.svn文件夹时,就会编译报错。
所以每次运行py文件前都要先把assets清空。
也通过修改build_native.py,来达到不拷贝.svn文件夹的目的。
def copy_files(src, dst):
for item in os.listdir(src):
……继续阅读 »
sharezer
11年前 (2015-10-22) 2565浏览 0评论
1个赞
到3.1.1以后仍然有这个问题。
下图只加了一个ListView。帧数直接掉了十到二十帧。
只需要修改AppActivity.java,将TestCpp里面的代码直接拷贝进去覆盖,即可解决上述问题。
public Cocos2dxGLSurfaceView onCreateView()
{
Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);
// TestCpp should create stencil buffer
g……继续阅读 »
sharezer
11年前 (2015-10-22) 4483浏览 0评论
1个赞
#include "JsonBox.h"
std::string path = "test.json”;
//注意引入路径
path = cocos2d::CCFileUtils::sharedFileUtils()->fullPathForFilename(path.c_str());
/*写入文件*/
JsonBox::Object o;
o["myName"] = JsonBox::Value(123);
o["myOtherMember"] = JsonBox::Value("asld\kfn&q……继续阅读 »
sharezer
11年前 (2015-10-22) 3255浏览 0评论
1个赞
Cocos2d-X 3.0 中自带了rapidjson,用于解析Json。
可以直接拿过来使用,只要引入头文件
#include "json/document.h"
char json[100] = "{"hello": "world"}";
rapidjson::Document d1;
d1.Parse<0>(json);
log("json1: %s", d1["hello"].GetString());
//2.从文件读取
std::string f……继续阅读 »
sharezer
11年前 (2015-10-22) 2522浏览 0评论
1个赞