cocos2d-x

Rounded Corners Rect in Cocos 2d-x with Bezier

时光怂恿深爱的人放手 提交于 2019-12-21 20:35:08
问题 Is it possible to draw a Rect with rounded corners using a DrawNode object? I think that something is possible using Bezier curves, but I have made some tries and I think I can't handle it. Looking at API I've found only these 2 functions: drawQuadBezier (const Vec2 &origin, const Vec2 &control, const Vec2 &destination, unsigned int segments, const Color4F &color) drawCubicBezier (const Vec2 &origin, const Vec2 &control1, const Vec2 &control2, const Vec2 &destination, unsigned int segments,

Camera frame yuv to rgb conversion using GL shader language

荒凉一梦 提交于 2019-12-21 06:08:08
问题 I am getting the camera frame from the android camera Preview Callback in Byte array and pass it to jni code. As we can't use byte in c++ so i am converting it to the integer array as follows: JNIEXPORT void JNICALL Java_com_omobio_armadillo_Armadillo_onAndroidCameraFrameNative( JNIEnv* env, jobject, jbyteArray data, jint dataLen, jint width, jint height, jint bitsPerComponent) { Armadillo *armadillo = Armadillo::singleton(); jbyte *jArr = env->GetByteArrayElements(data, NULL); int dataChar

multi resolution support for all android devices

走远了吗. 提交于 2019-12-21 05:18:07
问题 I am porting my cocos2d iPhone game to android using cocos2d-x. I am now facing a problem with screen resolution: I want to use one high resolution image in my game which should be supportable by all screens lower then a given resolution. I read this nice tutorial of multiple resolution on forum . It's really helpful, but I am not achieving my solution. There is explanation of scale-factor of resource of Design Resolution & Resource Resolution. But, in my case, it scales either height wise or

Can't link to cocos2dx using eclipse for android on OSX

…衆ロ難τιáo~ 提交于 2019-12-21 04:28:28
问题 I've never spent so much time on initial setup for a development environment before, this is getting kind of ridiculous. I'm trying to run the demo code that comes with cocos2dx. I'm using: the eclipse flavor that comes with the ADK. cocos2d-2.1beta3-x-2.1.0 ndk-r8c Ive tried building an app template using create-android-project.sh which I had the same problems with but for this question I'll reference the hello.cpp sample app. I run the build_native.sh script and then import it in eclipse.

Cocos2d-x: How to port a Cocos2d-x project developed with XCode to Android (via Eclipse)?

隐身守侯 提交于 2019-12-20 14:12:13
问题 I have developed a Cocos2d-X app with XCode which works perfectly when I launch it from XCode on an iOS device. Now, I want to port it to Android. What I understand is that I have to find a way to import my "XCode project" to Eclipse in order to be able to compile it and launch it on an Android device. I am currently trying to convert this project to an hybrid iOS/Android project following this tutorial: http://gameit.ro/2012/01/creating-an-iphone-and-android-cocos2d-x-hybrid-project-updated/

Cocos2d-x: How to port a Cocos2d-x project developed with XCode to Android (via Eclipse)?

ぐ巨炮叔叔 提交于 2019-12-20 14:11:27
问题 I have developed a Cocos2d-X app with XCode which works perfectly when I launch it from XCode on an iOS device. Now, I want to port it to Android. What I understand is that I have to find a way to import my "XCode project" to Eclipse in order to be able to compile it and launch it on an Android device. I am currently trying to convert this project to an hybrid iOS/Android project following this tutorial: http://gameit.ro/2012/01/creating-an-iphone-and-android-cocos2d-x-hybrid-project-updated/

Crash in Android Native while changing to new Activity

牧云@^-^@ 提交于 2019-12-20 05:23:43
问题 My application is unable to open OpenFeint dashboard methods. The implementation of the native c++ libraries uses cocos2d-x as a graphic library, but it has a handler and a wrapper to allow the use of OpenFeint functions. OpenFeint initialization and non-activity methods work correctly. When UI dashboard functions such as openLaderBoards or openAchievements are called either from a Jni call or in the Java onCreate initialization, the application crashes. EDIT: I have tested and it happens to

shows different price in “Confirm your in-app purchase” dialog ios

主宰稳场 提交于 2019-12-20 02:54:56
问题 Adding in-app purchase for a ios app. I could successfully purchase the product but "Confirm Your In-App Purchase" dialog always shows extra price compared to my formatted localised price. Example: A localised price for a product is 39.99 Euros, but when in the confirmation dialogue box, the price of the product is increased to 41.73 Euros. Thanks in advance for any solutions for this issue. 回答1: Actually it seems this is only happening in the sandbox. So the production is fine. I've tested

cocos 2dx单机斗地主源码分析

半城伤御伤魂 提交于 2019-12-20 01:32:03
1.玩家按下准备按钮 void SceneGame::menuReadyCallback(Ref* pSender) { faPai(); _menuReady->setVisible(false); } 2.faPai函数里先洗牌,然后调用callbackFaPai,callbackFaPai是一个递归链式调用函数,一次给每个成员发牌并且保留底牌,最后显示抢地主按钮 如果玩家抢到了地主,接着给他发底牌,并且设置他为地主,同时出牌按钮也会显示 void SceneGame::menuQiangCallback(Ref* pSender) { SimpleAudioEngine::getInstance()->playEffect("sound/Man/Order.ogg"); // 分发底牌 FaDiPai(_player1); // 切换菜单可见 _menuQiangDiZhu->setVisible(false); _menuChuPai->setVisible(true); } void SceneGame::callbackChuPai2(cocos2d::Node* node) void SceneGame::callbackChuPai3(cocos2d::Node* node) 以上分别是两个机器人的出牌算法,3号机器人出玩牌设置我的出牌按钮显示

How to save a variable to Android using Cocos2D-JS?

最后都变了- 提交于 2019-12-20 01:12:35
问题 I am trying to save a high score integer to the user's Android system, so that it can persist throughout all game-play experience. I have read that using Cocos2D-X one can use NSUserDefaults but this doesn't seem to be available in the Cocos2D-JS API at all. Anyone has any experience with this, is there any other efficient way how to tackle this issue? 回答1: When using Cocos2D-JS for compiling native apps, you can simply use localStorage just like if you were running your game in the browser