cocos2d

cocos2d android 配置

元气小坏坏 提交于 2019-12-05 00:15:56
1.Android 环境的搭建 (略) 2.下载NDK (略) 3.配置NDK的环境变量 变量名 NDK_ROOT cocos2d 中寻找用到这个. 变量名要不是 NDK_ROOT 会出现 第4步中的错误提示. .也可以手动配置去改NDK中的文件(这是另外的方法) 4.进入要调试的cocos2d 项目路径(例如:cocos2d 自带的例子 我的路径是cocos2d\samples\Cpp\SimpleGame\) 在Cygwin 中 cd 到 该路径的 proj.android 目录.执行 ./build_native.sh 上一部路径没调好 会提示 please defind NDK_ROOT. 然后执行 chmod -R 755 assets 命令 要不导入成功后出现failed add assets 的问题 5.下一步在android 导入项目. 这时可能会遇到Cocos2dxActivity 底下有波浪号.找不到lib下的类. 去cocos2dx\platform\android\java\src\org\cocos2dx 去把那个lib文件夹考到 项目src 文件夹下就可以了 6.若要自己创建 cocos 2d 项目. 在根目录下有create-android-project.bat 用记事本打开。修改里面的 set _CYGBIN=d:\Cygwin\bin

Cocos2d and UIScrollView

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am developing an IPhone cocos2d app with a scene like the the one depicted in the following image (I hope you can see that): On the right there is a vertically scrollable menu contained in a separated layer (menulayer) which is itself contained in the main scene's layer. On the left there is a back button contained in the main scene's layer. I am trying to exploit the UIScrollView as described in this link . However, despite I can see the UIScrollView working I am experimenting some problems: 1) while the menulayer actually scrolls it

Adding Cocos2D only to already existing project?

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I already have a project that is 90% done and I want to add Cocos2D ONLY to it. I do not need Box2D or Chipmunk. How would I do this? What files do I add? I really need this done, so in the end ill offer a bounty if needed. Thanks! 回答1: To start the easier way to add Cocos2d into your project is to follow these lines: Import the Cocos2d files into your project like the picture below: Then import the "FontLabel" folder which is located into the "external" folder (Into the Cocos2d library) like the previous step. After, you have to

“Semantic error: Redefinition of '__ccContentScaleFactor' with a different type” in Cocos2D v2

匿名 (未验证) 提交于 2019-12-03 01:13:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i have developed a new game and it is running perfectly fine on my real ios devices and even on simulators but when i decided to submit it to AppStore it is giving error on this line. extern CGFloat __ccContentScaleFactor; and error is cocos2d/Platforms/iOS/CCDirectorIOS.h:102:16: Redefinition of '__ccContentScaleFactor' with a different type: 'CGFloat' (aka 'double') vs 'float' can anyone please help me with this issue i just update xcode to 5.1. thanks 回答1: Important Update: Cocos2D v2.2 with 64-Bit fixes has been released. I strongly

How to light-up a sprite in cocos2d?

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I've already know how to dark-down a CCSprite object by: sprite.color = ccc3(x, x, x); // x is a value less then 255 (As far as i know, it should be a direct mapping of openGL functions, so its easy to achieve.) But when it comes to light-up, my current solution is adding another mask sprite (same shape but all in white), changing its blendFunc to { GL_SRC_ALPHA, GL_ONE } and overlaying it onto the target. Besides all the codes added, there should be a mask image for each need-to-light-up one. Is there a way to do light-up as

Unresolved inclusion: “cocos2d.h” - Cocos2dx

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: when I import the cocos2dx android project in my eclipse I get this warning on my header files Unresolved inclusion: "cocos2d.h" Why is this? Its actually bugging me. The project compiles and runs correctly but I want that to go away. Can someone tell me how to remove that warning and also I want the intellisense feature for my c++ projects in eclipse. I have that feature for my android stuff but not for c++. Please guide me. Thanks in advance :) 回答1: Add cocos2d-x resource to your Eclipse Right click your project and choose Properties Find

