FAQ Database Discussion Community


Android app can't install after switching from Apportable to Cocos2d-x

android,cocos2d-x,code-signing,apportable
Recently I have switched from using Apportable to Cocos2d-x but unfortunately when I try to update my app it says that App not installed Also Google Play Game Services shows me warning that The application is incorrectly configured. Check that the package name and signing certificate match the client...

CCScrollView returns one children

cocos2d-x,cocos2d-x-3.0,ccscrollview
I am working on cocos2dx 3.0, and working on cocos2d::extension::ScrollView, getting a strange problem, is the scrollview doesn't return all the Nodes added to it, just returns one child, that too a different one.. See my code below void Characters::setupScroll(){ Size winSize = Director::getInstance()->getWinSize(); if(!scrollView){ scrollView=cocos2d::extension::ScrollView::create(Size(winSize.width*1.0,winSize.height*0.8)); scrollView->setDirection(cocos2d::extension::ScrollView::Direction::HORIZONTAL);...

Cocos2dx 3.x button sprite [C++]

c++,cocos2d-x,cocos2d-x-3.0
I can't find a way to load the button image from a given .plist file instead of a plain texture. Using Button::create("normal_image.png", "selected_image.png", "disabled_image.png"); or button->loadTextures("normal_image.png", "selected_image.png", "disabled_image.png"); Search for a png and not use the sprite file in the cache. [EDIT] I just want to put a sprite instead...

Undefined symbols in cryptopp at IOS 64-bit project

c++,ios,xcode,cocos2d-x,crypto++
I tried to build with github's prebuilt cryptopp but it doesn't work, too. it occur errors like below: Undefined symbols for architecture arm64: "CryptoPP::BufferedTransformation::ChannelFlush(std::string const&, bool, int, bool)", referenced from: vtable for CryptoPP::SimpleProxyFilter in MYCLASSBBB.o vtable for CryptoPP::Bufferless<CryptoPP::Filter> in MYCLASSBBB.o "CryptoPP::Filter::CopyRangeTo2(CryptoPP::BufferedTransformation&, unsigned long long&, unsigned long long, std::string const&, bool)...

applicationDidEnterBackground + Director->stopAnimation() = black screen

android,cocos2d-x
In my AppDelegate's applicationDidEnterBackground() I call cocos2d::Director::getInstance()->stopAnimation() and in applicationWillEnterForeground() I call cocos2d::Director::getInstance()->startAnimation(). But applicationDidEnterBackground can be called with the game still visible on screen, and not only when the game is minimized with the home button (and becomes invisible), for example when you start a buy process in your...

Set background color Text Field on cocos2d-x-3.3beta0

cocos2d-iphone,cocos2d-x
I am creating a text using Text class like below using cocos2d-x-3.3beta0. Text* MessageText = Text::create(message, FONT, FONT_SIZE); I have set the size of text area MessageText ->setTextAreaSize(Size(100,150)); Now i want to color text area which is background of text . Is there any way to do this? Thanks...

Error while instantiating an object without inheritance

