cocos2d-x

Tiled瓦片地图在真机运行时有缝隙的解决方法

我与影子孤独终老i 提交于 2019-12-01 05:53:34
最近遇到个问题,在用tilemap制作像素风地图后,xcode模拟器运行正常,打包真机运行发现部分地图出现瓦片间有缝隙的问题,如下图: 游戏引擎Cocos-2dx-Lua 3.10版本,地图用Tiled 0.10.2制作,试着在DesignResolutionSize下面下手,发现问题无法解决,后来查阅资料,发现在frameworks/cocos2d-x/cocos/base下,有一个名为ccConfig.h的文件,找到如下代码: /** @def CC_FIX_ARTIFACTS_BY_STRECHING_TEXE L * If enabled, the texture coordinates will be calculated by using this formula: * - texCoord.left = (rect.origin.x*2+1) / (texture.wide*2); * - texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2); * The same for bottom and top. * This formula prevents artifacts by using 99% of the texture. * The "correct" way to

Cocos2D泰然教程推荐学习步骤

我是研究僧i 提交于 2019-12-01 05:53:19
文章转自泰然教程:http://article.ityran.com/cocos2dstudy 这是一个学习Cocos2D的非常好的学习指引。保存下来。 Cocos2D泰然教程推荐学习步骤 cocos2d学习Iven推荐步骤 校对:子龙山人 一、首先,学习 《如何使用Cocos2D来制作一个简单的iphone游戏》 教程。 总结:对Cocos2D制作游戏有一个大概的了解和认识。 二、推荐在学习Ray(子龙山人&&泰然教程组翻译)的教程之前先看看《知易Cocos2D-iPhone 游戏开发教程》, > pdf+Demo工程打包下载地址: http://www.ityran.com/thread-525-1-1.html 总结:本教程对于基础知识参数清晰,涵盖了cocos2d的各个方面,可以从中学习cocos2d的结构,基本使用方法等。不论今后是使用cocos2d-iphone还是cocos2d-x,阅读本教程集都会有很大的帮助。 三、学习完《知易》以后,可以了解一下cocos2d的原理–OpenGL ES从零开始系列: > [转载]从零开始学习OpenGL ES之一 – 基本概念 [转载]从零开始学习OpenGL ES之二 – 简单绘图概述 [转载]从零开始学习OpenGL ES之三 – 透视 [转载]从零开始学习OpenGL ES之四 – 光效 [转载]从零开始学习OpenGL

cocos2d-x game crashes when entered background

[亡魂溺海] 提交于 2019-12-01 05:47:06
my cocos2d-x game crashes when entering background. here is some code from AppDelegate: // This function will be called when the app is inactive. When comes a phone call,it's be invoked too void AppDelegate::applicationDidEnterBackground() { CCDirector::sharedDirector()->pause(); CCUserDefault::sharedUserDefault()->flush(); CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); } // this function will be called when the app is active again void AppDelegate::applicationWillEnterForeground() { CCDirector::sharedDirector()->resume(); CocosDenshion::SimpleAudioEngine:

Cocos2d-x 3.0rc0 的Win32工程添加CocoStudio库

a 夏天 提交于 2019-12-01 05:40:44
在新建Cocos 3.0rc0的Win32的工程中添加CocoStudio的支持. 一 软件及其下载 1. Cocos2d-x 3.0rc http://cdn.cocos2d-x.org/cocos2d-x-3.0rc0.zip 2. CocoStudio 1.3 在CocoStudio 1.3中可以直接创建Cocos2d-x项目, 所以这次的安装包有3个. 仅含CocoStudio 1.3 http://126.am/YDrVk1 CocoStudio 1.3包含了Cocos2d-x 3.0rc0 http://126.am/lorYp2 CocoStudio 1.3 包含了Cocos2d-x 2.2.3 http://126.am/eGo4f4 3. Python 2.7.6 Cocos2d-x的脚本用到了Python, Win下没有自带Python, 大家还需要下载Python. Python的版本我这里推荐大家用最新的2.7.6. 因为Python的2.x和3.x不兼容, 所以一定 不能 用3.x的版本 大家可以根据自己的系统下载对应的版本. https://www.python.org/download/releases/2.7.6/ 4. Visual Studio 地球人都知道啦. 我今天演示采用的版本是Visual Studio 2013. VS2010,

mac下创建cocos2d-x 3.7项目

北城以北 提交于 2019-12-01 05:40:15
因为之前开发都是在window下进行开发,而且都是用quick进行开发,因此对c++以及在Mac下的开发还不是很了解,最近买了台Mac,想把这方面补给一下,做一下笔记。 首先先去cocos2d-x官网上下载cocos2d-x3.7,在打开终端,进入cocos2d-x3.7文件夹下的: cocos2d-x-3.7/tools/cocos2d-console/bin目录下,输入命令: ./cocos.py new HelloWorldDemo -p com.coco2dx.org -l cpp -d ~/Desktop .代表的是当前目录,~/代表的系统的根目录。 new 表示创建新项目,项目的名称为 HelloWorldDemo.-l 用来配置语言 cpp 表示使用 C++ 语言. -p 表示包的路径.因此上面的代码代表的意思就是创建一个项目名称为 HelloWorldDemo,开发语言是c++,包的路径为com.cocos2dx.org放置在桌面的程序。 需要注意一点:在我们使用上面的创建项目的代码的时候可能会遇到这个问题: -bash: ./cocos.py: Permission denied,这就代表你的权限还不够,因此我们应该先 使用chmod命令获得权限,输入chmod u+x ./cocos.py 回车,接着再使用cocos.py创建项目,则可以成功创建。 来源:

cocos2d-x js模版修改

為{幸葍}努か 提交于 2019-12-01 05:30:18
创建cocos2d-x项目,导入引擎模版,避免每次都拷贝引擎到项目中,修改路径: D:\commons\cocos2d-x\cocos2d-2.1rc0-x-2.1.3\template\msvc\CCAppWiz.win32\Scripts\1033下的js文件如下: // Additional Inlcude Directories // var strAddIncludeDir = '.;..\\Classes'; // strAddIncludeDir += ';$(SolutionDir)cocos2dx'; // strAddIncludeDir += ';$(SolutionDir)cocos2dx\\include'; // strAddIncludeDir += ';$(SolutionDir)cocos2dx\\kazmath\\include'; // strAddIncludeDir += ';$(SolutionDir)cocos2dx\\platform\\win32'; // strAddIncludeDir += ';$(SolutionDir)cocos2dx\\platform\\third_party\\win32'; // strAddIncludeDir += ';$(SolutionDir)cocos2dx\\platform\

cocos2d-x 3.0 final 环境搭起来,demo跑起来

末鹿安然 提交于 2019-12-01 02:05:49
Cocos2d-x相关 软件版本及下载 使用 cocos2dx3.0 的正式版: http://www.cocos2d-x.org/download 使用 apache-ant-1.9.3 : http://ant.apache.org/bindownload.cgi 使用 python2.7.6 : https://www.python.org/download/releases/2.7.6/ 使用 VS2013 ( 高于或者等于 VS2012 即可,需要支持 C++11) Android 的环境 JDK 使用 1.7.0 : http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 使用 ADT Bundle for Windows : http://developer.android.com/sdk/index.html The ADT Bundle includes everything you need to begin developing apps: Eclipse + ADT plugin Android SDK Tools Android Platform-tools The latest Android platform The latest

Convert Platform::String to std::string

自古美人都是妖i 提交于 2019-12-01 00:15:21
I am getting String^ which Contains some Indian language characters in a callback from C# Component in my C++ WinRT Component in a Cocos2dx game for Windows Phone 8 project. Whenever I convert it to std::string the Hindi and other characters turn in to garbage characters. I'm not able to find why this is happening. Here is a sample code and I have just defined Platform::String^ here but consider it's passed to C++ WinRT Component from C# Component String^ str = L"विकास, વિકાસ, ਵਿਕਾਸ, Vikas"; std::wstring wsstr(str->Data()); std::string res(wsstr.begin(), wsstr.end()); Peter Torr - MSFT Edit:

syncing multiple audio tracks on android

白昼怎懂夜的黑 提交于 2019-11-30 23:21:42
I'm trying to create a music based game (similar to "my singing monsters). the idea is that I have a scene where I can place and remove a few different characters from the scene, each character has a unique mp3 file for its singing. I'm building my game with cocos2dx though for sounds I'm using a custom engine which currently uses MediaPlayer API on android. In order to sync all the sounds together I just play them all when the scene is loaded and then just mute and unmute according to which character is on scene. the problem is that on older devices the sounds seems to be out of sync, I

Convert Platform::String to std::string

时间秒杀一切 提交于 2019-11-30 18:09:14
问题 I am getting String^ which Contains some Indian language characters in a callback from C# Component in my C++ WinRT Component in a Cocos2dx game for Windows Phone 8 project. Whenever I convert it to std::string the Hindi and other characters turn in to garbage characters. I'm not able to find why this is happening. Here is a sample code and I have just defined Platform::String^ here but consider it's passed to C++ WinRT Component from C# Component String^ str = L"विकास, વિકાસ, ਵਿਕਾਸ, Vikas";