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

1
vote
1answer
353 views

New way of integrating Openfeint in Cocos2d-x 0.12.0

I am trying to implement OpenFeint for Android in my cocos2d-x project. My approach so far has been creating a button that calls a static java method in class Bridge using jnihelper functions ...
1
vote
0answers
47 views

Render isometric TMXTilemap with antialiasing method

I'm currently working on a cocos2d-x project that uses isometric tile maps.all the tiles are as small as 64*64 px.So I have to scale the map up a little bit.TMXTilemap is handy but its render method ...
1
vote
0answers
78 views

How to change texture from pvr.ccz in Cocos2d?

I'm using .pvr.ccz file that texturePacker application created for me , I created a Sprite that it's image choosed from this file(.pvr.ccz) like below: CCSprite *mySprite = ...
1
vote
0answers
88 views

Why AnchorPoint doesn't affect `CCLayer` Positioning?

I think there is a different between CCLayer and CCNode behavior when I change their AnchorPoint. I will describe what I mean and please somebody explain it ? Scenario: I start with CCNode CCNode ...
1
vote
1answer
133 views

Cocos2d/Cocos2d-x Attaching an arrow (sprite) to another body sprite (person)

I am trying to set up a simple bow and arrow game. When the arrow hits the enemy body, the arrow's body is deleted and the arrow sprite continues to update, keeping the position correct in relation to ...
1
vote
1answer
159 views

Box2d - Attaching a fired arrow to a moving enemy

I am firing an arrow from the player to moving enemies. When the arrow hits the enemy, I want it to attach exactly where it hit and cause the enemy (a square) to tumble to the ground. Excluding the ...
1
vote
1answer
253 views

Issue porting Cocos2d-x to Android

I've written a basic game using Cocos2D-x on XCode. It works fine on the iPhone. Now I'm trying to port it to Android. When I run the script ./build_native.sh inside the proj.android folder, it gives ...
1
vote
0answers
68 views

What's the equivalent of UIBezierPath in Cocos2d-x?

I'm beginner in Cocos2d-x , and i want to implement this tutorial with Cocos2d-x v.3 cpp, but the problem i dont know if there's UIBezierPath in cocos2d-x. Could you help me to draw the Bezier Arrow ...
1
vote
1answer
659 views

Create tile map in Cocos2D-X by not using TMX file

I used to make a tile base game in Windows with my own tile map file, but it is a static tile map. I use an 2D array to store of my tile map. Now I want to make game in smartphone by using Cocos2D-X, ...
1
vote
0answers
386 views

Cocos2d-x CCFollow Zooming issue

Hi I am currently building a cocos2d-x game which incorporates pinch zoom using CCLayerPanZoom class which can be found here The problem is basically when using CCFollow and zooming and out, it ...
1
vote
0answers
703 views

Parallax Scrolling Road-2D [duplicate]

I'm working on a racing game which will have a top view from the back camera. The image below displays a similar example. I am confused about how to achieve the movement of the road if parallax ...
1
vote
0answers
484 views

cocos2d-xna CCScale9Sprite usage

I'm trying to get a CCControlButton to render on my game. Using a basic CCScale9Sprite as the button's background works using the following: var myScale9Sprite = ...
1
vote
0answers
135 views

Masking a CCLayer

I have a CCLayer (itemLayer) that has a bunch of CCMenuItemImage (itemButton) objects in it placed vertically in a column. These itemButton objects go way past the bounds of the screen and the ...
1
vote
0answers
256 views

How do I use Objective-C libraries in Cocos2d-x?

We've created several libraries in Objective-C in the past, and now we're moving to the Cocos2d-x game engine. We can't figure out how to reference and use those libraries (we've also tried compiling ...
1
vote
0answers
244 views

Getting contour without the background [closed]

I have a texture and vertex which are needed to create a set of closed polygons. For this purpose I use these functions: Code for create texture: CCSprite* spr = ...
1
vote
1answer
311 views

Adjust sprite bounds of the visible part of texture

Is there any way to adjust the boundaries of the visible part of the sprite? To make it easier to understand: I have a texture, such as shown at figure 1. Then I break it into pieces and fill the ...
1
vote
0answers
3k views

