cocos2d-x

Program “python” is not found in PATH

丶灬走出姿态 提交于 2020-01-03 05:44:05
问题 I've been trying to open a Cocos 2d-x project in Eclipse. The project is a C++ project, and the builder is a python script. After opening it, I get an error "Program “python” is not found in PATH." I've done some searching, and everyone who has experienced this issue has said that adding python to the build environment solved the issue. I tried that, and it didn't work. (I also tried restarting eclipse after the change, still no effect) Most of the image below shows that I have python in my

Stroking not working on CCLabelTTF in cocos2d-x ios in c++

二次信任 提交于 2020-01-03 05:20:35
问题 I am tryng to make an outline of green color in my label but its not working.. my code is CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "HoboStd", 50); pLabel->setPosition(ccp(200,200)); pLabel->enableStroke(ccGREEN, 5.0,true); this->addChild(pLabel); Its not providing the outline around the label text Hello World.Any one here who can help me 回答1: I got the fix in ios7.0 on how to enable stroking on labels The normal stroking code of a label doesn’t work in IOS 7.0 but it works

Cocos2D-X - EXC_BAD_ACCESS (code=2, address=0x0) when initializing a CCTMXTiledMap

落爺英雄遲暮 提交于 2020-01-03 05:20:08
问题 I'm trying to create a game in Cocos2D-X with a tile map and I'm getting the below error: EXC_BAD_ACCESS (code=2, address=0x0) in the line setContentSize(CCSizeZero); of the method CCTMXTiledMap::initWithTMXFile(const char *tmxFile) I'm creating the tile map in this way: tileMap->initWithTMXFile("TileMap.tmx"); this->background = tileMap->layerNamed("Background"); Somebody knows what it's happening? Please, could you help me? 回答1: Ok, I've found the problem. Just a little of theory: EXC_BAD

Where should system initialization methods be placed in Cocos2d-x?

五迷三道 提交于 2020-01-03 03:24:06
问题 I've developed a number of applications using Cocos2d-x on the iOS platform. I have always placed the loading of resources, preloading of audio, and initialization of system components into the AppDelegate::applicationDidFinishLaunching() function, or had it call the initialization routine from there. This was because this is the place where the first main scene for the application is selected and loaded into the CCDirector. Recently, one of my tutorials was ported to Windows and it appears

glError 0x0501 when loading a large texture with OpenGL ES on the iPhone4

青春壹個敷衍的年華 提交于 2020-01-03 02:31:18
问题 I got this error when I try to load a PVR image on device. It works in iPhone 5s, 5, 4s and iPad well, but in 4 it doesn't work. My PVR image size is: width = 4096 and height = 2048 . Cocos2d: cocos2d: TexturePVR: Error uploading compressed texture level: 0 . glError: 0x0501 Cocos2d: cocos2d: Couldn't load PVR image /var/mobile/Applications/7CF6C347-8B63-4C1E-857A-41F48C8ACBEF/Race.app/Images/BackGround/bg1.pvr.ccz Cocos2d: cocos2d: Couldn't add PVRImage:Images/BackGround/bg1.pvr.ccz in

how to declare label in global class (helloworld.h) with cocos2d-x v3.2?

大城市里の小女人 提交于 2020-01-02 15:04:21
问题 I'm creating a 2d platform game with cocos2d-x v3.2 (c++) and i'm using label. cocos2d-x v3.0 (c++) declared like cocos2d::LabelTTF* currentScore; cocos2d-x v2.2.2 (c++) declared like cocos2d::CCLabelTTF* currentScore; cocos2d-x v3.2(c++) how to declare label in global class(helloworld.h) i have try like HelloWorld.h class HelloWorld : public cocos2d::LayerColor { public: virtual bool init(); cocos2d::LabelTTF* currentScore; //semantic issue(LabelTTF deprecared) }; #endif HelloWorld.cpp bool

how to declare label in global class (helloworld.h) with cocos2d-x v3.2?

北战南征 提交于 2020-01-02 15:03:19
问题 I'm creating a 2d platform game with cocos2d-x v3.2 (c++) and i'm using label. cocos2d-x v3.0 (c++) declared like cocos2d::LabelTTF* currentScore; cocos2d-x v2.2.2 (c++) declared like cocos2d::CCLabelTTF* currentScore; cocos2d-x v3.2(c++) how to declare label in global class(helloworld.h) i have try like HelloWorld.h class HelloWorld : public cocos2d::LayerColor { public: virtual bool init(); cocos2d::LabelTTF* currentScore; //semantic issue(LabelTTF deprecared) }; #endif HelloWorld.cpp bool

Creating InAppPurchase in Cocos2d-x [closed]

99封情书 提交于 2020-01-01 06:39:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am new to Cocos2d-x.I need to create InAppPurchase For Cocos2d-x iOS game (CPP).can anybody help me to create InAppPurchase.or any Tutorials Related to this. Thanks in Advance. 回答1: You can use obj.C version of inAp purchase in .cpp cocos2d-x project. All you need to do is just write bridge cpp class in .mm

COCOS2D-X: scale sprite

≡放荡痞女 提交于 2019-12-31 04:26:08
问题 I want to set scale for a sprite by height of original image. And then the width of that sprite will follow by original ratio of that image. How can i do that. Thank for all your help. 回答1: CCSprite has a member function virtual void setScale(float scale) Reference:setScale Just create a sprite, and call this function. CCSprite* bg = CCSprite::create("background.png"); this->addChild(bg,0); bg->setScale(2.0); bg sprite will be twice bigger than the origin one. 回答2: use setScale function of

Cocos2dx Android build error: “arm-linux-androideabi-g++: No such file or directory”

早过忘川 提交于 2019-12-31 04:09:09
问题 I downloaded the latest cocos2dx(3.10) and NDK(r11). I have the following error when I executed cocos compile -p android --android-studio . Error: ~/AndroidDev/android-ndk-r11/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory Then I found in NDK Revision History here for r11 the following: Removed GCC 4.8. All targets now use GCC 4.9. Are there workarounds to switch cocos2dx settings to 4.9? 回答1: In your NDK directory create