cocos2d-x is a cross plaform port of cocos2d-iphone using C++. It supports iOS, Mac, Android, Samsung Bada, BlackBerry Tablet OS, Windows and Linux. It has built-in bindings for Lua and Javascript.

learn more… | top users | synonyms

0
votes
0answers
9 views

Cocos2dx - error while importing plugin with sdkbox

I'm trying to import plugins through sdkbox (v0.5.6.7) in my game using Cocos2dx (v3.7.1) but I always get this error: $> sdkbox import facebook _______ ______ _ _ ______ _____ _ _ ...
0
votes
0answers
19 views

Cross-platform game to be wrapped into a native iOS/Android app

I need to build an app like Lumosity (https://play.google.com/store/apps/details?id=com.lumoslabs.lumosity) that is native app and have some game screens. So the question is: Is there a way to build ...
0
votes
0answers
24 views

How to parse HTTP response (JSONdata) in cocos2d-x

I am making a HTTP request to a server and I am getting data from the database. Now I want to parse the JSON data and get the data into variables like this: std::vector<char> * buffer = ...
0
votes
0answers
17 views

camera or position issue when render sphere with cocos2d-x 3.7

See code below bool HelloWorld::init() { [....] auto size = Director::getInstance()->getWinSize(); // setup camera auto camera = Camera::createPerspective(30, ...
1
vote
0answers
6 views

cocos2d-x: Cache draw

I'm drawing a circle using DrawNode. Is there a way to cache that drawing into Sprite or put it to SpriteFrameCache for later use? Because drawing the circle again each time might slow the game down. ...
1
vote
0answers
36 views

Save game on Android keeps disappearing

my company has developed an Android game using Cocos2D-X. Game works quite well except that for some unknown reason, save games keep disappearing. Users report that they play the game for several ...
0
votes
0answers
19 views

Cocos2d-x 3.7 PhysicsBody velocity issue

i have a Sprite with physicsBody,and fixed velocity,the problem is the sprite is not renderd smoothly with the mouvement,it's look like zigzaging forward and backward with a tiny fixed offset,but keep ...
1
vote
0answers
26 views

How to add 3D Sprite on tmx file background using Cocos-2dx?

We have been working on sample game, wherein we want to show 3D sprite on .tmx file(background). But 3D sprite is never shown up, though we tried setting tileMap->setGlobalZOrder(-1). Following is ...
0
votes
0answers
17 views

Cannot include CCTableViewDataSource in Cocos2d-x

I found a tutorial in programering.com that show me how to create a scrolling list. But when i tried to follow this tutorial i realize that i have a problem with inheritance. I'm using Cocos2d-x ...
0
votes
0answers
33 views

ETC1 texture opacity

I'm using the cocos2d-x engine and want to support etc1 on android devices for my game. For ETC1 i'm using the mali compression tool, and GLSL. Everything is working, but I can't change the opacity ...
0
votes
0answers
53 views

Cocos framework gives large Android builds than cocos2d-x

This question is regarding Project Architecture and workflow. I have an installation of cocos2d-x and Cocos Studio with Cocos Framework ( version 3.6). I carried out different build tests with hello ...
1
vote
0answers
54 views

Handling animations in a Platformer

I'm developing a 2D platformer game using the Cocos2d-x Engine, i can load correctly the animations according in which action the player is(running, jumping, standing, etc). Now i'm trying to add the ...
0
votes
1answer
98 views

How to get `Label::createWithTTF` to support RTL languages such as arabic

Firstly, I'm using Cocos2d-x v3.6, Visual Studio 2013 uses(UTF-8 without signature option) and C++. When using Label::createWithTTF method to write Arabic text, It appear like the following. ...
1
vote
0answers
142 views

How to build a static version of cocos2d-x and link it to my project

Firstly, I'm using Cocos2d-x v3.6 for Win32 desktop + Visual studio 2013 and C++. When building Cocos2d-x, always it has been built as a dynamic version not a static version as I want. How to ...
0
votes
1answer
76 views

Cocos2d-x project every time must compile the project plus other libraries

I'm using cocos2d-x v3.6 for win32 desktop and Visual Studio 2013 with c++. When I change the code and then compile the project again, I must re-compile my project AND other libraries every time ...
1
vote
1answer
178 views

How to import Cocos2d-x in codeblocks ide?

Is it possible to import cocos2d-x in codeblocks just as in xcode ?? How can I do that ? I use ubuntu. It is not possible to use xcode in ubuntu. Cocos2dx is in c++. How can I use codeblocks for game ...
0
votes
0answers
35 views

cocos2d-x : set search path not working

im using cocos2d-x javascript and i tried to set search path or asset for multi resolution devices like so in main.js file if (cc.sys.isNative) { // if game is native assetsPath = ...
0
votes
1answer
77 views

wrongly scaled on cocos2dx 3.2 when render to multiple fbo (more > 1 deep)?

i have bug that only happen when retina flag disabled. i try draw multiple render texture to achive some multi post effect: so i have 3 render texture, fbo 1 for final pos effect fbo 2 for back ...
0
votes
0answers
25 views

Can't override velocity_func when compiling cocos2d-x JavaScript in IOS?

I am attempting to overwrite the Chipmunk's Body.prototype.velocity_func. It works perfectly when viewing my game via HTML5 Canvas, but when I compile my Xcode project, the velocity_func is never ...
0
votes
0answers
43 views

Can you create a PhysicsSprite in Cocos Studio?

I do not see the ability to enable Physics in any way in Cocos Studio, am I missing something or is this a current shortcoming of the application?
0
votes
0answers
77 views

Convert Cocos2d-x JS Sprite to PhysicsSprite?

I have a Cocos Studio project that has a node that contain multiple sprites. I am loading this node and iterating through the children (each are a cc.Sprite object); I'd like to convert each ...
0
votes
1answer
93 views

How to convert pixels to meters in Box2d with Cocos2d-x 3.5?

I am using Cocos2d-x 3.5. I created a simple game with edge bodies and one circular body to test box2d. Physics wasn't working well, so i thought i should convert pixels to meters and use that meters ...
0
votes
1answer
106 views

How to make TMXTiledMap responsive?

I've been struggling with Cocos2d-x (C++) and finally I got to the point I feel more or less comfortable with that. My game is a 2D car-based one, with a straight infinite map where I've finally been ...
2
votes
0answers
289 views

cocos2dx - Swipe and cut the sprite

I am trying to implement swipe and cut a sprite using cocos2dx and inbuilt chipmunk. For the solution I have done following things Enabled physics in the scene, so that the body falls on cut. ...
0
votes
0answers
112 views

Very slow motion smooth rendering - cocos2d-x

I have a a white circle that I move on a black background very slowly. When I look very carefully, I see that the while moving the edge of the circle is jittering. In my opinion it is because the next ...
0
votes
0answers
33 views

Setting Up the PTM_Ratio for Different Devices

I want to set the the physics for my Game and I have used Box2d for the Physics Simulation. And to do that I have set the PTM_Ratio to 32.0f.But When I run my Game on Different Android or iOS Devices ...
0
votes
0answers
34 views

cocos2dx - Bypass body contact

I am using cocos2dx and setup two Sprites with same Physics Body definitions see below PhysicsBody *physicsBody=PhysicsBody::createBox(size,PhysicsMaterial(1.0f,0.0,0.5f),Vec2(0, size.height*0.5)); ...
0
votes
0answers
58 views

Shader to mask image with polygon

I'm new to graphics programming and GLSL in particular. I'm working on a 2D game and the setup is as follows: There is an image on the screen (a sprite in the game engine [Cocos2d-x if it matters]) ...
0
votes
1answer
60 views

how to build release version mac cocos2dx?

do you know how to build mac build release version? in this case i use cocos2dx framework. in vs2013 we easyly choose the build version but in xcode i dont know. the indication release build is all ...
1
vote
0answers
192 views

Why current scene in cocos2dx has no children when accessed from outside scene class?

I want to access a sprite in a scene, but I cannot get the running scene from outside the scene class. The scene is created using: Scene* MyScene::createScene() { auto scene = Scene::create(); ...
0
votes
0answers
71 views

Cocos2dx How to show different parts of a scene in a split screen

I come from an SFML background and you could show different parts of a scene in split screens by manipulating sf::View. Is there any way to do it with Cocos2dx? I plan to make a split screen game but ...
1
vote
0answers
81 views

How can i get a value from object in tmx file in Cocos2d x 3.x?

I want to set my sprite in x coordinate based on an object in TMX map file, this is my code: tileMap = cocos2d::TMXTiledMap::create("ground.tmx"); ground = tileMap->layerNamed("ground"); ...
1
vote
0answers
89 views

How can i get object from TMXTiledMap and store it in Dictionary variable ?

I've been following a tutorial to make tiled map in cocos2d x 3.0 , but i couldnt complete the rest of the tutorial because its for coco2d x 2.0 version, How can i get a value of property that is ...
0
votes
1answer
80 views

Cocos2dx - Touch not recognized on Android

I'm having trouble with a touch listener not picking up touch events on android, but doing fine in windows (mouse input). I've got a Node listening for touches (not a Layer), but from what I've been ...
0
votes
1answer
163 views

Cocos2d - Physics bodies randomly loosing Velocity along an axis after impact

This just started occurring and seems to randomly happen during, and between, game sessions. A dynamic moving body collides with a static body and instead of bouncing off looses (almost completely) ...
0
votes
0answers
51 views

Mobile game: Optimization only working on some devices / Render big texture causes stuttering after level load

I'm currently optimizing the rendering of the background of my mobile game. The background consists basically of many colored dots. Since the background is static I'm able ro render the whole ...
1
vote
1answer
328 views

Cocos2dx+Chipmunk: Fully elastic collision between moving bodies

I'm using Cocos2dx and the built in Chipmunk physics engine, and currently I've got my PhysicsBodys' materials set up with: Density=0 Restitution=1 Friction=0 in order to get fully elastic ...
0
votes
1answer
54 views

How to serve user generated levels? [closed]

What is the easiest way to store online and serve user-generated levels? What client-server architecture should I use? Will I need backend code, or just a database? What database would be the easiest ...
1
vote
2answers
165 views

Right-To-Left Text Direction in Cocos2dx

I want to use Persian/Arabic text beside English in whether Label or ui::Text. Persian is a Right-to-Left and English is a Left-to-Right language and so I have problem to combine them in one string. ...
1
vote
0answers
552 views

How do I use CC_CALLBACK for external classes in Cocos2dx v3.2?

I've been having problems with using 'CC_CALLBACK_#' (i.e. CC_CALLBACK_0, CC_CALLBACK_1). It works alright if I am using it to call a function from the class (Using 'GameScene' class for this example) ...
0
votes
2answers
565 views

Counting multiple touches using Cocos2dx 3.2

I'm trying to count the number of active touches in screen in order to perform an an action in case that there are two touches: auto jumpListener = EventListenerTouchAllAtOnce::create(); ...
0
votes
0answers
213 views

Cocos2d pause game freezes the screen

I am trying to create pause screen for my game. The game is developed upon continuous scrolling background (top to bottom) with obstacles which are moving independently (left to right). Below is the ...
0
votes
2answers
499 views

Drawing a continuous line with onTouchMoved callback

i'm trying to draw a continues spline on every onTouchMoved call, the functionality is supposed to be similar to the line drawing used in the iOS game - flight control. i'm using it in the following ...
0
votes
0answers
150 views

Playing Multiple Sound effects isssue in cocos2d-x

Please help if someone faced this issue. I have a sound effect 3sec long which need to be played repeatedly for some time of 10 to 15 secs. Implemented like below: ...
1
vote
1answer
855 views

Need Help with Cocos2d Ver 3.3 AudioEngine

So I have 2 audio files that I want to play at different times: background.wav a sneeze.wav. I believe that I have to convert both wav files into mp3, caf and ogg files. Then I do this: static ...
3
votes
1answer
1k views

Cocos2d-x supporting multi-resolution using density independent pixels

Is there a way to use Density Independent pixels(dp) in cocos2d-x? I am developing an Android game using Cocos2d-x 3.0. The Android reference ...
0
votes
0answers
977 views

Implement Camera (former: CCCamera) v2 in cocos2d-x v3.3

we want to port camera code from cocos2d-x version 2 to version 3.3 with the goal to imitate the behaviour of a CCCamera in cocos2d-x version 2 exactly. You can assume that values for "eye" and "up" ...
2
votes
1answer
161 views

change animations when touch sprites [closed]

In the following function I want to change the animation when I touch on the button. But the game crash and exit. What's wrong with this code ? bool GameScene::onTouchBegan(cocos2d::Touch *touch ...
1
vote
1answer
121 views

How can I obtain information about the GPU in Cocos2d-x?

I'm trying to obtain information about the GPU that is running the game in order to use the correct texture compression for that GPU: std::string GPUInfo::getTC() { std::string TC; ...
1
vote
1answer
749 views

having problem with preloading plist file in Cocos2d-x

I am using Cocos2d-x engine with 3.2 version. In my splash screen i am prefeching plist by below line SpriteFrameCache::getInstance()->addSpriteFramesWithFile("ui.plist"); Now inside game when ...