Where can I find some Cocos2dx beginner tutorials? [closed]

I have tried to start programing with Cocos2dx but I have no idea where to start and the tutorials are no very not very helpful. What I am looking for is some tutorials/guides on how to begin using ...
1
vote
0answers
374 views

Adding Libxml2 to an Android project under Cocos2D-X

I am having problems porting Libxml2. I like it because it works under windows like a charm with <libxml/parser.h>. When I reference the libraries I just cannot find the right path to them, ...
0
votes
3answers
525 views

Changing the rendering resolution while maintaining the design layout

I would like to increase the FPS of my project. Currently I would like to try reducing the resolution at which the scenes are rendered. Let's say I never want to draw more than 1280*720. What ever ...
0
votes
1answer
172 views

Camera Calculation

For my game I don't able to decide what camera resolution I have to use ? Normally I use 1024x600 landscape resolution of camera for my game and create single graphics for my game. But I found that ...
0
votes
1answer
152 views

Determine speed of sprite

I'm trying to calculate the speed of my sprites in Cocos2d but I'm having some difficulties. I'm not sure which units of time/speed cocos2d uses. My background sprite moves 2 positions to left each ...
0
votes
2answers
837 views

What is the differencen between ccTouchesEnded and ccTouchEnded

I'm learning cocos2d-x. Following the tutorial I found that ccTouchesEnded works perfectly in linux (and windows) but when I replace by ccTouchEnded the event isn't detected anymore. What are ...
0
votes
1answer
1k views

How to set multiple animations in cocos2d-x

I'm currently starting with cocos2d-x to build games for blackberry/android/iOS. I have the png and plist for the animations of a character created with texturepacker. I load them with ...
0
votes
1answer
859 views

cocos2d-x - object creation and management in game design

How do others keep track of everything going on in their games? I am working on a new game and I am quickly realizing everything that I need to keep track of. Example: Maybe a layerManager that ...
0
votes
1answer
621 views

How do you create 2D skeletal animations without extra software? [closed]

I'm working on a Cocos2d-x game and I'm developing on Windows. What I want is to make some skeletal animations, without using a tool or extra software to do so?
0
votes
1answer
337 views

cocos2dx- set draw() method interval time

What is the default interval of draw method call in cocos2dx engine? Can we set it manually? I couldn't find much information about it online. After researching a bit I found that update() method ...
0
votes
2answers
244 views

Implementing `fling` logic without pan gesture recognizers

So I am trying to port over a simple game that I originally wrote to iphone into cocos2d-x. I've hit a minor bump however in implementing simple 'fling' logic I had in the iphone version that is ...
0
votes
1answer
296 views

How to get position of CCSprite added to CCParallaxNode?

I have a CCparallaxNodeExtras that scrolls infinite (following the space game tutorial). I added as a child a CCSprite made of other CCSprite, like this: _backgroundNode = ...
0
votes
1answer
243 views

How to Initilize CCPoint Array from String?

I've got string like this: {{0,168},{20,20}}, here indicates two points. I want to get them out to initialize my CCPoint. Do you guys know how to convert this?
0
votes
1answer
250 views

Cocos2d-x cross platform development

I want to make a game with my friends on iOs, Android, WP operating systems. We decided to use a cocos2d-x and develop the core of the game on C++. What will be the right way of developing so that we ...
0
votes
1answer
891 views

Can't Build Cocos2Dx emscripten project [closed]

I need to port a Cocos2D-x project to Web (JS+HTML5). I'm trying to compile cocos2D-x samples using the emscripten project for cocos2d-x, and I've followed this tutorial ...
0
votes
1answer
177 views

does cocos2d cache texture automatically

I know if we want the textures cached we can use the sharedtexture manager to cache them, but since this is on mobile platform , why don't cocos2d-x just do this for all texture loads ? when creating ...
0
votes
1answer
810 views

CCSequence with two CCAction

I have two CCActions : CCAction *a; CCAction *b; so how to use CCSequence with two CCActions Thanks
0
votes
1answer
491 views

Rotate Box Sprite With Circle Body

