cocos2d-x

Cocos2dx Android build error: “arm-linux-androideabi-g++: No such file or directory”

∥☆過路亽.° 提交于 2019-12-02 03:41:16
I downloaded the latest cocos2dx(3.10) and NDK(r11). I have the following error when I executed cocos compile -p android --android-studio . Error: ~/AndroidDev/android-ndk-r11/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++: No such file or directory Then I found in NDK Revision History here for r11 the following: Removed GCC 4.8. All targets now use GCC 4.9. Are there workarounds to switch cocos2dx settings to 4.9? In your NDK directory create RELEASE.txt file and enter the version, e.g. r11c (64-bit) I also had the same problem and I solved it by

Cocos2d-x入门之旅[4]场景

若如初见. 提交于 2019-12-02 03:02:58
我们之前讲了 场景图(Scene Graph) 的概念,继续之前你先要知道 场景图决定了场景内节点对象的渲染顺序 渲染时 z-order 值大的节点对象会后绘制, 值小的节点对象先绘制 HelloWorld 你还记得HelloWorld场景是如何启动的么?回看我们工程里的 AppDelegate.cpp ,滚到 applicationDidFinishLaunching() 的尾部: // create a scene. it's an autorelease object auto helloWorldscene = HelloWorld::createScene(); // run director->runWithScene(helloWorldscene); Ctrl+鼠标左键 点选 createScene() 查看定义,可以看到这个函数在HelloWorldScnen.h内声明,在HelloWorldScnen.cpp内定义 // HelloWorldScnen.h static cocos2d::Scene* createScene(); // HelloWorldScnen.cpp Scene* HelloWorld::createScene() { return HelloWorld::create(); } 我们可以通过该函数获取一个HelloWorld场景对象

Set NDK_MODULE_PATH for cocos2dx Android

泄露秘密 提交于 2019-12-02 01:13:57
I am very new to cocos2dx for android.Now i install cygwin and all enviroment variables . Now when i compile and bulid my project (sample project) it gives message and error that NDK_MODULE_PATH not found . Here is my LOGCAT: 14:26:15 **** Incremental Build of configuration Default for project HelloCpp **** bash C:/Workspace/HelloCpp/build_native.sh NDK_DEBUG=1 V=1 NDK_ROOT = C:\android-ndk-r9b COCOS2DX_ROOT = /cygdrive/c/Workspace/HelloCpp/../../../.. APP_ROOT = /cygdrive/c/Workspace/HelloCpp/.. APP_ANDROID_ROOT = /cygdrive/c/Workspace/HelloCpp Using prebuilt externals + 'C:\android-ndk-r9b

Serializing CDT Project settings has encountered a

五迷三道 提交于 2019-12-02 01:02:12
When I build my project I get this error. Serializing CDT Project settings has encountered a problem (Null Pointer Exception) I am using latest eclipse and trying to build cocos2d-x3.2 for Android. After spending a few hours trying to figure out the same error message this morning (along with a bunch of nondescript nullpointerexceptions from Eclipse) I compared the Eclipse project files with previous version and found that Eclipse had added an extra node to my .cproject file, making it three in total. I removed this one, which was the one added by Eclipse and also the last one in the file.

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

我的梦境 提交于 2019-12-01 23:56:43
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. Actually it seems this is only happening in the sandbox. So the production is fine. I've tested it on the NL and FR store. Another dev confirmed the same from the DE store. If you have access to the Apple

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

亡梦爱人 提交于 2019-12-01 20:04:30
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? When using Cocos2D-JS for compiling native apps, you can simply use localStorage just like if you were running your game in the browser :D For example: //Handle for quick access to Cocos2D's implementation of Local Storage: var ls = cc.sys

Cocos2d-x数据持久化-查询数据

