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
0 answers

texture in b2PolygonShape

I am trying to add texture in polygon shape. I got struck with the below code. I am not getting the texture of entire shape. I need apply texture entire shapes repeatedly. i am also trying the "GL_REPEAT" in ccTexParams. but it is not supported in…
Vanarajan
  • 539
  • 1
  • 4
  • 19
1
vote
1 answer

How to detect mobile or tablet in Android NDK

I am developing a cocos2d-x application for Android devices. I would have two different screen configurations which are designed for mobile and tablet device formats. In the main.cpp I would like to add some logic which determines whether the device…
don
  • 1,497
  • 1
  • 13
  • 27
1
vote
1 answer

runAction not excuted when invoked from CCNode (not onEnter )

I have Class that is CCNode extended from one of its methods i want to excute actions but none of then are running : from this class : class GameController : public CCNode where i have also this: void GameController::onEnter() { …
user63898
  • 29,839
  • 85
  • 272
  • 514
1
vote
3 answers

How can i rotate body using forces?

I am a newcomer in game dev and i didn't have deal with box2d and cocos2d-x before. So I have some troubles. I have a plane in my game, so when user turns joystick in one of directions, plane should turn in this direction. How can i do it? I think…
Igor Sova
  • 23
  • 1
  • 5
1
vote
1 answer

Bounding Box Issues with Cocos2d-X

I am trying to get my bounding box to work properly, but keep failing when the Map gets scaled. I could really use some assistance here as this has been the bane of my existence. In a nutshell, I have 1 scene, 2 layers. One layer is a HUD and…
jhthorp
  • 151
  • 1
  • 2
  • 9
1
vote
1 answer

Android Cocos2d-x Marker Felt.ttf is not a valid font file

I've recently started learning cocos2d-x for android. When I was building a new project for android, the build stops because of error Unable to add 'D:\cocos2d-x-2.1.5\cocos2d-x-2.1.5\projects\Clicktchen\proj.android\assets\fonts\Marker Felt.ttf':…
Jason
  • 452
  • 2
  • 10
  • 27
1
vote
1 answer

Cocos2dx changing sprite size and texture uv without using plist file

I am currently using cocos2dx. My testing device is ipad2 i want my sprite size to be independent of texture size because i cant afford one to one mapping. here is the example suppose i have a texture whose dimensions are 1024,1024 i want to use…
1
vote
1 answer

Cocos2dx - how to update screen only when necessary

Cocos2dx updates screen in a loop no matter if there is something new to draw or not. Even if I have one sprite which is not animated, the opengl renderer is called and screen is repaited at 60 fps - so phone battery is discharged quite fast. Is it…
thearti
  • 371
  • 2
  • 6
1
vote
0 answers

Cocos2d-x Android app not responding until back button pressed

I have an Android app coded in Cocos2d-x. At launch, it often doesn't respond to any taps or presses until I press the back button. Sometimes on app relaunch, the screen remains blank. Any suggestions?
amit
  • 1,373
  • 2
  • 16
  • 29
1
vote
1 answer

cocos2dx - sub layer that covers its parent partially keep capturing all touches

In my cocos2dx game, I have a CCLayer that contains another CCLayer. The sublayer just cover part of the container layer. I 'think' I achieve this through: this->setContentSize( CCSizeMake( 100, 200 ) ); however, the sublayer always capture touches…
Zennichimaro
  • 5,236
  • 6
  • 54
  • 78
1
vote
1 answer

LevelHelper add Complex Object(Body, Sprite, Joint) single object

I am new to LevelHelper. I have created a Car+2 wheels using Wheel Joint(The same as the one in Wheel Joint of LevelHelper youtube tutorial). My question is how can I programmatically add multiple Car with all the wheel and physics??? Should I add…
1
vote
1 answer

Troubles when launching Hello World : unsatisfiedlinkerror with dalvik system?

I am trying my first hello world project, I am following ray wenderlich's tutorial, but I have got this error : java lang unsatisfiedlinkerror couldn't load game from loader dalvik.system... my error : Would you know how to solve this? Thanks
minhthuan
  • 201
  • 1
  • 4
  • 8
1
vote
1 answer

cc.Class.extend not respecting functions

When ever I run the code below in Cocos 2D HTML or with bindings it seems to not add any of my functions but will add my Variables. So: cc.Class.extend({ init: function(isDancing){ this.dancing = isDancing; }, age : 5, dance:…
James Campbell
  • 3,511
  • 4
  • 33
  • 50
1
vote
2 answers

cocos2d-x c++ string unicode convert

I request a web page using CCHttpRequest then when I print the received response with CCString I can see turkish characters without any problems but when I assign the received response using std::string and print in CCLog strange characters come up.…
onder
  • 795
  • 3
  • 14
  • 32
1
vote
0 answers

Best Way For Data-Driven non-bone Key Frame Animation?

I am making ios game using cocos2d-x (version on 2.1rc0-x-2.1.3), now stuck on Key Frame Animation problem: Here is my problem's detail: Currently We just need key frame animation in games(simple,no bones),but in cocos2d-x, the animation is a bit of…
Captain
  • 11
  • 3
1 2 3
99
100