I want to rotate my rectangular sprite with circle body. The problem is the body doest not attached to the centre of the sprite. This was the default behaviour of the body and sprite. But I want that ...
0
votes
2answers
1k views

Integrating SQLite to Cocos2d-x at Xcode

I have downloaded SQLite C/C++ interface to work with Cocos2d-x. Created a database by Firefox SQLite plugin. Then tried the following code // sqlite implementation sqlite3 *db; ...
0
votes
0answers
5 views

Cocos2d-x 3.0 JS: Facebook Dialog: Internal Server Error 500

I am using the following function to Invoke Facebook sharing: facebookShare: function() { cc.log('share to facebook 0.1'); var self = this; var fb = plugin.FacebookAgent.getInstance(); ...
0
votes
1answer
32 views

using rperp or perp to find perpendicular of a vector

i have code local coordinate Vec2 velo = Vec2(100,0); Vec2 Heading = velo.getNormalized(); Vec2 side = Heading.perp(); Vec2 trans = Vec2(12,12); then i can generate toWorldCoordinate for trans ...
0
votes
0answers
29 views

Use other IDE then Eclipse on OSX for game dev with Cocos2dx for Android

I've started with cocos2dx 3 days ago and already having a massive pain in my "back" with this support of C++ that eclipse provide me. It support it a little bit more then notepad++, and after years ...
0
votes
0answers
19 views

Cocos2dx - Trail

I'd like to implement a trail (like the white circles in Angry Birds) that chase my Sprite. I already used CCMotionStreak, but the trail texture is "stretched" instead. Anyone has an idea how to make ...
0
votes
0answers
18 views

Cocos2d-x how to draw in specific free form area

Here https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.h and https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.cpp you can see how ...
0
votes
1answer
68 views

Playing a sprite sheet animation in Cocos2D-x

I'm trying to create an animation using a sprite sheet in Cocos2D-x. I'm doing the following. The game doesn't crash but the screen is still blank. bool HelloWorld::init() { ...
0
votes
0answers
14 views

How can I animate a sprite in cocos2d-x 2.2.1 c++? [duplicate]

Is there a way to do an animation without a .plist file? I'm having a hard time doing swap animation with sprites. For example, doing an animation while the user is not doing touches and the other ...
0
votes
1answer
144 views

post on Facebook from cocos2d-x on windows phone

Is it possible to share/post on Facebook from cocos2d-x on windows phone. Is there any example/tutorial available.
0
votes
0answers
41 views

Change of scene not working in Android

Hi i am trying to load a new scene in cocos2d-x-js version 3.0 and my code works fine in the windows simulator but on building to android it doesn't work. This is the code var scene = new ...
0
votes
1answer
137 views

How can i create a message box with callback on ok?

I need to create a message box with ok button and when user touch ok , it will have to execute a callback.I am new to this and couldn't find any articles in the doc.
0
votes
0answers
43 views

how can i remove CCSprite on click which are came from right to left direction…?

i am using cocos2dx 3.0(c++) and have many sprites generate from on sprite named "objDown". each generated sprite has a setTag() assign ...no w how can i remove this sprites on touch ....help will be ...
0
votes
3answers
86 views

Is this possible in cocos2dx 3.0?

I have a number of five images (sprite1.png, sprite2.png, sprite3.png, sprite4.png, sprite5.png), these all I want to add as a sprite... int rndSprtNum = (arc4random() % 5) + 1; for(int i = 0; i < ...
0
votes
0answers
331 views

CocoStudio + cocos2dx 3.2 correct way to import animation?

After many frustrating hours I came to the conclusion that there is no valid way to implement a cocostudio animation, as CCArmature is deprecated and didnt work for me anyway. CocoStudio.h and ...
0
votes
0answers
75 views

Is there any advantage in using sprite sheets in Cocos2d-X menus?

I am developing a game using Cocos2d-X 2.3 and Marmalade SDK 7.3.1 and I was wondering if there is difference between loading the icon images that will be used in my menu buttons from a sprite sheet ...
0
votes
0answers
23 views

Add spritenode to the side of other spritenode

i have create a spritenode space. i want to add one sprite node to the left and one sprite node to the right of the space node. space= Sprite::create("space.png"); ...