cocos2d-x

unable to process assets while packaging cocos2d-x android

陌路散爱 提交于 2019-12-30 05:01:06
问题 I just started working on cocos2d-x to build games. I have completed setup. I am getting below error when I run "HelloCpp" sample. (skipping file '.gitignore' due to ANDROID_AAPT_IGNORE pattern '.*') Unable to add 'C:\cocos2d-x-2.2.1\samples\Cpp\HelloCpp\proj.android\assets\fonts\Marker Felt.ttf': Zip add failed ERROR: unable to process assets while packaging 'C:\cocos2d-x-2.2.1\samples\Cpp\HelloCpp\proj.android\bin\resources.ap_' ERROR: packaging of 'C:\cocos2d-x-2.2.1\samples\Cpp\HelloCpp

Android.mk - build all source file in a directory

血红的双手。 提交于 2019-12-30 04:34:08
问题 I am using Android NDK to build my cocos2dx project, within the Android.mk, there is a definition for LOCAL_SRC_FILES where each of the cpp file are listed. Whenever I added a new source file, I'd need to add it there as well... it looks like this: LOCAL_SRC_FILES := hellocpp/main.cpp \ hellocpp/myclass.cpp \ hellocpp/mynextclass.cpp \ ../../Classes/Screens/LaunchScreen.cpp \ the header file, however, can specify the entire directory to include, it looks like this: LOCAL_C_INCLUDES := $(LOCAL

Android.mk - build all source file in a directory

て烟熏妆下的殇ゞ 提交于 2019-12-30 04:34:06
问题 I am using Android NDK to build my cocos2dx project, within the Android.mk, there is a definition for LOCAL_SRC_FILES where each of the cpp file are listed. Whenever I added a new source file, I'd need to add it there as well... it looks like this: LOCAL_SRC_FILES := hellocpp/main.cpp \ hellocpp/myclass.cpp \ hellocpp/mynextclass.cpp \ ../../Classes/Screens/LaunchScreen.cpp \ the header file, however, can specify the entire directory to include, it looks like this: LOCAL_C_INCLUDES := $(LOCAL

How to debug cocos2d-x 3 native code on android device

♀尐吖头ヾ 提交于 2019-12-29 03:12:27
问题 I could not find any cookbook/tutorial how build in debug build a cocos2d-x 3.1 project for Android and how to debug it directly on device. Please help by pointing out steps. What I do and what problems I have: cd proj.android cocos compile -p android -m debug --ndk-mode NDK_DEBUG=1 (to build with debug info) cocos run -p android -m debug to deploy on device run app on the device cd jni ndk-gdb And I get this error: Nareks-MacBook-Pro:jni Narek$ ndk-gdb jni/Android.mk:67: *** Android NDK:

How to debug cocos2d-x 3 native code on android device

ε祈祈猫儿з 提交于 2019-12-29 03:12:14
问题 I could not find any cookbook/tutorial how build in debug build a cocos2d-x 3.1 project for Android and how to debug it directly on device. Please help by pointing out steps. What I do and what problems I have: cd proj.android cocos compile -p android -m debug --ndk-mode NDK_DEBUG=1 (to build with debug info) cocos run -p android -m debug to deploy on device run app on the device cd jni ndk-gdb And I get this error: Nareks-MacBook-Pro:jni Narek$ ndk-gdb jni/Android.mk:67: *** Android NDK:

cocos2d-x for wp之精灵动作——Actions

若如初见. 提交于 2019-12-27 09:31:39
CCFiniteTimeAction:有限次动作执行类,就是按时间顺序执行一系列动作,执行完后动作结束;这里我们就是学习这个类 从图中,我们可以看出动作主要分为两大类: CCActionInstanse(瞬时动作的基类)和CCActionInterval(延时动作的基类) CCActionInstanse(瞬时动作的基类) : CCCallFunc :执行函数 CCFlipX/Y: X/Y翻转 CCHide :隐藏 CCPlace : 设置位置 CCReuseGrid :重用网格 CCShow :显示 CCStopGrid :停止网格 CCToggleVisibility : 可见切换 CCActionInterval(延时动作的基类)我们用的最多的就是延时动作。CCActionInterval的子类有很多,可以通过cocos2d-x自带的tests例子来学习。 主要有这些动作: CCMoveTo/CCMoveBy :移动 CCScaleTo/CCScaleBy:缩放 CCRotateTO/CCRotateBy:旋转 CCSkewTo/CCSkewBy :扭曲 CCJumpTo/CCJumpBy :跳跃 CCBezierTo/CCBezierBy :贝塞尔曲线 CCBink :闪烁 CCFadeIn/CCFadeOut :淡入淡出 CCTintTo/CCTintBy :染色

Cannot create CCSprite with subfolder png when port to Android application with cocos2d-x?

拈花ヽ惹草 提交于 2019-12-25 07:27:01
问题 I met the problem I cannot create CCSprite in cocos2d-x Android. I have a xml file which store the file path. And I read the file path to create a Sprite. The Sprite is NULL. CCSprite* pSprite1 = CCSprite::create(tempfilename.c_str()); tempfilename contains withword\\stone_0.png .All my resources is located under assets\.. ,and this png is located under assets\withword\stone_0.png . I don't know why I cannot create this sprite. How can I solve this problem? I have checked this topic but still

implement proguard with cocoas2d

故事扮演 提交于 2019-12-25 06:28:41
问题 I have used cocos2d-x to develop the game. now i have applied pro-guard to it, resolved all the warnings. Finally I exported the api. The pro-guard worked fine for me. But when I tested the api, the application crashed. Without proguard the application works smoothly. Any solution for on how to implement proguard with cocos2dx.? 回答1: Can you share your proguard rules with us ? Did you add a rule to tell Proguard to avoid obfuscating native methods ? -keepclasseswithmembernames

implement proguard with cocoas2d

前提是你 提交于 2019-12-25 06:28:09
问题 I have used cocos2d-x to develop the game. now i have applied pro-guard to it, resolved all the warnings. Finally I exported the api. The pro-guard worked fine for me. But when I tested the api, the application crashed. Without proguard the application works smoothly. Any solution for on how to implement proguard with cocos2dx.? 回答1: Can you share your proguard rules with us ? Did you add a rule to tell Proguard to avoid obfuscating native methods ? -keepclasseswithmembernames

How to resize the the animating sprite in cocos2d-x

ⅰ亾dé卋堺 提交于 2019-12-25 05:51:00
问题 I want to change the size of a Sprite which is animating. How can I do this ? I tried to change its size by using setScale property but it is not working here. where I am doing wrong ? CCArray* frames = CCArray::createWithCapacity(3); CCSpriteFrameCache* frameCache = CCSpriteFrameCache::sharedSpriteFrameCache(); char file[100] = {0}; for (int i = 0; i < 3; i++) { sprintf(file, "bird%d.png", i); CCSpriteFrame* frame = frameCache->spriteFrameByName(file); frames->addObject(frame); } CCAnimation