“Attempting to use the forward class 'Game' as superclass of 'MathGame'” in Cocos2d

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm making a Cocos2d game for iphone, and I have my main game mode, Game , which inherits from CCLayer . I'm trying to make another game mode, MathGame , which inherits from Game , but when I try to compile, I get this error in MathGame.h : Attempting to use the forward class 'Game' as superclass of 'MathGame' I get the error even if the implementation and interface of MathGame are empty. And it only happens if I try to include MathGame.h in another file. Here's the code for the Game class: // Game.h #import "cocos2d.h" #import <GameKit

【Cocos2d-x-基础概念】坐标系统

别来无恙 提交于 2019-12-02 21:58:50
#Cocos2d-x-基础概念-坐标系统 ##不同坐标系的介绍 ###笛卡尔坐标系 ###UI坐标系 在ios、安卓、wp一般的UI坐标布局中 原点是在左上角 x从左到右递增 y从顶到底递增 像这样 ###Direct3d DirectX中采取了笛卡尔左手坐标系 ###OpenGl和Cocos2d 采用了笛卡尔右手坐标系 在2d中,我们只是用2d的场景 如下: ###Parent和Childrens 每个继承自CCNode的子类都有一个anchorpoint的属性 当决定放置位置和旋转中心时,均是以anchorpoint作为参照的 ###getVisibleSie, getVisibleOrigin vs getWinSize 得到当前屏幕大小 ###如何转换坐标 ####convertToNodeSpace 用于将在屏幕上的绝对位置转换为一个node相对于另一个node的方法 CCPoint point = node1->convertToNodeSpace(node2->getPosition()); 这句代码中,node1相当于父节点,node2相当于子节点 node2的坐标根据node1相对改变 ####convertToWorldSpce 转换为世界坐标 ####convertToNodeSpaceAR ####convertToWorldSpaceAR

KBEngine 编译、运行、调试

北战南征 提交于 2019-12-02 06:15:54
官方推荐在 Windows 下编译运行,我也就不在 Linux 下折腾了。 服务器代码编译 在虚拟机里装了个 windows,再安装 VS 2013 。(2016.02.03,官方说支持 VS 2015,但我测试下来 VS 2015 会报 mysqlclient64.lib 无法连接,因为 mysqlclient64.lib 是 VS 2013 生成的 )。 按 官方的说明 ,代码 git clone 到本地之后,直接 Rebuild Solution 即可;build 成功会生成一批 exe 文件。 客户端 和 assets 文件 KBEngine 是通过资产文件在配置各个不同的项目,我这里用的是 kbengine_cocos2d_js_demo ,使用 js_demo 无需再另外安装一堆客户端程序,具体配置使用可以看官方的 demo 搭建文档 。 这里要注意的是,直接 git clone kbengine_cocos2d_js_demo 不能把代码一次性都捞下来,需要按说明,进入到下载下来的目录,再执行以下命令,才会把 kbengine_demos_assets 目录下载下来。因为这个目录是一个链接。 git submodule update --init --remote 安装 mysql KBEngine 需要使用 mysql 来进行持久化,这个按 说明 安装。 运行服务器

quick-cocos2d-x for mac开发环境安装配置

本小妞迷上赌 提交于 2019-11-30 00:28:04
我的开发环境 操作系统:mac Cocos2d-x:v3.2 Cocos2d-lua(quick-cocos2d-x):v3.2-RC1 Cocos Studio:v2.0.2 Cocos Code IDE :v1.0.1(64bit) ###安装步骤 安装Cocos2d-x 把下载好的cocos2d-x-3.2移动到工作目录 运行目录下的setup.py 更新环境变量source ~/.bash_profile 安装Cocos2d-lua 运行安装包quick-3.2rc1-mac.dmg 将安装好的quick-3.2rc1目录移动到工作目录下 运行目录下的setup_mac.sh 安装Cocos Studio 运行安装包CocosStudioForMac-v2.0.2.dmg完成安装 安装Cocos Code IDE 运行安装包cocos-code-ide-mac64-1.0.1.dmg完成安装 ###HELLO WORLD 新建测试工程 在quick-3.2rc1目录下,运行quick/player3,点击新建项目 选择存放路径,比如:~/cocosapp/ 设置包名,比如:com.quick.games.test1, 创建之后,点打开即可看到运行效果。 在IDE中查看、编辑代码 打开Cocos Code IDE,点击菜单“file=>import”,选择刚才创建的项目目录: