Questions tagged [cocos2d-x]

C++ cross-platform version of Cocos2D, an open-source mobile 2D game framework.

Cocos2d-x is a C++ open-source mobile 2D game framework, released under MIT License. Initially it evolved from cocos2d-iphone () but is now a largely independent framework.

On top of the framework provided by Cocos2d-X (), mobile games can be written in C++ or Lua, using a similar API to that of cocos2d-iphone. Cocos2d-x projects can be deployed to iOS (), Android (), Samsung Bada, BlackBerry Table OS and other devices. Editing and debugging can be done on a variety of desktop operating systems with popular IDEs like Xcode, Visual Studio and others.

The current version is v4.0

Resources:

Books:

3886 questions
1
vote
1 answer

cocos2d-x undunderstand the image /screen /proportion, relative size between the opengl windows simulator and real device

after long and many hours of development only on the windows opengl simulator using visual studio 2012 every thing looked like it should be i tested on 480/320 screen size CCSize screenSize = pEGLView->getFrameSize(); CCSize designSize =…
user63898
  • 29,839
  • 85
  • 272
  • 514
1
vote
0 answers

Cocos2d: Get data from file(sprites35.png) failed! when testing on device but working on the simulator

I tring to test my app in my iphone 5 device and im getting this error Note! this is working fine on the xcode and the iphone simulator: Cocos2d: cocos2d: CCSpriteFrameCache: Trying to use file sprites35.png as texture Cocos2d: Get data from…
user63898
  • 29,839
  • 85
  • 272
  • 514
1
vote
1 answer

Cocos HTML 5, Animating Sprite

I was wondering how I would move a sprite from the centre of the screen to being 10 pixels from the top edge of the screen. Thus making it look like its moving up. This is my code so far var LoginLayer = cc.Layer.extend({ init:function () { …
James Campbell
  • 3,511
  • 4
  • 33
  • 50
1
vote
5 answers

cocos2d-x: build_native.sh compile errors

I'm trying to build cocos2d-x hello world project using build_native.sh, it shows me some compile errors. it seems that NDK can't find cocos2d-x sources.first it says: NDK_ROOT = /cygdrive/c/Android-NDK-r4/android-ndk-r4-crystax COCOS2DX_ROOT =…
akrami
  • 309
  • 2
  • 13
1
vote
1 answer

PlayHaven SDK with cocos2D-x Wrapper

I am newbie for cocos2D-x and i am trying to integrate the playhaven sdk under it. I've googled much but unable to have the playhaven sdk for advertisements. I would need the wrapper class for the playhaven sdk Can you suggest me for that. Help me…
Marine
  • 1,097
  • 7
  • 19
1
vote
1 answer

COCOS2D-X cross-platform mistery for me

I am a C++ developer I am interested in Cocos2d-x framework. I know that you can write C++ code using the framework, compile it for different platforms and that's it, you have your 2D on Windows, Android, iOS. This is amazing but I don't understand…
Narek
  • 38,779
  • 79
  • 233
  • 389
1
vote
1 answer

How to Enable Box2D debugDraw in Lua?

I'm tring to open box2d debugDraw in Lua. As I know in Cpp, we need to override CCLayer:draw() function. But in Lua, I can't get the override work done. Did you guys have idea about it?
Alex1989
  • 21
  • 2
1
vote
1 answer

trying to create an android template for cocos2d-x but getting cygbin error

i have eclipse setup to run the android sdk just fine. i followed a few tutorials i changed NDK_ROOT_LOCAL="C:\eclipse\android-ndk-r9" ANDROID_SDK_ROOT_LOCAL="C:\eclipse\android-sdk-windows" in the create-android-project.sh then when i run the…
Barqster7764
  • 57
  • 1
  • 10
1
vote
1 answer

How to duplicate sprite of sprites in cocos2d-x 2.1.4

Well, my question is simple, I'm starting with cocos2d-x programming and I'm trying to make a tiled infinite background, lets say I have a png of an image I want to repeat infinitely as a background, What I did was that I created a Sprite as a…
nosmirck
  • 666
  • 9
  • 31
1
vote
6 answers

possible having different color string in one CCLabelTTF?

I can use CCLabelTTF like this, (cocos2d-x v2.1.4) CCLabelTTF* ableText = CCLabelTTF::create("hello red blue green", "Arial", 9); ableText->setPosition(ccp(100, 100)); ableText->setAnchorPoint(ccp(0.5, 0.5)); ableText->setColor(ccc3(100, 100,…
Jinbom Heo
  • 7,248
  • 14
  • 52
  • 59
1
vote
1 answer

How to copy instances of an extended CCSprite?

I'm planning to extend the CCSprite class in order to create a Block class, which are the basic building blocks of my game. There may be a number of "archblocks" - prototypes on which individual blocks are to be based. In particular, I want to…
conciliator
  • 6,078
  • 6
  • 41
  • 66
1
vote
1 answer

Detecting on which CCSprite has been clicked

My main screen is Main.ccbi, it contains 3 CCSprite. Now I want that when user clicks on a CCSprite I should know on which he has clicked? I want to calculate in CCMotionBegin method that on which CCSprite user has clicked.
Zubair
  • 304
  • 1
  • 5
  • 19
1
vote
1 answer

cocos2d-x android compile ERROR

I can run my code in vc2012. I need to compile my code to android so I use linux system to run ./build_native.sh . Then terminal turn out this StaticLibrary : libchipmunk.a Compile thumb : cpufeatures <= cpu-features.c StaticLibrary :…
3DKS
  • 109
  • 2
  • 9
1
vote
2 answers

onDetroy() is called after calling onPause()

I develop cocos2d-x android. My question is when user press power button, is called onDestroy() after calling onPause(). This is connencted with memory leak problem? Why onDestroy() is called at that time? when it returns to app on Resume mode, it…
Chenggong Jin
  • 531
  • 1
  • 4
  • 9
1
vote
1 answer

ERROR WHILE COMPILING WITH ANDROID NDK

I have this error, while compiling with android NDK, ERROR LOG error: no matching function for call to 'sort(std::vector::iterator, std::vector::iterator,…
1 2 3
99
100