Questions tagged [cocos2d-android]

JAVA version for Android development. Cocos2D is an open source framework for building 2D games and graphical applications. Cocos2D-Android and Cocos2D-Android-1 are the two active projects.

Cocos2D for Android is a Java based open source framework for building 2D games and graphical applications. Cocos2D-Android and Cocos2D-Android-1 are the two active projects. The latter is a branch of the former and seems more active.

Both Cocos2D for Android engines are based on the API design of Cocos2D for iPhone, but they are not compatible with each other (Java vs Objective-C).

For more information on the other Cocos2D game engines, see the and tag descriptions.

It is recommended to use the following tags appropriately:

  • Use the tag on questions referring to the Objective-C based framework
  • Use the tag on questions referring to the C++ based cross-platform framework
  • Use the tag on questions referring to the JavaScript based framework
  • Use the tag on questions referring to the Java based frameworks
  • Use the tag on questions referring to the Python based framework
  • Don't use any of the above tags together in the same question, unless your question refers to more than one Cocos2D engine. For example, if you ask "How to port from Cocos2d-iPhone to Cocos2D-x?" you should include both and tags.
398 questions
5
votes
2 answers

Adding an Eclipse "Android Library" project and building via Maven

I am trying to include cocos2d into a preexisting app. I've done things the Eclipse way, such as setting "isLibrary" and adding the library project to the build path in Eclipse, and I have the following dependency in my app's pom.xml:
Bry M.
  • 135
  • 2
  • 13
5
votes
0 answers

Accessibility Warning by Google Play Pre-Launch report

I have developed an Android game using Cocos2d-X 3.16. The game is uploaded in open beta. Recently, I reviewed the pre-launch report on Google Play Console. The report was showing following warning for the game splash screen (created using sprite)…
Naresh
  • 433
  • 5
  • 14
5
votes
3 answers

Android Graphics Memory Limits

I am creating an android game using opengl and a cocos2d port (http://code.google.com/p/cocos2d-android-1). I am targeting a wide range of devices and want to ensure that it performs well. I only test on a nexus one and am hoping to get some input…
ghempton
  • 7,777
  • 7
  • 48
  • 53
5
votes
2 answers

Cocos2d-x error while compiling LOCAL_SRC_FILES points to a missing file (and folder) Windows

Good evening. I'm stuck trying to compile a HelloWorld using the cocos2d-x. I used the following commands: cocos compile -p android --android-studio cocos compile -p android --android-studio cocos compile -p android And I always had the same…
Lovera
  • 172
  • 2
  • 15
5
votes
1 answer

How to get sprites react to touches in cocos2d android?

i have 1 gun when tap on any point on the screen bullets fires out, but according to my requirement there are 3 guns(sprites) when touched on any of the sprites bullets must fire up, when googled i came to know that this can be done by using…
DD.
  • 973
  • 2
  • 10
  • 32
5
votes
1 answer

How to invoke a CCColorLayer Class's method from another class(it extends Activity) method, Android?

i need to invoke a method of class A (it extends CCColorLayer) from a method of class B (it extends activity). How is it possible? Tried creating object for Class A in class B. But its not the solution. Each time its creating different layer. please…
Arun Jose
  • 1,857
  • 1
  • 15
  • 24
5
votes
1 answer

DIfference between a scene and a layer in cocos2d

can anyone please make me clear about the difference between a Scene & a Layer in COCOS2D. I am bugged up with this.
user1337889
4
votes
2 answers

Surface view as a bitmap in android

I'm using cocos2d. Now I've added some images in the layer, and played around a bit. I'm trying to save the whole screen as image file. How can I do this?
Noman
  • 4,049
  • 10
  • 38
  • 59
4
votes
2 answers

[Cocos2d]How to Create bitmap from GlSurfaceView

How can I take screen shot of Glsurfaceview in Cocos2d. I tried with following code using GLsurfaceView GlsurfaceView glv=CCDirector.sharedDirector().getOpenGLView(); glv.setDrawingCacheEnabled(true); Bitmap…
Dev.Sinto
  • 6,802
  • 8
  • 36
  • 54
4
votes
1 answer

Cannot instantiate the type class name in cocos2d

I created new class and added scene in cocos2d-android but in main class getting this error in class name Cannot instantiate the type Trr where Trr is the name of the class. by googling i found the error was due to Trr was abstract class and…
DD.
  • 973
  • 2
  • 10
  • 32
4
votes
4 answers

Animating sprites in Cocos2d android

I want to animate a moving sprite in cocos2d using android, help please here is my code: public void setMoveAnimation(CCSprite target) { //CCSprite target = CCSprite.sprite("Target.png"); CCAnimation OpenAnim = CCAnimation.animation("",…
hanif s
  • 488
  • 1
  • 3
  • 19
4
votes
2 answers

Custom fonts in Cocos2d

Label font is not working, I have added fonts folder under asset folder. pop = CCLabel.makeLabel("Eggs left: ", "fonts/comic.ttf", 14);
Dhrupal
  • 1,863
  • 1
  • 23
  • 38
4
votes
3 answers

NoClassDefFoundError in Cocos2D sample

I am getting the same problem this question, but the solution didn't work for me. I've included my JAR in build path. What wrong am I doing? I am using the same example. Here's the crash log: 07-08 04:04:33.440: E/AndroidRuntime(751): FATAL…
0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184
4
votes
1 answer

Getting location of sprite within array cocos2d`

I need to be able to touch a specific moving sprite in my array and perform an action on it. However when I perform my MoveTo action, the sprite location doesn't update. Help! Array: int numbreds = 7; redBirds = [[CCArray alloc] initWithCapacity:…
4
votes
1 answer

CCGLSurfaceView Error

I'm developing some sample code. I had some problem using cocos2d. That is the CCGLSurfaceView problem. Firstly, I imported cocos2d.jar in my project with fps_images.png file. And i modify my project for using the cocos2d library. Here are the…
user1304842
  • 159
  • 3
  • 15
1
2
3
26 27