cocos2d-android

COCOS 2D screen shot is black in Android

对着背影说爱祢 提交于 2019-11-29 17:34:36
问题 I am using the following code. The image is saved but it is BLACK. Please see my code and tell me where I am doing wrong. I am using this code in the Menu. case R.id.id_menu_Save: Bitmap bmp = SavePixels(0, 0, 800, 400, CCDirector.sharedDirector().gl); File file = new File("/sdcard/test.jpg"); try { file.createNewFile(); FileOutputStream fos = new FileOutputStream(file); bmp.compress(CompressFormat.JPEG, 100, fos); Toast.makeText(getApplicationContext(), "Image Saved", 0).show(); Log.i("Menu

Cocos vs AndEngine for android [closed]

天涯浪子 提交于 2019-11-29 10:31:49
I want to make a game using Tiled Map Editor and I want to move the character around using a D-Pad for moving the character So I'm wondering which Engine would be better AndEngine or Cocos2d Keep in mind i'm a beginner at this so I'd like to stare at a lot of tutorials. :-D Thanks Both engines supprot loading TMX map quite easy and input from D-PAD. So if your requirements are only that, there is no big difference. Just use what you familiar with. vgonisanz Cocos2d-android don´t have support anymore. You must use cocos2d-x, cross-plataform, use JNI to use c++ code. More info HERE . Cocos2d-x

Cocos2D OR libgdx for Android Game Development [closed]

删除回忆录丶 提交于 2019-11-29 09:30:50
I just want to know, that in the long run, using which of these engines will be better. Although I feel that using Cocos2D will be a better option, as it can also be used for iphone development, there's just 1 tutorial http://dan.clarke.name/2011/04/how-to-make-a-simple-android-game-with-cocos2d/ which I've found so far. libgdx, on the other hand has a complete book. Jong Consider using AndEngine . From a short look at libgdx, they seem similiar (Although AndEngine is 2D only). However, AndEngine has everything you need for a 2D game. The only thing it lacks is documentation, but it is open

Admob No fill from ad server - failed to load ad: 3

风流意气都作罢 提交于 2019-11-29 09:04:41
My issue is that ads are not being displayed at all in my app, test mode or not. I am going to keep this question specific to test mode, and once I get that working I will worry about live ads. Development Information I am using Eclipse for development. I have setup ads using Google Play Services and Admob in my Android app, as described in the online documentation provided by Google. I have added my device ID using addTestDevice("xxxxxxxxxxxxxxxx"), and have checked the hashed device ID a number of times to be sure it is correct. The Issue (see below for log info) When I run the application

Why am I getting an InvocationTargetException? Android 2D game

﹥>﹥吖頭↗ 提交于 2019-11-28 11:56:18
I am making a 2D game in Android with Cocos2D, written in Java. Here is my code for the main stuff: public void gameLoop(float dt) { //Player Gravity if(canExecuteMovement(0, 6)) { guy.moveY(6); } //Player Movement if(direction == 1) { if(canExecuteMovement(-3, 0)) guy.moveX(-3); } else if(direction == 2) { if(canExecuteMovement(3, 0)) guy.moveX(3); } } private boolean canExecuteMovement(int xChange, int yChange) { int projectedX = guy.getBounds().left + xChange; int projectedY = guy.getBounds().top + yChange; Log.i("DD", "guy:" + guy.getBounds().toString()); Rect projectedBounds = new Rect

Admob No fill from ad server - failed to load ad: 3

╄→гoц情女王★ 提交于 2019-11-28 02:25:15
问题 My issue is that ads are not being displayed at all in my app, test mode or not. I am going to keep this question specific to test mode, and once I get that working I will worry about live ads. Development Information I am using Eclipse for development. I have setup ads using Google Play Services and Admob in my Android app, as described in the online documentation provided by Google. I have added my device ID using addTestDevice("xxxxxxxxxxxxxxxx"), and have checked the hashed device ID a

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

喜你入骨 提交于 2019-11-28 02:16:21
问题 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 . 回答1: as there is not layout xml file for cocos2d android you can add it progammatically. crate linear layout in onstart method itself. like this LinearLayout.LayoutParams adParams = new LinearLayout.LayoutParams( getWindowManager().getDefaultDisplay()

How to do page flip/turn/curl effect in android [duplicate]

こ雲淡風輕ζ 提交于 2019-11-27 00:42:35
Possible Duplicate: Implement page curl on android? How to do page flipping/turning or curl animation in android ? Is is possible with cocos2d. Please provide any links or example if you know. Artjom Zabelin You can use ViewFlipper to flip between views. http://developer.android.com/reference/android/widget/ViewFlipper.html Simple ViewAnimator that will animate between two or more views that have been added to it. Only one child is shown at a time. If requested, can automatically flip between each child at a regular interval. It is possible to assign different animations. See here for examples

How to do page flip/turn/curl effect in android [duplicate]

我的未来我决定 提交于 2019-11-26 08:09:34
问题 Possible Duplicate: Implement page curl on android? How to do page flipping/turning or curl animation in android ? Is is possible with cocos2d. Please provide any links or example if you know. 回答1: You can use ViewFlipper to flip between views. http://developer.android.com/reference/android/widget/ViewFlipper.html Simple ViewAnimator that will animate between two or more views that have been added to it. Only one child is shown at a time. If requested, can automatically flip between each