Questions tagged [cocos2d-x-3.x]

Cocos2d-x is an open source game engine under MIT license. It can be used to build games, apps and other cross platform GUI based interactive programs.

Cocos2d-x is an open source game engine under MIT license. It can be used to build games, apps and other cross platform GUI based interactive programs.

Cocos2d-x allows developers to exploit their existing C++, Lua and Javascript knowledge for cross-platform deployment into iOS, Android, Windows Phone, Mac OS X, Windows Desktop and Linux, saving time, effort and cost. Cocos2d-x is fast, easy to use and loaded with powerful features.

Source: http://www.cocos2d-x.org/wiki

56 questions
17
votes
2 answers

Why isn't an animation flipped horizontally when I call setFlipped(true)?

I have some sprites, where the player character is facing to the right. I can create an animation from those sprites just fine. The problem is, if I want the sprites to face to the left. I do the following: Sprite* p =…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
4
votes
1 answer

Radial gradient - procedural texture for cocos2d-x v3.15+

In cocos2d-x there is already a LayerRadialGradient. Works well, but I've other shaders running on the my game scene, so performance in a problem now. It's using a shader. I want to replace it with just a Sprite with generated radial gradient…
4
votes
2 answers

Cocos2dx build issue

I have latest version of Cocos2dx which is v3.12 and latest ndk r12b on Mac OSx El Captain. I tried countless times to build my project for the android platform and I'm keep on gettting a "realocation overflow in R_ARM_THM_CALL" error. And the…
Moshe Rabaev
  • 1,892
  • 16
  • 31
2
votes
1 answer

Cocos2d-x Buttons - MenuItemSprite Vs Button

Cocos2d-x Version 3.17 // Create Button : Type - 1 { Sprite *spr1 = Sprite::createWithSpriteFrameName(FRAME_MM_PLAY); Sprite *spr2 = Sprite::createWithSpriteFrameName(FRAME_MM_PLAY); spr2->setColor( Color3B(200, 200, 200) ); auto…
Guru
  • 21,652
  • 10
  • 63
  • 102
2
votes
1 answer

cocos 2dx version 3.15 --no-native argument not recognised

I am using cocos2dx version 3.15, python version is 2.7.12, java version is 1.8. The problem is when i try to create a web only project using cocos new projectName -l js --no-native command, it gives me this error: cocos new: error: unrecognized…
2
votes
3 answers

std::bind and CC_CALLBACK_(0~3)

#define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__) #define CC_CALLBACK_1(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, ##__VA_ARGS__) #define…
1
vote
0 answers

How to normalize accelerometer values as controller input when device in different positions?

The device accelerometer reports values for each axis in units of g-force. i.e. (x,y,z) triplets. Each value, is in the range -1.0f to 1.0f; I'm making a game with simple tilt controls, so that if you tilt left, the character goes left, and if you…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
1
vote
1 answer

How to fix 'CLIENT_RECONNECT_REQUIRED' issue when reporting achievement to google

When reporting achievements (achievement unlock/increment) I get error 'client reconnect required'. The achievement is unlocked when you check achievements popup but it resets when re-running the game. This only appears when apk is uploaded(signed…
1
vote
0 answers

Setting border to appear outside the polygon area cocos2d-x

I'm drawing different shapes with drawPolygon function. The following code snippet draws a hexagon as the picture shows (yes, it's partially transparent): std::vector polyCoords = { Vec2(75, 7), Vec2(25, 7), Vec2(0,…
Zoltán
  • 678
  • 4
  • 15
1
vote
1 answer

How to correctly create, initialize and access to a static member of a class?

I'm making a poker game and I have a class which contains a std::map to assign a value for every card on the poker deck referring to its name. I tried to put it as a component of another class as static member, since I have to assign a value every…
Ibrahim CS
  • 119
  • 2
  • 9
1
vote
1 answer

how to include Box2d in cocos2d-x project?

In cocos2d-x v3.13.1, if I wanted to use just Box2d (not the integrated chipmunk physics), all I had to do was: #include But after upgrading to v3.17, it doesn't work. Instead there is an error saying: Lexical or preprocessor…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
1
vote
1 answer

Integrate Mopub in cocos2d-x v.3.x

I am facing a problem integrating Mopub Banner & Intersitial inside an Android App. I tried to add it in multiple manners but no one is working. Someone has managed to integrate it? I manage to cache the ads, but when they get shown , nothing…
X.Otano
  • 2,079
  • 1
  • 22
  • 40
1
vote
0 answers

Alternative to Marmalade for Cocos2d-x v3.13.1?

I was using Marmalade to easily build my Cocos2d-x 2.x game onto multiple platforms. As Marmalade is no more, what can I use for the latest Cocos2d-x 3.x?
frankish
  • 6,738
  • 9
  • 49
  • 100
1
vote
1 answer

Why is the content

In AppDelegate.cpp , we have the following code in bool AppDelegate::applicationDidFinishLaunching(): glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::SHOW_ALL); auto frameSize =…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
1
vote
0 answers

How does one access the Spidermonkey VM from within C++ code in cocos2d-x v3?

Cocos2d-x v3 seems to have the Spidermonkey VM built in. In a Cocos2d-x c++ project, how does one access the VM, to evaluate javascript expressions in it ? I couldn't find any documentation about this - there is documentation about how to create…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
1
2 3 4