cocos2d-android

Exporting cocos2d Android application as aar and calling its Activity from another project

荒凉一梦 提交于 2020-07-10 10:25:18
问题 I had built a cocos2d Android project from cocos creator. (sample application) And I exported this android application as an android library (sample.aar) I created another Android application (MyDemo) and imported the android library (sample.aar) I am calling the AppActivity of (sample.aar) library from the MainActivity of (MyDemo) application on Button click aarButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(); intent

Where can I find a good tutorial to start programming using Cocos2D-x? [closed]

夙愿已清 提交于 2020-01-24 09:37:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have some problems to start programming using cocos2D on linux + android. I use the stable release 0.12.0 (2012-03-05) I compile create-linux-eclipse-project.sh correctly It create a TestCocos2D project on the same path I import the android project to Eclipse I run project and i get the hello world. But i don

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