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
0
votes
2 answers

Android: display popup without a context

I have an Android game (built in cocos2dx) that was recently published and Google is notifying me of a startup crash with the following exception: java.lang.ExceptionInInitializerError at java.lang.Class.newInstanceImpl(Native Method) at…
joelpoloney
  • 419
  • 4
  • 13
0
votes
1 answer

Using particles in cocos2d android

I'm working on a game for android using Cocos2D-android and when I'm trying to use the CCQuadParticleSystem class, the CTOR just returns null. I spent hours searching for an example or a tutorial on this and all I found was other people asking about…
Amit Farkash
  • 329
  • 3
  • 16
0
votes
1 answer

how can we use the Animation and move on a sprite simultaneously in cocos2d-android?

Animation and move the sprite of one position to another position is done but simultaneously not working. Anyone have an idea, how can I resolve it ??
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
0
votes
1 answer

Put image on progressbar in android

I want to superimpose image of different color on my progress bar depending on the progress percentage. I putted the image on right position and set it invisible initially and setting it visible depending on condition. Problem is that image is not…
Ankit HTech
  • 1,863
  • 6
  • 31
  • 42
0
votes
4 answers

How to remove the sprite when I touch on it in cocos2d android?

I tried this for the solution .... public void update(float dt) { CGRect targetRect = CGRect.make(target.getPosition().x -(target.getContentSize().width),target.getPosition().y -…
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
0
votes
1 answer

How to use the CCTimer class in Cocos2d android?

I want to use CCTimer class for the Timer but I can't sort out. After I use to manually create a function for this but it seems not effective . protected GameLayer(ccColor4B color) { super(color); schedule(new UpdateCallback() { …
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
0
votes
1 answer

Click event of ccsprite in android

I am new in cocos2d. I am working on a game. And I want to do some logging on click event on spites of the layer. I do not know which method is called when we click on some sprite of the layer. I getting the control in the ccTouchesBegan(MotionEvent…
Ankit HTech
  • 1,863
  • 6
  • 31
  • 42
0
votes
1 answer

Setting up Cocos2D and JBox2D in Eclipse

I'm trying to make an Android app using Cocos2D-android and JBox2D. I found several tutorials and downloaded sample code and it works well and I can build on it, however nowhere can I find clear instructions for how to actually set up my own new…
Amit Farkash
  • 329
  • 3
  • 16
0
votes
1 answer

Cocos2D-x Android: speeding up cpp compile process?

I am relatively new to Cocos2d-x and I am trying to build a project targeting iOS & Android devices. Building the Cpp project with Xcode (for iOS) is pretty fast but for Android you have to first compile the whole project with NDK which always…
chrigu
  • 3
  • 5
0
votes
1 answer

How to display particle effect using plist in android cocos2d?

am doing one small game in android using cocos2d, I want to display a particle effect using plist files. I tried using the code below but I am getting a nullpointer exception. Without using a .png file, how can I display plist files?…
user1089640
  • 115
  • 1
  • 3
  • 14
0
votes
2 answers

Sprite without animation

I'm trying to add a SpriteSheet that is shown in the layer but not animated yet, I want to animate onClick. The problem is when adding the sprite to the layer, the sprite is not shown if its not animated on start. In Cocos2D-iphone I have not this…
Rotten
  • 742
  • 10
  • 24
0
votes
2 answers

Android setting background to fit screen size using cocos2d

I am using cocos2d to develop my android game.I am using following code to set background of screen. CGSize winSize = CCDirector.sharedDirector().displaySize(); CCSprite player = CCSprite.sprite("map_image.png"); …
Swapnil
  • 2,409
  • 4
  • 26
  • 48
0
votes
1 answer

How to add UISLIDER in Android cocos2d

Hi, I am doing one app here I am doing small game using cocos2d in Android. I need to display uislide but I don't know how to display. I tried but I don't have any idea and I am doing app below code like I taken surfaceview dynamically please any…
user1105975
  • 121
  • 2
  • 11
0
votes
1 answer

How to install cocos2dx on a mac?

I am following this tutorial to install cocos2d on a mac with eclipse. http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Installation_guide_of_Android_ndk_r4b_development_environment I get as far as installing the ndk and I get the following error…
DMC
  • 1,184
  • 5
  • 21
  • 50
0
votes
2 answers

Sprites won't move in cocos2d for android

I am having issues with cocos2d for Android. I have tried multiple methods but can't seem to get the sprite to move across the screen. Both pictures show up, but the computer sprite does not move. There are no errors that appear while running the…