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
70
votes
6 answers

The Completest Cocos2d-x Tutorial & Guide List

I'm developing a game using Cocos2d-x to Android and iPhone. At the beggining, I had a lot of problems to start using this library, so, in this question, I want to collect all basic, medium and expert tutorials because there are a lot of info…
vgonisanz
  • 11,831
  • 13
  • 78
  • 130
48
votes
1 answer

What does "[ this ]" mean in C++

When I was reading the Cocos2dx 3.0 API, I found something like this: auto listener = [this](Event* event){ auto keyboardEvent = static_cast(event); if (keyboardEvent->_isPressed) { if (onKeyPressed != nullptr) …
1hunch1kill
  • 522
  • 4
  • 12
42
votes
3 answers

Android NDK: WARNING: APP_PLATFORM android-9 is larger than android:minSdkVersion 8

I am getting the following warning when compiling my cocos2d-x project with cygwin. `/cygdrive/e/project/MyGame/proj.android ` /cygdrive/e/android-ndk-r8e/build/core/add-application.mk:128: Android NDK: WARNING:APP_PLATFORM android-9 is larger than…
glo
  • 1,408
  • 3
  • 25
  • 54
37
votes
3 answers

VS 2015 compiling cocos2d-x 3.3 error "fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration"

When I compile cocos2d-x (version 3.3) using visual studio 2015, an error occured, saying: fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (编译源文件 ..\base\s3tc.cpp) The source code is:…
Jared
  • 371
  • 1
  • 3
  • 4
36
votes
7 answers

Cocos2d for iPhone vs. Cocos2d-x

I have worked some with Cocos2d for iPhone and find it delightful. I am starting another project, and have stumbled across Cocos2d-x, a C++ port. I'm tempted by the notion of being able to (with consideration) build for multiple platforms at once.…
WiseOldDuck
  • 3,156
  • 2
  • 24
  • 27
34
votes
12 answers

Getting the dimensions of the soft keyboard

Is there a way to know the size of the keyboard that is shown in the screen? I am using Cocos2dx for programming, but I want to know the height of the keyboard shown in screen in the part of Android or the part of Cocos, it does not matter. I know…
Rudy_TM
  • 1,420
  • 4
  • 15
  • 27
32
votes
6 answers

Error "Cast from pointer to smaller type 'int' loses information" in EAGLView.mm when update Xcode to 5.1 (5B130a)

Yesterday, I updated Xcode to the newest version (5.1 (5B130a)) to compatible with iOS 7.1. Then I build my project, I get the error "Cast from pointer to smaller type 'int' loses information" in EAGLView.mm file (line 408) when 64-bit simulators…
nvg58
  • 891
  • 1
  • 8
  • 17
24
votes
4 answers

Run Callback On Main Thread

I have some code that interacts with the Android Facebook SDK, Asynchronously. Unfortunately this means when it returns it is in a background thread. Cocos-2dx prefers me to interact with it in the Main Thread, especially when doing things like…
James Campbell
  • 3,511
  • 4
  • 33
  • 50
21
votes
3 answers

difference between cocos2d-x vs cocos2d-js

I'm just moving towards mobile apps... A friend of mine told me to start with cocos2d, I'm good in javascript. while searching google for cocos2d, and within cocos2d-x.org I found cocos2d-x cocos2d-JSB cocos2d-html5 cocos2d-Javascript I know what…
MFarooqi
  • 1,004
  • 5
  • 12
  • 26
21
votes
7 answers

"cannot find module with tag 'CocosDenshion/android' in import path" error in cocos2dx app

I am trying to compile Android native application developed on cocos2d-x. When i Try to debug my application i get the following error. Android NDK: jni/Android.mk: Cannot find module with tag 'CocosDenshion/android' in import path Android NDK: Are…
glo
  • 1,408
  • 3
  • 25
  • 54
20
votes
4 answers

Cocos2d-x vs cocos2d-android for an Android game

After using 'cocos2d-iphone' in one of my projects, I am trying to decide which flavor of Cocos2d I should use for an Android game. My personal list of pros and cons: Cocos2d-x pros: it should be easier to bring the game to iOS later, potentially…
Jason Weiss
  • 203
  • 1
  • 2
  • 5
19
votes
1 answer

Permission Denied Opening ligEGL shader cache file

As I mention in the title, my app built successful but show a blank screen and quit after a few second when I run it on device (SS GLX Tab3 Intel). And the logcat showed error opening cache file…
Nikel Arteta
  • 548
  • 1
  • 6
  • 25
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
16
votes
0 answers

Requested but did not find extension point with identifier Xcode.DVTFoundation.DevicePlatformMapping

Getting this warning when simulating an iPhone 4 in OS X using the Cocos2d-x engine. It's being spit into the terminal and I have to perform a Control-C to take back the terminal. The entirety of the warning is this: ios-sim-xcode6[30350:2161521]…
aardvarkk
  • 14,955
  • 7
  • 67
  • 96
16
votes
2 answers

How to fix android manifest.xml naming conflict?

For some reason, even though my app name appeared correctly next to the app icon, when I looked for the app under settings->app, the name appeared to be "libcocos2dx" instead of the correct name. So I added the following line in my…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
1
2 3
99 100