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
1
vote
2 answers

cocos2d-android (github version) How do I keep a 'player' sprite centered on the screen while moving the background layer?

I am in the process of learning cocos2d-android. I have been following a tutorial that ported some of Ray Wenderlich's iOS tutorials to Android. I have the first tutorials finished and wanted to continue on by converting the next Ray Wenderlich…
MySkippy
  • 21
  • 5
1
vote
2 answers

Cocos2D - Large Image

Is it possible to use a large image in Cocos2D, and allow, via swiping or pinching, for the user to zoom in and out? I see from this post, that the max res for a Cocos2D image is 2048x2048. That is obviously larger than a device viewport, so I want…
Josh
  • 12,448
  • 10
  • 74
  • 118
1
vote
1 answer

CCTMXLayer not loading properly from CCTMXTiledMap in cocos2D project for android

I'm porting an iPhone project written with cocos2D to Android and have run into a problem setting up the CCTMXTiledMap. I've gotten the TMX file to load correctly: CCTMXTiledMap tileMapNode = CCTMXTiledMap.tiledMap("jungle.tmx"); and know that the…
mknutso2
  • 47
  • 8
1
vote
1 answer

cocos2d-android: how to play/pause a game state

I am new to cocos2d-android. I want to play or/and pause my game . How I fix it ? What would be the method? Thanks for any reply.
Zahidul
  • 389
  • 5
  • 15
1
vote
1 answer

does cocos2d-android-1 compatible with latest cocos2d-iphone?

I start porting my apps to android from ios. My apps were developed using cocos2d-iphone 1.0 version. I'd like to know cocos2d-x or cocos2d-andriod-1 compatible with cocos2d-iphone 1.0? Thanks
Emmy
  • 3,949
  • 5
  • 28
  • 30
1
vote
2 answers

cocos2d-android: how to display score

I added CCLabel in my update method to display my game score. It works well before score raise to 5000. After that logCat shows the messege: 02-08 11:47:37.476: E/dalvikvm-heap(4190): 1048576-byte external allocation too large for this…
Zahidul
  • 389
  • 5
  • 15
1
vote
1 answer

Learning to use Cocos2D for android after iOS development

I just got done creating a game for iOS using cocos2D and am now trying to learn android development and cocos2D using eclipse. I've imported the cocos2D .jar file into the android project, but this has no nice documentation like it does programming…
mknutso2
  • 47
  • 8
1
vote
1 answer

TouchesBegan always fire when using TouchesMoved

I am trying to make a jump a sprite using ccTouchesBegan and move using ccTouchesMoved . It jumps when I use Touchesbegan But when I try to move the sprite using TouchesMoved it moves but also jumps. How to fix the problem? plz help.
Zahidul
  • 389
  • 5
  • 15
1
vote
1 answer

How to implement the Sprite Animation by using Cocos2D in Android (JAVA VERSION)?

I know there is "the simple game sample of Android Cocos2D" and "how-to-animate-sprites-in-cocos2d". I use the "space shooter" Android source code as sample, create a simple card game. But there is the big problem that I don't know how to use…
Fenix Lam
  • 386
  • 6
  • 22
1
vote
4 answers

Cocos2d android Disable touch

i want to disable touch in Cocos2d screen. i want touch disable for 4-5 second.any one help me. thanks
Mitesh Jain
  • 673
  • 1
  • 7
  • 20
1
vote
2 answers

Cocos2d android Texture issue on Motorola xoom

I am developing a game in android with Cocos2d framework with latest build from github(Weikuan Zhou). In my game, I used lots of images(total images size is around 11MB). Problem: I am getting the black box instead of images when I play my game…
jaimin
  • 41
  • 9
1
vote
1 answer

Is there any Alternative of CCSpriteBatchNode in android cocos2d

Question is self explanatory, again I need an alternativs in cocos2d android to use CCSpriteBatchNode any help is appreciated .
A N M Bazlur Rahman
  • 2,280
  • 6
  • 38
  • 51
1
vote
1 answer

How to set a Background in COCOS2D android?

I want to set an image , download from a URL, to the COCOS2D android, as a background. My Class is CCGLSurfaceView. Here is my Code. how can i set Image to it from Internet as a background. package org.cocos2d.opengl; public class…
Noman
  • 4,049
  • 10
  • 38
  • 59
1
vote
1 answer

Android cocos2d how to take screenshot of CCscene?

I have a CCScene in one my CCLayer class, i need to take screen shot of it and save as Image file. Please help me to get it. View myView = findViewById(R.id.form); Bitmap bmp = Bitmap.createBitmap( myView.getMeasuredWidth() ,…
Neela
  • 1,328
  • 4
  • 23
  • 45
1
vote
2 answers

Rounded Image cutting form all side

I am creating a game in cocos2d-android. all the images i use in Sprite shows me proper output except rounded image. Rounded images are cut from all the side. i test same image in cocos2d-iPhone, which shows me perfect output. How to solve this…