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
2
votes
1 answer

Cocos2d UI does not show up in Samsung S4

I have an app with an UI based on cocos2d (https://code.google.com/p/cocos2d-android-1/) which works very well on some phones, but on others only black screen is shown with an ad on the bottom. When the black screen shows up, I am still able to use…
Kenneth Browning
  • 1,360
  • 1
  • 13
  • 22
2
votes
1 answer

How can I place admob in Cocos2d android?

I am new to Android game development. I am struggling to show Admob in my game. What am I doing wrong? LinearLayout.LayoutParams adParams = new LinearLayout.LayoutParams( getWindowManager().getDefaultDisplay().getWidth(), …
Bebin T.N
  • 2,539
  • 1
  • 24
  • 28
2
votes
2 answers

Has anyone run their game on Higher Resolution in Cocos2d-android?

CCScene doesn't show anything on higher resolution ? I am working on a project in which I'm using the cocos2d_android.jar and on the 4.3 version the screen goes blank and music/ccTouches/others things working fine. Even after I change the jar file…
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
2
votes
1 answer

How to set CustomFont for a CCLabel in COCOS2d-Android

I need to Create Custom Font for CCLabel in COCOS2d-Android. currentVideoLabel = CCLabel.makeLabel(VideosLabels[currentSelected], "Faraco_Hand.ttf", winSize.width/41); currentVideoLabel.setPosition(CGPoint.make(winSize.width/2, 20)); …
Bebin T.N
  • 2,539
  • 1
  • 24
  • 28
2
votes
2 answers

Can we use GoogleAds/AdMob/AdWhirl in cocos2d-android?

I want to add the Admob / AdWhirl into the GameLayer Scene. I search over everywhere but couldn't find the way to do this work. I don't want to switch the Library. So , what should i do? If someone have worked on it , give some way to do this .
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
2
votes
2 answers

How to do Android COCOS-2d Menuitem Animation?

Cocos2d-android - I have an animation which has 5 Frames. which will rolling in position. how to make the button rolling like a globe.
Bebin T.N
  • 2,539
  • 1
  • 24
  • 28
2
votes
1 answer

Intent is not working to get highscore

finally came to the end of cocos2d game developement, in order to get this, i'm sending totalScore to the next gameover.class activity to set as highscore if it is high and wanted to display score and playername. i have done this, but once the game…
2
votes
2 answers

How to use activity in cocos2d-android?

i'm currently working on cocos2d-android project where the interaction between the sprite is done using 'scenes' havent used xml files, so now to do some other tasks i'm using xml layout files on onTouch of a button. below is the code to replace…
DD.
  • 973
  • 2
  • 10
  • 32
2
votes
3 answers

How to remove sprite after the completion on Animation?

I am using the CCAnimation class for using animation with more than one CCSprite . What I want is : " Just Remove the sprite after the animation complete " If anybody work on this, Please Let me Know. What should I do for it.
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
2
votes
5 answers

Issue with switch case in android

In order increase the levels after 10 ProjectilesDestroyed, i have set switch case, where for the 1st level after 10 projectiles Destroyed 2nd level is displayed but from 2nd level its increased for every 2 projectilesDestroyed and also the levels…
samm
  • 482
  • 5
  • 14
2
votes
1 answer

How can I use CClistview in COCOS2d Android?

I am working on a cocos2d game. In this game, I have to display a score level-wise: ================================================== Level Score 1 500 2 600 3 900 I want to use the cclistview in…
ishu
  • 1,322
  • 1
  • 11
  • 15
2
votes
2 answers

sizeWithFont for Android

I am porting a cocos2d iOS game to cocos2d-x Android and the cocos2d game code has this method sizeWithFont, but I do not have this method to use in Android. So what method can I use to replace sizeWithFont when using Cocos2d-x for Android
Gibtang
  • 90
  • 1
  • 8
2
votes
1 answer

CCbezierTo not working in cocos2d ,android

I want my sprite to move from one point to another point in a curve path, so i am using Bezierto in my code, but it doesnt seems to work out as it shows an error on bezier keyword (The local variable bezier may not have been initialized). please…
Sandeep R
  • 2,284
  • 3
  • 25
  • 51
2
votes
1 answer

How to crop an image in Cocos2d

I am new to this Cocos2d. i am developing a Tetris type of game. I want to crop an image into small blocks. All i know about this thing is that in iPhone a method called CGImageCreateWithImageInRect is used. Is there any method of this kind is…
Rizwan
  • 1,461
  • 12
  • 26
2
votes
0 answers

Adding Camera Preview in CCGLSurfaceView (Android Cocos2d)

I want to have Camera Preview as background in CCLayer so how I can add camera preview in CCGLSurfaceView? I am able to add camera preview in FrameLayout which is part of main xml file but to work with cocos2d I have to set the ContentView as…