蓝咒 提交于 2019-12-01 19:25:16
数据查询一般会带有查询条件,这可以使用SQL语句的where子句实现,但是在程序中需要动态绑定参数给where子句。查询数据的具体操作步骤如下所示。 (1) 使用sqlite3_open函数打开数据库。 (2) 使用sqlite3_prepare_v2函数预处理SQL语句。 (3) 使用sqlite3_bind_text函数绑定参数。 (4) 使用sqlite3_step函数执行SQL语句,遍历结果集。 (5) 使用sqlite3_column_text等函数提取字段数据。 (6) 使用sqlite3_finalize和sqlite3_close函数释放资源。 NoteDAO.cpp中的NoteDAO::findById是按照主键查询数据函数,相关代码如下: [html] view plain copy ValueMap NoteDAO::findById(string pDate) { //初始化数据库 initDB(); sqlite3* db = NULL ; ValueMap dict ; string path = dbDirectoryFile (); if (sqlite3_open(path.c_str(), &db) != SQLITE_OK) { ① sqlite3_close(db); CCASSERT(false, "DB open failure.");

Cocos2d-js: How to use a custom ttf font on android devices?

别来无恙 提交于 2019-12-01 18:47:33
问题 I use following code to display a custom ttf font: ml.score = cc.LabelTTF.create(ml.totalPoints.toString(), "fonts/American Typewriter.ttf", 60); ml.score.setPosition(ml.size.width/2,BS*0.6); ml.score.retain(); ml.score.setColor(cc.color(200,160,70)); ml.scoreBar.addChild(ml.score, 5); In Android the font is not displayed. In Chrome / Firefox browsers it is. I'm using cocos2d-js 30RC. Wat? 回答1: I made a mistake. The file name was wrong. It should be ml.score = cc.LabelTTF.create(ml

Cocos2d-x Lua中Sprite精灵类

家住魔仙堡 提交于 2019-12-01 17:59:01
精灵类是Sprite,它的类图如下图所示。 Sprite类图 Sprite类直接继承了Node类,具有Node基本特征。此外,我们还可以看到Sprite类的子类有:PhysicsSprite和Skin。PhysicsSprite是物理引擎精灵类,Skin是皮肤精灵类用于骨骼动画。 创建Sprite精灵对象 创建精灵对象有多种方式,其中常用的函数如下: cc.Sprite:create ()。创建一个精灵对象,纹理[ 纹理(texture),表示物体表面细节的一幅或几幅二维图形,也称纹理贴图,当把纹理按照特定的方式映射到物体表面上的时候能使精灵看上去更加真实。 ]等属性需要在创建后设置。 cc.Sprite:create (filename)。指定图片创建精灵。 cc.Sprite:create (filename, rect)。指定图片和裁剪的矩形区域来创建精灵。 cc.Sprite:createWithTexture (texture)。指定纹理创建精灵。 cc.Sprite:createWithTexture(texture, rect, rotated=false)。指定纹理和裁剪的矩形区域来创建精灵,第三个参数是否旋转纹理,默认不旋转。 cc.Sprite:createWithSpriteFrame(pSpriteFrame)。通过一个精灵帧对象创建另一个精灵对象。 cc

Cocos2d-x移植到WindowsPhone8移植问题-libNetwork库移植问题

南笙酒味 提交于 2019-12-01 17:58:45
Cocos2d-x提供了libNetwork库的源代码,而且还提供了libNetwork库的源代码Visual Studio 2012工程文件libNetwork.vcxproj,这样就更方便移植了。 提示 有的Cocos2d-x工程模板在解决方案中,已经有libNetwork库了,本节所介绍的过程就不需要了。 由于libNetwork库底层是依赖libcurl库,所以我们先要按照上一节介绍的步骤移植libcurl库,这个过程不在介绍。下面我们移植libNetwork库,具体步骤是:在解决方案中添加libNetwork库工程和添加libNetwork库引用。 1、在解决方案中添加libNetwork库工程 首先,打开解决方案,右键点击解决方案HelloCpp,在菜单中选择“添加”→“现有项目”,打开添加项目对话框,如下图所示,找到<游戏项目目录>\cocos2d\cocos\network\proj.wp8目录,选择libNetwork.vcxproj文件,选择好后点击打开按钮添加。然后我们就可以在解决方案管理器中看到刚刚添加libNetwork项目。 添加项目对话框 解决方案管理器 2、添加libNetwork库引用 然后,我们在解决方案中右键点击HelloCppComponent工程,在右键菜单中选择“属性”,弹出如下图所示工程属性对话框,在属性对话框中选择“通用属性”→