c++,cocos2d-x
So far I was using classes inheriting from other classes, now I had the need to creating a class inheriting from anything. I called it from my client class and I'm getting error that doesn't make sense to me. what am I doing wrong? MathHelp .h public: float addPerc(float whole,...

Eclipse Cocos2d-x app not change after changing the source

java,android,eclipse,cocos2d-x
I am working with Eclipse using cocos2d-x 3.4 the problem is when I changing code in cpp files under "Class" folder nothing is changes when I start the app. But the changes are applied in Visual studio also when I change java files changes applied too. Any ideas whats wrong?

How to import cocos2dx project in eclipse

android,eclipse,cocos2d-x
I have a problem and want to help from you . I get some Cocos2dx source code I want to publish on the play store I want someone to show me how to add Cocos2dx on eclipse on a Windows machine so I will be able to publish those code...

In CoCos2dx how to use admob and google play sevices together

admob,cocos2d-x,google-play-services
I was trying to integrate both Google pay services and Admob together in my Android game developing in Cocos2dx.But I'm getting this error Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode; Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode; Please help me to...

make: *** [obj/local/armeabi/objs/cocos2dcpp_shared/hellocpp/main.o] Error 1

android,eclipse,android-ndk,cocos2d-x,cocos2d-x-3.0
I am trying to port cocos2dx game on android plat from. When I build the project the following message appears Build of configuration Release for project test_pro python /Users/itronix/Documents/Rizwan_Projects/cocos2dx_3_2/workspace/test_pro/proj.android/build_native.py -b release all Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml Android NDK: WARNING:jni/../../cocos2d/cocos/./Android.mk:cocos2dx_static: LOCAL_LDLIBS is always...

Get Content Size of string

c++,string,cocos2d-x
Is it possible to get content size of a string in c++. I'm not talking about length here. I want to place strings in a row one after the other, say on a label but don't want to get content size of label.I need to get space a string covers...

Cocos2d C++ Identify CCSprites with UserData?

c++,windows,cocos2d-x,ccsprite,userdata
I am stuck in my Game cause I have to much Sprites in CCArrays. I identify the function of the Sprite on it's Tags, but it's not working, cause I only can use Ints as Tag. So I decided to make UserData like this: int* nums = new int(2); background->setUserData((void*)nums);...

Initialized property CCArray is still NULL after new CCArray

cocos2d-x,cocos2d-x-3.0
I have in scene class property in private section like private: CCArray* objects; and in init I initialize objects = new CCArray(); but when I put breakpoint in line below objects is NULL and I don't know why. It crashes when I call objects->count(); Why I cannot initialize property ?...

convertToNodeSpace confusion

cocos2d-x,collision-detection
I try to capture intersectsRect between 2 sprites after reading this : http://www.cocos2d-x.org/wiki/Coordinate_System#convertToNodeSpace i have this hierarchy of sprites +Root |-Child_1 | |--Child_1_of_Child_1 |-Child_2 in code its simple Sprite* root = Sprite::create(); Sprite* Child_1 = Sprite::create(); Sprite* Child_1_of_Child_1 = Sprite::create(); Sprite* Child_2 = Sprite::create(); root->addChild(Child_1); Child_1->addChild(Child_1_of_Child_1 ); root->addChild(Child_2); i want...

How to include SimpleAudioEngine to Linux build in cocos2d-x v3.3 project?

linux,cocos2d-x,cocos2d-x-3.0
I'm trying use SimpleAudioEngine in my project. I include the SimpleAudiEngine header to AppDelegate. #include "SimpleAudioEngine.h" When I build my project for Android everything compiles and build is fine. SimpleAudioEngine working is correct. If run build for Linux, I get an error message: fatal error: SimpleAudioEngine.h: No such file or...

Calling java function from c++ using jni: Failed to find static method id

java,android,c++,jni,cocos2d-x
I'm creating cocos2d-x game (v. 3.4) on mac os using android sdk 4.2.2, but I tried other too. I want to make NativeHelper class to call some native android stuff from c++. I used this tutorial as the base: http://www.cocos2d-x.org/wiki/User_Tutorial-Integrate_AdMob It's working, but I want use a java function with...

Setting a custom shader messes up the scale and position of a Sprite

cocos2d-x,cocos2d-x-3.0
I am using a custom shader on cocos2dx 3.1 trying to accomplish an special effect on a sprite used as a background (has to cover the whole screen) However If i do not use the shader, the sprite is perfectly scaled and positioned, but when i do use it its...

TextureCache::addImageAsync selector typecast issue

c++,ios,cocos2d-x
I'm trying to use addImageAsync for the first time, but i cannot get the syntax working. I'm using Cocos2dx 3.3 final and Xcode 6.1.1. My code is as follows : (GFXManager.h) #include "cocos2d.h" class GFXManager { ... void loadStuff(); void textureLoaded(Ref* pObj); } (GFXManager.cpp) ... void GFXManager::loadStuff() { std::string path...

How to make TMXTiledMap responsive?

android,opengl-es,cocos2d-x,resolution,tiled
My game is a 2D car-based one, with a straight infinite map where I've finally been able to add some random obstacles. There are only 3 positions the car can be at, and everything is working fine. The point is that I've recently noticed that it is not responsive, and...

Getting error: Execution failed for task : myApp:compileDebugNdk'

android,android-studio,android-ndk,cocos2d-x,cocos2d-android
Hi I am trying to run an app created with Cocos2d-x 2.5 with Android Studio but I keep getting this error when running the project: :myApp:compileDebugNdk AGPBI: {"kind":"ERROR","text":"*** Android NDK: Aborting... . Stop.","sourcePath":"/mypath/ndk/android-ndk-r10d/build/core/add-application.mk","position":{"startLine":199},"original":""} FAILED Execution failed for task ':myApp:compileDebugNdk'. Building works ok. I have Android Studio 1.1.0 and a Mac...

Cocos2d-x editor for Linux?

linux,ubuntu,editor,cocos2d-x,cocos2d-x-3.0
I'm currently using Ubuntu for developing purposes and in free time I wanted to check out Cocos2d-x. The problem is that there aren't provided any officially supported editors for Linux. Regarding the fact that Cocos2d-x has very poor documentation, I don't think I can use it without a decent editor....

Cocos2d-x compile android cannot run program

cocos2d-x,cocos2d-android
created new cocos2d-x 3.6 project with cocos console comnand new -l cpp, all variables are set by running setup.py, then when i try to run cocos compile i get compilation errors. log: log.txt Cheked if there are spaces in paths but there isn't, everything is installed....

SimpleAudioEngine, background Volume down on playEffect then back up

android,cocos2d-x,simpleaudioengine
In Cocos2d (android) Im trying to down the Background Volume when playEffect runs and than after the playEffect ends to bring it back up. I have this code: auto audio = SimpleAudioEngine::getInstance(); audio->playBackgroundMusic("sound/abc-theme.mp3", true); audio->setBackgroundMusicVolume(0.1); audio->playEffect("sound/airplane.mp3", false, 1.0f, 1.0f, 1.0f); audio->setBackgroundMusicVolume(1); The problem is that i dont know how would...

Compiling OpenSSL on Android

c++,ssl,android-ndk,openssl,cocos2d-x
I'm currently trying to get my Cocos2D-X project to connect to my server through SSL and I got it to work on iOS without a lot of issues, however on Android I'm not able to even get OpenSSL to compile.. I've searched on Google quite a lot but all posts...

fontconfig/fontconfig.h not found in Codeblocks

cocos2d-x,codeblocks
I am trying to build Cocos2d-x project in Codeblocks IDE in Ubuntu 14. I got fontconfig/fontconfig.h not found error during compiling. I'm stuck here. How can I solve this?

Is there any wrong in the testcpp code of Cocos2d-X?

c++,cocos2d-x
I have donwload the Cocos2d-X and compile the testcpp. But there is something wrong with it, I locate it and find the following code has something wrong. debugForNormalSprite->drawPoints(positions, 4, 8, Color4F{0.0,1.0,1.0,1.0}); after I check the definition of drawPoints function. I change the braces to parentheses and it works. Is the...

adding files to all platforms of a cocos2d-x project

cocos2d-x,cocos2d-x-3.0
This is a very basic question, but I have not been able to find the answer anywhere. I just got Cocos 2Dx 3.3, made a new project and built the HelloWorld scene that was generated. It generated projects for all platforms, but I am currently compiling and running the Mac...

Can I refactor name libcocos2dcpp.so?

android,cocos2d-x,cocos2d-x-3.0,cocos2d-x-2.x
libcocos2dcpp.so is located at path proj.android\libs\armeabi 1) I want to learn to modify how it looks after changing the name "libcocos2dcpp.so" to some "randomname.so" (Intention being, not sure but it might help in protecting my game's source code if people won't know in which thing it is made, I mean...

How to implement Android in-app purchase in Cocos2d-x v3.5

android,c++,in-app-purchase,cocos2d-x,android-billing
I'm using cocos2d-x v3.5 and I want to add In-app purchase feature to my game. I gave a try for built-in plugin of cocos2d-x but had no luck (http://www.cocos2d-x.org/wiki/Plugin-X_Integration_Guide_for_Android I read this guide). Then I try to implement Soomla framework, I follow the instruction from here https://github.com/soomla/cocos2dx-store but can't compile...

Integrating iAd with AdMob displays only black screen

objective-c,admob,cocos2d-x,iad,cocos2d-x-3.0
I am facing issues while combining iAd and Admob in Cocos2d 3.0. The whole screen goes black. I have created a view controller which handles loading of iAd and Admob. Here is my code on pastie.org, I believe required steps to integrate iAd and Admob are known to users reading...

cc.textureCache.addImage blocking UI

cocos2d-x,cocos2d-x-3.0,cocos2d-js
I want to cache lot of textures in a running scene without blocking it, theoretically cc.textureCache.addImage do caching async if you call it the three arguments. This is not happening. Code: rainOfArrows: { _animFrames:[], loaded: function(){ console.log('>>>>>>>>>>>>>>LOAD!') }, load: function(){ /* Load all animation arrow sprites in memory & generate...

How to get the width of a Node?

c++,cocos2d-x,cocos2d-x-3.0
The idea is that I have a parent Node as a container with a bunch of Sprites as children, and that I can have the Node's width include the width of the children, since I'm assuming the size would encompass its children, but it doesn't look like it. I've got...

Handling touches on child layer Cocos2d-x

c++,ios,cocos2d-x,event-listeners
I've added a layer as a child in a scene. I want when I touch any sprite on this child layer , touch does not go to parent layer. I've written following code for register touch events but touches still going to parent layer, instead of returning back from it....

How To Change A Sprite Image When Tapped

c++,ios,cocos2d-x,cocos2d-x-3.0
I know this is probably one of the easiest questions ever to answer, but I've done some searching and can't seem to find the answer to this... How do I change a sprites image when the user taps on it in Cocos2d-x? The only way I know of is using...

How to Replace a CCString?

cocos2d-x
Is there anything similar to a string Replace method for CCString? something like that takes another 2 CCString parameters, switching the first with the second

Move a sprite along a particular direction cocos2d

python,cocos2d-x,cocos2d-python
I want to move a sprite along a particular direction until next keypress in cocos2d. The code to handle a keypress is as follows, def on_key_press(self, symbol, modifiers): if symbol == key.LEFT: DIRECTION="left" before=self.player.position height=self.player.position[1] width=self.player.position[0]-1 self.player.position=width,height self.player.rotation=-90 if(height>=600 or height<=0): print ("you lose) if(width>=800 or width<=0): print ("you lose)...

OpenGL ES 2.0 with static (Fixed Function) pipeline API?

opengl-es,cocos2d-x
I know that OpenGL ES 2.0 standard threw out all the methods that can achieve the same results only keeping one. This is the result why static pipeline is removed from the specification and only dynamic pipeline is present. But it is strange that I use this code and it...

ClassCastException: com.soomla.SoomlaApp cannot be cast to org.cocos2dx.cpp.AnalyticsApplication

android,google-analytics,crash,cocos2d-x,soomla
I want to implement Google-Analytics and Soomla Store for In-App-Purchase. The problem is, every time I want to track a screen, my app crashes with Android. Under iOS it works like a charm. The reason for the crash: java.lang.ClassCastException: com.soomla.SoomlaApp cannot be cast to org.cocos2dx.cpp.AnalyticsApplication I think there is an...

no matching constructor for initialization of cccolor4f in cocos2d-x

objective-c,cocos2d-x
I am creating a game like bounce ball using cocos2d-x and box2d. I want to draw a circle and fill with color. But i am getting the following error. "no matching constructor for initialization of cccolor4f" I am using the following code to draw a circle. CCDrawNode *drawnode = CCDrawNode::create();...

Convert Platform::String to std::string

c#,c++,windows-phone-8,cocos2d-x,winrt-component
I am getting String^ which Contains some Indian language characters in a callback from C# Component in my C++ WinRT Component in a Cocos2dx game for Windows Phone 8 project. Whenever I convert it to std::string the Hindi and other characters turn in to garbage characters. I'm not able to...

Why cocos2d-x schedule changed the member object?

c++,cocos2d-x
I have these two classes in cocos2d-x project: class A : public Layer { ... B * b; void callAddNumber(float dt); } A::A() { b = B::create(); } void A::callAddNumber(float dt) { b->addNumber(); } class B : public Node { ... int number; B(); void addNumber(); } B::B() { number...

ndk-stack.exe just show “Segmentation fault”

c++,android-ndk,segmentation-fault,g++,cocos2d-x
I program a game with cocos2d-x. In some case my game crashes. I use "ndk-stack" to find crash point, but the ndk-stack just show "Segmentation fault". How can I get more information about the cause of crash?

Cocos2dx 3.4 - manipulating user input

text,input,user,field,cocos2d-x
I am working on a breakout-type game using Cocos2dx, and I need some help, as I am a complete novice. Currently I need to make a highscore table. After the game is finished, I'd like to display a page, where player types his username into text field. The problem is...

Cocos2dx Android and IOS build

cocos2d-iphone,cocos2d-x,cocos2d-x-3.0
I have downloaded latest version of cocos2d-x from this link. And worked on Visual Studio Environment and finished. Now I am going to build it to Android and IOS for extra processes. What can I do?...

Create Dynamic Body using cocos 2d js and Chipmunk

javascript,cocos2d-x,game-physics,chipmunk,cocos2d-js
I am fairly new to cocos 2d and chipmunk. So far i have managed to create a static object and add collision handler to it. But i want to create a dynamic.``this.space = space; this.sprite = new cc.PhysicsSprite("#rock.png"); var body = new cp.StaticBody(); body.setPos(pos); this.sprite.setBody(body); this.shape = new cp.BoxShape(body, this.sprite.getContentSize().width,...

How to create Spot Light Effect in cocos2d-x

cocos2d-iphone,cocos2d-x
I am creating a game in cocos2d-x and want to create spotlight effect in it on my character. Is there any way to do it without using OpenGl? if not how can i do it with openGL? Thanks in Advance...

cocos2d draw something on top of the sprite

cocos2d-x,cocos2d-x-3.0
I am very new to cocos2d. I have read the basic concept of sprite and action. I was wondering after I created a sprite (from an image file). and I want to draw some numbers on the sprite on the fly, is that something doable? or you can not draw...

Simultaneous touches on scene

touch,cocos2d-x,cocos2d-x-3.0
I am having one problem while working on touches on the screen. I have two modules attached on the screen, on the Left there is a Joystick which has its own touches, and on the right side I have set of Buttons which have its own actions or, touches, both...

Action for changing the color of layer?

cocos2d-x
My game consists of a single scene which is a LayerColor. However, as I transition between "levels", I would like to change the background color via a smooth transition. For example, if the rgb values of level 1 is (100,50,70) , and the rgb values of level 2 is (200,30,123)....

Cocos 2dx iOS 64bit support

ios,xcode,cocos2d-x,arm64
I made a project with cocos2dx and it is working properly. I changed the build settings to make it support 64bit. I soon got errors. So I changed cocos2dx library with one supports 64 bit support. But I cannot find libwebsocket.a support 64bit. Please help me if there is easier...

Cocos2d-x. How to add action on the sprite after the previous one was finished

action,cocos2d-x,sequence
I add action on the sprite. auto moveBy = MoveBy::create(2, Vec2(moveX, moveY)); _Spr1->runAction(moveBy); I want to add another action on touch, but I want that the second one started after the first one is finished. And if I tap two times before first action stops, I want to create sequence...

CCParallaxNode moves on and convertToWorldSpace give wrong values cocos2d iPhone

ios,objective-c,iphone,cocos2d-iphone,cocos2d-x
I have used the code below for collision detection. but as CCParallaxNode moves on in infinite scrolling. my positions goes wrong. i have tries every possible solution till yet. but everything gives me wrong values in parallax. for (CCSprite *sp in PathsArray) { if (sp.tag==500) { CGPoint sprect=[self convertToWorldSpace:sp.position]; CGRect...

How to replace cocos2d-x scene from Java?

java,android,jni,cocos2d-x
I want to replace the scene in a cocos2d project from Java. I created the following JNI methods: void cocos_android_app_init (JNIEnv* env, jobject thiz) { LOGD("cocos_android_app_init"); AppDelegate *pAppDelegate = new AppDelegate(); } extern "C" { JNIEXPORT void JNICALL Java_com_example_myapp_MainActivity_changeScene( JNIEnv* env, jobject thiz){ cocos2d::Scene* scene = MyScene::createScene(); Director::getInstance()->replaceScene( TransitionFade::create( 1,...

Migrate Cocos2d-x project from Mac to Ubuntu

c++,osx,ubuntu,cocos2d-x
I'm developing a game on C++ using Cocos2d-x v3.5. I use latest Xcode and have no problems with make & run. But my friend who wishes help me can't run my project on his Ubuntu. We guess something is wrong with cocos2d make-files (we've found 2 named CMakeLists.txt ). Are...

linker error when not starting with “HelloWorld” scene

c++,osx,linker,cocos2d-x
I've just started to use Cocos2d-x c++ (Version 3.4), and I'm trying to build a simple game for Mac, but when I change this line in AppDelegate.cpp auto scene = HelloWorld::createScene(); to my custom Scene auto scene = KeyboardScene::createScene(); I get this linker error: Undefined symbols for architecture x86_64: "KeyboardScene::createScene()",...

EXE_BAD_BADACCESS trying to access GKMatch?

cocos2d-x,real-time,game-center,invite,gkmatchmaker
The Problem In Brief Trying to play with a friend in real-time using gamecenter causes a crash during gameplay Project Details I am using gamecenter with cocos2dx I am using the SANDBOX mode: Both accounts being tested are in sandbox mode 2 Ipads are used for testing (IOS 8.3) I...

cocos2dx 3.3 animation implementation

c++,cocos2d-x,cocos2d-x-3.0,cocos2d-android,cocos2d-js
I am new in cocos2dx development.I almost learn all basic level of cocos2dx (version 3.3) in android using cpp language. I showing that there are lots of update over cocos2dx.org. In android I am currently developing the tetris game using cocos2dx version 3.3, I want to know what is the...

Cocos2d-x Change MenuItemImage on cursor focus

android,c++,cocos2d-x
Using Cocos2d-x 3.4 on Windows7. How to change "MenuItemImage" image on mouse cursor focus? (on Windows) ** I want "mouse over(hover) effect" to MenuItemImage. ** I know, how to create "not touch" or "clicking" button. auto button = MenuItemImage::create( "button_normal.png", "button_pressed.png", [](Ref* ref){ // do anything if clicking }); auto...

Why am I getting “missing ';' before '*' ”?

c++,cocos2d-x
I'm new in c++ and I am working some stuff with cocos2d-x I wanted to create just a simple Size property in the .h file to use in the implementation along different methods keeping its state. what am I missing here? #ifndef __INTROBETTER_SCENE_H__ #define __INTROBETTER_SCENE_H__ #include "cocos2d.h" class IntroBetterScene :...

multiple Cocos2dxActivity based activities eventually crash

android,cocos2d-x
I have an Android app with 5 Activities in it that are derived from Cocos2dxActivity. Each activity is a short game/puzzle that the user plays in a random sequence. This works for around 10 starts, but eventually the Activity will crash, and the app will show the last activity from...

Cocos2dx soundengine issue on Android Lolipop

android,cocos2d-x,android-5.0-lollipop,cocos2d-x-3.0,cocos2d-x-2.x
I am having an issue with Cocos2dx 2.2.6 on Android 5. After playing my game for a little while it starts to severely lag. This does not happen with Android 4. After doing some research many people have said it is a problem with Android 5 working with Cocos2dx's Audio...

(SOLVED) Java build path error in cocos2dx 3.6

java,ant,path,android-ndk,cocos2d-x
I migrated from cocos2dx 3.1.1 to 3.6 yesterday. And when I make new project and build in eclipse, I get the following error: could not open 'C:\Program Files (x86)\Java\jre7\lib\i386\jvm.cfg This isn't simple problem. I have quadraple checked environment variables. Although all of my environ variable is on E:\, build_native is...

cocos2d-x use create() method in update method

cocos2d-x
i use cocos2d-x for my game. i have some question about cocos2d-x create method. i always use create() method to create new Animation , Animate , RepeatForever Object when the game character needs to change the animation in Update Method but i think this is not good because if i...

Google Play Game Services C++ integration

android,c++,cocos2d-x
Sorry For My Bad English I am new in cocos2d-x, i am trying to develop an application uses the google game services, I installed my environment with cocos2d-x 3.4 and NDKr10c I followed the steps of this solution but I have a problem in the InitServices method I have two...

fatal error: Box2D.h: No such file or directory

android,cocos2d-x,box2d
I have developed a game in xcode using cocos2d-x 2.2.3 and box2d. Now i am trying to port from ios to android. However i am getting the following error while build through terminal. In file included from jni/../../Classes/LevelScene.cpp:1:0: jni/../../Classes/LevelScene.h:6:19: fatal error: Box2D.h: No such file or directory compilation terminated. make:...

Read data saved with CCUserDefault

javascript,local-storage,cocos2d-x,cocos2d-js
I’m converting my game from cocos2d-x 2.2.3 to cocos2d-js 3.2, but the players already have saved progress using the old CCUserDefaults. Now that I have to use localStorage in cocos2d-js, how can I read the old data that was saved using CCUserDefaults? I don’t want players to lose their progress...

How to add a Label to a ProgressTimer's Sprite in Cocos2dx?

c++,cocos2d-x,cocos2d-x-3.0
I'm trying to get a ProgressTimer to work with a Sprite that's got a Label as a child. It seems like only the Sprite and none of its children are being used as the sprite for the progress bar. I've got the label created, added it to the sprite. I...

How to retrieve the visible texture from a png image in cocos2d-x

cocos2d-x,cocos2d-x-3.0
I am making a question answer game in which the answer images are made as sprites from png images. The answer image is like this: I am making rect on the image like this: Rect rect = Rect(answerSprites.at(i)->getBoundingBox().origin.x, answerSprites.at(i)->getBoundingBox().origin.y, answerSprites.at(i)->getBoundingBox().size.width, answerSprites.at(i)->getBoundingBox().size.height); Then i am detecting touch on the rect as...

How to build Android NDK cocos2d-x project from within Eclipse?

android,eclipse,android-ndk,cocos2d-x
I set up an Android project that uses cocos2d-x. Now I want to build the project in Eclipse but I get the build error Android NDK: jni/Android.mk: Cannot find module with tag '.' in import path Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ? Android NDK:...

How to add a sqlite library in Eclipse java edition?

android,c++,eclipse,cocos2d-x,undefined-reference
I'm working with a cocos2dx c++ android project that I compile with Eclipse (java edition). Everything has worked great until I try to use sqlite3. I'm pretty sure the code is correct. sqlite3 *pdb = NULL; int result; std::string path = FileUtils::getInstance()->getWritablePath(); path.append("mydb.db"); FILE* file = fopen(path.c_str(), "r"); if (file...