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
12 views

cocos2d-x VS Corona SDK

I want to develop 2D games and I learned LUA because of corona. Now corona is free and easy to develop. I have developed few small games not take much time. Recently i come to know about cocos2d-x ...
1
vote
0answers
38 views

How to make expanding ring with constant thickness?

I need to generate this burst or (donut-shaped) pulse. I'm having a difficult time how to generate such shape. At first, I was thinking of scaling the image but that didnt work out because the line or ...
0
votes
1answer
16 views

cocos2d-x Label Load Image like Sticker-Smile..(by html or …)

hi and sorry for my english... i am using cocos2d-x (c++)... can i load sticker (smile) in my Label(a text mixed by image)? i know that we can load bitmap fonts by: Label::createWithBMFont also i ...
0
votes
0answers
8 views

cocos2d-x Label Set Custom Direction manually

sorry for my english... i am using cocos2d-x for developing an android -ios game... can i set custom right-to-left or left-to-right direction to my Label manually? i mean that i want to set it like ...
0
votes
1answer
42 views

How to connect to a socket.io server from a Cocos2d-x game?

The question can also be asked more specifically as; How do I connect to a socket.io server with C++ from a mobile game? I am aware of Boost (and Socket.io C++ client libraries using Boost) but ...
1
vote
0answers
34 views

Cocos2dx Windows Phone 8.1: Seperate Characters in RTL Label

I use below code to show a text : auto label = Label::createWithSystemFont("سلام و خداحافظ", "BTitrBold", 24); ( RTL text like Persian, Arabic and Hebrew) This code works fine in both **Android** ...
0
votes
0answers
16 views

Cocos2dx : Lua with C++: lua_pcall closing my app

I'll try to explain what is happening with my current project: I want to make some custom scripts myself without using the lua script engine from cocos2dx, so I linked lua51.lib on Linker->Input, and ...
0
votes
0answers
34 views

`setVelocity` allows body to pass through bodies

In my game, I'm using cocos2d-x and I wanted to have an object that changes direction immediately, so I used setVelocity() on the physics body to do that. However, when I do that it can run through ...
0
votes
0answers
21 views

In Cocos-2d-x, is there a way to get a shared OpenGL context for use with background loading

We are using parts of the Cocos-2D-X engine and we have a background loading thread which loads textures in the background. Is there a way to get a ShareGroup so we can safely bind an OpenGL context ...
0
votes
0answers
34 views

How to do serialization in Cocos2d-x?

I can’t find any examples on the web on how to do serialization in nodes. If there isn’t a mechanism already built-in in the engine for this, is there a common pattern used to implement it in ...
0
votes
1answer
135 views

How can I save and load an adventure game?

I'm using cocos2dx and sqlite to store datum. The table looks like this: x INT, y INT, className TEXT, properties TEXT. I use json to serialize terrains and sprites. But I don't know how to ...
1
vote
0answers
27 views

Can I use sdl_net2.0 with cocos2d-x? [closed]

Can I use sdl_net2.0 lib with cocos2d-x? And how it cconects to each other. Or analog lib to use?
0
votes
1answer
87 views

how to naturally rotate a ball according to its velocity on a surface, a wall

I develop a game on cocos2d-x cpp. There is a ball sprite in my game. I move the ball on a surface(wall) via touch events but it can't naturally rotate according to its velocity. if i use ...
0
votes
1answer
79 views

Cocos2d background sound not playing a second time C++

I'm using cocos2d-x on windows10 UWP project. I use the SimpleAudioEngine to load the music: CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic("level_music1.wav",true); On the ...
1
vote
1answer
122 views

What is CC_Time in cocos2dx?

I was following this tutorial to understand using custom shaders : http://www.cocos2d-x.org/wiki/User_Tutorial-Realistic_looking_animated_real-time_clouds I understand that CC_Time is Cocos2d-x ...
0
votes
1answer
67 views

Rotate sprite direction Cocos2d

I want that my sprite go always forward, and you can only control his direction moving right and left (on 360 degrees). I don't know why, but the movement it's senseless. The constants to move and ...
1
vote
1answer
204 views

Cocos2d Sprite 3D position

When I set a position3D for a Sprite in cocos2dx, it render two times the same sprite, i took a screenshot: I set the position3D because i want to use the Z position the give an effect of distance, ...
2
votes
2answers
78 views

How to handle sounds muting in settings?

I have a easy and specific question. Let's say that in my game I use singleton for playing/pausing/changing volume of specific sounds (SimpleAudioEngine in cocos2d-x). What is the best way to ...
1
vote
0answers
40 views

Black bar in beetween the image when Background move infinite

I'm trying to scroll my background forever and so I'm using the background image twice. When the first one goes off screen, it should relocate to the end of the second one. However, there seems to be ...
0
votes
1answer
1k views

How to set up Cocos2d-x for visual studio?

I want to make a cocos2d-x game. I read you can use any IDE, so I was planning to use Microsoft Visual Studio 2015, since I want to make my game primarily for Windows. I have been searching for ...
2
votes
1answer
441 views

Compile cocos2d-x Windows games without Visual Studio

I want to use cocos2d-x to make a Windows game. I used the cocos console: cocos compile -p WIN32 And apparently it needs Visual Studio. Is there an alternative to build the Windows game without ...
0
votes
0answers
131 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 _______ ______ _ _ ______ _____ _ _ ...
1
vote
0answers
39 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 ...
1
vote
0answers
227 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
193 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
19 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
92 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
121 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
104 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
31 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
49 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
1answer
119 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
1answer
79 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
422 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
598 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
507 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
625 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
83 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
152 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
36 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 ...
1
vote
0answers
110 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
158 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
165 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 ...
1
vote
1answer
159 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
469 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
186 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
1answer
138 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
1answer
460 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(); ...
1
vote
1answer
224 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
1answer
171 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 ...