Category : cocos2d-x

This problem doesn’t occur in the files that are already created automatically, such as AppDelegate.h/.cpp and HelloWorldScene.h/.cpp. However, any file I created fail to detect cocos2d.h. Even if I can successfully include HelloWorldScene.h, which is in the same directory and has cocos2d.h included, I am still unable to reach cocos2d files in the file I ..

Read more

debug error image I am using cocos2dx and calling firebase with NDK native helpers Email authentication working fine but sign in with google showing error same error every time -(void) initialize { [FIRApp configure]; [GIDSignIn sharedInstance].clientID = @"MY_ID_HERE"; [GIDSignIn sharedInstance].delegate = self; } getting error in below function – (void)signIn:(GIDSignIn *)signIn didSignInForUser:(GIDGoogleUser *)user withError:(NSError *)error ..

Read more

I have a project which I build on Android and Linux in cocos2d-x. In this I have a little rocket-ship which has 2 thrusters with both have its own little flame. I build the Node for it like this: //create ship node this->shipNode = cocos2d::Node::create(); this->addChild(shipNode); //place it in the middle of the screen shipNode->setPosition(Vec2(visibleSize.width ..

Read more

I used resource of 2048×1536 for all iPad device. Resolution is not perfect in iPad Air(4th Gen) and iPadPro 11 inch. In all other iPad display correct. Tested in both Cocos2dx v3.17 & v4. Same problem. Here is my code: if (MyGameBridge::sharedGameBridge()->IsIpad()) { auto designSize = Size(1024, 768); auto resourceSize = Size(2048, 1536); director->setContentScaleFactor(resourceSize.height/designSize.height); searchPaths.push_back("Data/iPad"); ..

Read more

I’m developing a game in C++ on the cocos2dx game engine. I’ve mostly been testing it on the win32 platform but recently tried it out on android. When I did I found things were not running as expected. In case you’re wondering, I’m running the apk on Android Oreo (8.0.0) on a Samsung Galaxy S7. ..

Read more

I am a beginner with cocos2d-x and try to use it with Tiled to create maps. I created a TileMap, and here is my code, in LevelOne::init() in level_one.cpp : if (!CCLayer::init()) { return false; } _tileMap = new CCTMXTiledMap(); _tileMap->initWithTMXFile("levelone.tmx"); this->addChild(_tileMap); return true; The debugger allows me to see that the variable _tileMap contains ..

Read more

I’m trying to reproduce this turorial https://www.youtube.com/watch?v=-vb6QfatNQI&list=PLRtjMdoYXLf5H1O_AOZtc415UmSQCVs93&index=3&ab_channel=SonarSystems But my init function is never called, I checked with breakpoints. This is a part of my code on SplashScene.cpp : Scene* SplashScene::createScene() { auto scene = Scene::create(); auto layer = Scene::create(); scene->addChild(layer); return scene; } // on "init" you need to initialize your instance bool SplashScene::init() { ..

Read more