cocos2d-android


define NDK_ROOT in cocos2DX mutiplatform game environment

邮差的信 提交于 2020-01-17 07:52:11
问题 I have just started working with cocos2dx android and I am following wonderful tutorial of http://www.raywenderlich.com/33750/cocos2d-x-tutorial-for-ios-and-android-getting-started . Now, I have successfully run my first hello world demo project by following this link. I also set environment parameters: NDK_ROOT_LOCAL="/MY ANDROID NDK PATH/" ANDROID_SDK_ROOT_LOCAL="/MY ANDROID SDK PATH/" I followed tutorial perfectly as given in it, still I am facing problem while running my project second

Cocos2d for android supporting different resolutions

故事扮演 提交于 2019-12-31 16:51:48
问题 I am trying to build a game and was wondering how would one go about supporting different resolution and screen sizes. For position of sprite I've implemented a basic function which sets the position according to a certain ratio, which I get by getting the screen width and height from sharedDirector's winSize method. But this approach is not tested as I have yet to develop something to calculate the scaling factor for sprites depending upon the resolution of device. Can somebody advise me

Cocos2D OR libgdx for Android Game Development [closed]

允我心安 提交于 2019-12-29 07:28:28
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . 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

android Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9 in tid 27173

痴心易碎 提交于 2019-12-24 13:31:52
问题 I am new to cocos creator. I am working on a game and when i press home button and get back to app. then app is crashed. shows this error while debugging. android Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9 in tid 27173 (GLThread 1836) Already searched a lot. But i dont understand what to do. tried Fatal signal 11 (SIGSEGV), code 2, fault addr 0x74446000 in tid 13424 (GLThread 785) Fatal signal 11 (SIGSEGV), code 1, fault addr 0x48 in tid 21741 (RenderThread) in android in rear case in

Cocos2d android Texture issue on Motorola xoom

雨燕双飞 提交于 2019-12-24 12:24:55
问题 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 more than 3 times. What steps will reproduce the problem? 1. When I play my game more than 3 times via "Play Again" functionality of my game. What is the expected output? What do you see instead? - images should be displayed properly instead of "BLACK

How to Detect the CCSprite Touchevent getBoundingbox equals of CCTouches

孤街浪徒 提交于 2019-12-23 06:14:16
问题 I am new to COCOS2d. I am using ccsprite with animation as a button. Now i am struggle to detect the CCTouches and CCsprite getbounding box are equals for click event. 回答1: From this way you can achieve what you need and write this code in CCtouches___() : ArrayList<CCSprite> animation= new ArrayList<CCSprite>(); CGPoint location = CCDirector.sharedDirector().convertToGL(CGPoint.ccp(event.getX(), event.getY())); for (CCSprite target : animation){ if(CGRect.containsPoint((target.getBoundingBox

cocos2d-android: how to display score

谁说胖子不能爱 提交于 2019-12-23 01:43:51
问题 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 process. 02-08 11:47:37.476: E/dalvikvm(4190): Out of memory: Heap Size=14343KB, Allocated=13585KB, Bitmap Size=2078KB java.lang.reflect.InvocationTargetException...... caused by java.lang.OutOfMemoryError My code is: countScore++ ; Log.e("total Score:", "" +

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

与世无争的帅哥 提交于 2019-12-22 06:59:39
问题 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 answer Android NDK: ERROR:C:\Users\santi_000\Desktop\Android\cocos2d\HelloWorld\proj.android\../cocos2d/external/freetype2/prebuilt/android/Android.mk:cocos_freetype2_static: LOCAL_SRC_FILES points to the missing file Android NDK: Check que C:/Users/santi

Images handling in cocos2d android?

房东的猫 提交于 2019-12-22 00:35:51
问题 According to the different-2 screen resolution, can't use a single image for every device. So, how to manage this thing in Cocos2d-android ? or Using setScale() is ok with it. 回答1: You have to create a method that can get the appropriate image according to screen size. There are following steps that will help you to get image 1) Get the screen size and store that in a variable I have used as WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE); display = wm

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

我们两清 提交于 2019-12-21 21:08:04
问题 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 with the API level 18(4.3 version), Add into my project and there is no error in the import time and uses their classes but in the RunTimeError occurred like : 09-14 07:49:49.890: E/AndroidRuntime(1282): FATAL EXCEPTION: GLThread 102 09-14 07:49:49

工具导航Map