cocos2d-x

cocos2dx+box2d:Object stops abruptly, tied two ropes

筅森魡賤 提交于 2019-12-25 05:09:27
问题 cocos2dx+box2d: Hello. I actually have a problem. I did a bit of rope and she behaves normally. But if the object tie two ropes, it somehow as it stops abruptly. Can anyone understand why this is happening and can help? I recorded a video with two ropes, which shows that the object sharply ostanavliaetsya. And the video with one rope, where all is well: One rope:http://youtu.be/Yh4x8qrgmgo Two rope: http://youtu.be/iRPVPLrC9ZQ Because of what the object may stop so abruptly? Add Rope:

C++ Cannot get value of global variable in cocos2d-x

谁说胖子不能爱 提交于 2019-12-25 02:42:47
问题 I have a problem when working with CCArray in cocos2d-x. I declare CCArray *arrCs, on the top, in init() function I set value for arrCs, but after I get value from it in touch event, it has nothing. Please help me, thank all. In MainGame.cpp int radius= 32; float scaleImage= 0.5; int nItem= 60; float pMargin= 5; int limitTime= 70; float timeWaiting= 8; bool opTouch= true; int lastIndex= -1; Size visibleSize; CCArray *arrCs; bool MainGame::init(){ arrCs= CCArray::create(); int xx= pMargin+

setContentSize is not working in cocos2dx3.0

孤者浪人 提交于 2019-12-25 02:41:56
问题 setContentSize is not working i am new in cocos2dx and i want to add layer from another class to my main Splashscreen class but setContentSize use device width and height. i want to set layer size along with my sprite size. see my code Gadget.cpp #include "Gadget.h" #include "math.h" int nCount = 100; static CCPoint Circle [100]; // vertex array Gadget* Gadget::create(int type) { Gadget *pRet = new Gadget(); if (pRet && pRet->init(type)) { pRet->autorelease(); return pRet; } else { delete

Passing data with CCNotficationCenter

…衆ロ難τιáo~ 提交于 2019-12-25 02:39:21
问题 I am new to Cocos2d-X. CCNotificationCenter::sharedNotificationCenter()->addObserver( this, callfuncO_selector(test::printSomething), "hello", NULL); and the callback function is void PingoScreen::printSomething(CCObject *pObject) { CCString * myData = (CCString*)pObject; CCLog("The data posted is %s",myData); } Now i want to send a CCString parameter via notification so that CCNotificationCenter::sharedNotificationCenter()->postNotification("hello", ccs(notificationData)); How can i do this

Can't execute setup.py (Error 5 - Access Denied)

别等时光非礼了梦想. 提交于 2019-12-25 02:29:59
问题 I ran into a problem creating a new project in Cocos2d-x 3.1.1 (or 3.0 - it happens at both versions). When I'm running the build script in console (Windows 8 - console with admin privileges) an WindowsError pops up (check the image below). http://i.imgur.com/Ixg4jEE.png I can set up the COCOS_CONSOLE_ROOT manually, but it does not help with the Error 5 . I tried setting the 777 priviligies an all cocos2d-x folder and subfolders, but it does not help. Anybody had the same problem? Any

CCSequesnce in Cocos 2dx

╄→гoц情女王★ 提交于 2019-12-25 02:29:32
问题 Why Null is passed in CCSequence action? logo->runAction(CCSequence::create(CCDelayTime::create(1.4),CCEaseBounceOut::create(CCMoveTo::create(1.4, ccd(254,787))),CCRepeat::create(CCSequence::create(CCRotateTo::create(1.3, -3),CCRotateTo::create(1.3, 6),NULL), 100),NULL)); 回答1: Null is passed just to tell where the list ends. used to terminate the sequence. if you don't pass null at end of sequence your app may crash on device. 来源: https://stackoverflow.com/questions/24114080/ccsequesnce-in

Blending antialiased circles

丶灬走出姿态 提交于 2019-12-25 01:45:12
问题 I've implemented Xiaolin Wu algorithm to draw an antialiased circle. And it works. However, in my app, I can draw on the screen many circles and they don't have full opacity. So, I want to blend them. Before implementing antialiasing Xiaolin Wu algorithm my blending method worked. I use very simple blending: int blendColors(int a, int b, float t) { double s = sqrt((1 - t) * a * a + t * b * b); return s; } void setPixel(int index, int r, int g, int b, int a, unsigned char* data) { int oldR =

What is “Other Linker Flags” issue in Xcode build settings?

亡梦爱人 提交于 2019-12-24 23:10:53
问题 I have a cocos2d-x project that I'm working on, I added cocoapods to it and originally all that was in "Other linker flags" was $(_COCOS_LIB_IOS_BEGIN) AND $(_COCOS_LIB_IOS_END) everything works fine but then I added google-mobile-ads and amazon ads to my pod file and ran pod install and it said to add $(inherited) to my other linker flags target and I did but then I get this error, If I remove ($inherited) everything builds fine, if I keep ($inherited) and remove $(_COCOS_LIB_IOS_BEGIN) AND

why ApplyLinearImpulse is not same every time on same body with same values using box2d in cocos2d - x?

橙三吉。 提交于 2019-12-24 13:42:31
问题 I want to know the exact functioning of Impulse Function in box2d. right now i am trying to apply Impulse on same kind of bodies with same kind of value of force . For Ex. b2Vec2 force = b2Vec2(20,50); MyBody->ApplyLinearImpulse(force, MyBody->GetPosition(), true); on above example i am applying force with static values on my dynamic bodies , now every Mybody not behaving same kind of force. why is it so ?!! According to my understanding , it should behave same every time. or am i wrong ?!..

android Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9 in tid 27173

痴心易碎 提交于 2019-12-24 13:31:52
问题 I am new to cocos creator. I am working on a game and when i press home button and get back to app. then app is crashed. shows this error while debugging. android Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9 in tid 27173 (GLThread 1836) Already searched a lot. But i dont understand what to do. tried Fatal signal 11 (SIGSEGV), code 2, fault addr 0x74446000 in tid 13424 (GLThread 785) Fatal signal 11 (SIGSEGV), code 1, fault addr 0x48 in tid 21741 (RenderThread) in android in rear case in