cocos2d-x

After import an cocos2d project, eclipse raise an two weird errors: “Android Library Update” , “C/C++ Indexer”

邮差的信 提交于 2019-12-12 18:16:08
问题 After importing an cocos2d project to eclipse, it raise two weird errors: "Android Library Update" , "C/C++ Indexer" Error: An internal error occured during :"C/C++" . java.lang.NullPointerException. An internal error occured during :"Android Library Update" . java.lang.NullPointerException. Thanks in advance. 回答1: See my answer https://stackoverflow.com/a/25892787/77156 I've been trying to fix this for a while, I'd suggest comparing the .cproject file in your project with the one in

How to call callfunc function in cocos2dx 3.0

让人想犯罪 __ 提交于 2019-12-12 11:47:40
问题 I have to convert objective c++ to C++ 11. I have stuck with the following syntax. I have referred in testcpp and try the following syntax. Here the code which i tried: this->runAction ( Sequence::create ( blink, CallFunc::create(CC_CALLBACK_0(Hero::stopBlinking, NULL)), -> issue this line. NULL ) ); It shows error "no matching function for call to 'bind'" in "CallFunc::create". Can any one assist or help me. 回答1: In your coding, just replace the below code: CallFuncN::create(CC_CALLBACK_1

How to make asynchronous HTTP call with callback in Lua?

泄露秘密 提交于 2019-12-12 10:07:40
问题 I need to make asynchronous HTTP call to my server in order to receive XML response. After I get the response I will call a [previously specified] function if it is success or some other function if it's an error. So what I thought about in the first place was coroutines. Unfortunately, after I make the http.get call I cannot yield, as it will wait for the whole thing to finish. I know I can use separate functions to read the response, however I have to wait at least for the first bytes of

Cocos2d-x on Android Studio - New CPP files are not listed

最后都变了- 提交于 2019-12-12 09:22:30
问题 Android Studio 2.3.3 (LATEST) Cocos2d-x 3.15.1 (LATEST) It's my first experience with Cocos2d-x Game Engine, I encountered a lot of problems. The first time I tried the latest NDK of Android Studio but there is a bug on this NDK version when I tried to compile my project with : cocos compile -p android --android-studio so I change the NDK version to 13b. When I changed to NDK 13b the compilation was done without any problems and android studio build my project successfully but when I tried to

How to use Android Studio with Cocos2d-x

ⅰ亾dé卋堺 提交于 2019-12-12 08:29:36
问题 I work as an android programmer for just under a year now, and I just started to learn about android game development. The framework I choose to work with is Cocos2d-x. I have seen guides and tutorials on how to use Cocos2d-x with eclipse, but I'd really like to know if it's possible to be used with Android Studio. From what I've read, it is now possible to build NDK projects with gradle in Android Studio, which is good news. Nevertheless, I have yet to find any information about C++

“cannot find module with tag 'CocosDenshion/android' in import path” error in cocos2dx app

偶尔善良 提交于 2019-12-12 08:18:34
问题 I am trying to compile Android native application developed on cocos2d-x. When i Try to debug my application i get the following error. Android NDK: jni/Android.mk: Cannot find module with tag 'CocosDenshion/android' in import path Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ? Android NDK: The following directories were searched: I have the following lines in my android.mk file $(Call import-add-path, $(LOCAL_PATH)/../../../CocosDenshion/android) LOCAL_WHOLE

Use new firebase sdk in android eclipse project

邮差的信 提交于 2019-12-12 07:10:34
问题 new firebase with awesome features was just announced, but according to documentation (https://firebase.google.com/docs/android/setup#prerequisites) android studio (as well as gradle) is required now. For now in my cocos2d-x apps I have to use ADT/Eclipse to build apps, because gradle isn't supported yet (however cocos2d-x team is working on it). I'm now using an older version of the sdk, which is just a jar file. Is there a way to use new firebase in eclipse? What worries me the most is that

Determine if object is touched/tapped

瘦欲@ 提交于 2019-12-12 05:02:12
问题 I've just started using Cocos 2D-X in Xcode. I'm trying to make a balloon popping game in order to learn the Cocos 2D-X library. So far, I'm able to show sprites and make them move. As for touch, I'm able to get the touch coordinates (and print it out on the console). Now, what I want to do is to have the balloons (a CCSprite object) "pop" (be removed from the layer). I'm looking around for solutions and one of them is to check if the touch location is in the CCSprite rect. But all the things

Can't get a CCPointArray to work in Cocos2D-x

和自甴很熟 提交于 2019-12-12 04:33:44
问题 I want to create a an array of points (_grid). However, I can't seem to use this CCPointArray anywhere except the function it's created in. I've tried making it public in my class and declaring it in my header, but all fail. Any tips? 回答1: after CCPointArray* p = CCPointArray::create(8); did you call p->retain(); ? and remember to release it in your destructor or onExit(); in your YOUR_CLASS.h file class YOUR_CLASS : public cocos2d::CCLayer { CCPointArray* p; public: CREATE_FUNC(YOUR_CLASS);

Why does this downscaling algorithm produce artifacts?

▼魔方 西西 提交于 2019-12-12 04:28:51
问题 I have a scaling algorithm which appears to scale the image to the right size, but produces artefacts(slight image corruption) in the right half of the image. As I am inexperienced using pointers, I suspect I may have blundered with my pointer arithmetic! To run the project on OSX: 1. Download from :https://www.dropbox.com/s/myme1z1mkxjwyjf/artifact.zip?dl=0 Open the xcodeproj file found in proj.ios All code that is of relevance, is in HelloWorldScene.cpp In function test(), you can comment