
Quick-cocos2d-x
lovehappy108
这个作者很懒,什么都没留下…
展开
-
修复Quick-Cocos2dx-Community-3.6 macOS 10.15 系统字体显示问题
#if 1 // fix macOS 10.15 system font 修复添加代码#else // 删除代码static bool _initWithString(const char * text, Device::TextAlign align, const char * fontName, int size, tImageInfo* info, const Color3B* strokeColor){ bool ret = false; CCASSERT(text.原创 2020-10-26 09:51:07 · 573 阅读 · 0 评论 -
setDefaultAlphaPixelFormat bug addSpriteFrames 异步加载资源
function display.addSpriteFrames(plistFilename, image, handler) local async = type(handler) == "function" local asyncHandler = nil if async then asyncHandler = function()原创 2016-04-29 15:42:02 · 3952 阅读 · 0 评论 -
RenderTexture 橡皮檫 电筒效果
1.准备资源背景图 background.jpg遮盖图 HelloWorld.png橡皮檫图片 test1.png 中间透明的图。 BlendFunc为 cc.blendFunc(GL_ZERO, GL_SRC_ALPHA)如果是实心外透明 BlendFunc为 cc.blendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA)原创 2016-04-29 20:15:35 · 1707 阅读 · 0 评论 -
cocos2dx 3.x getStringFromFile lua 读取二进制文件
问题所在:为什么要用getStringFromFile 获取的字符串,getDataFromFile没有导出给lua,quick以前的HelpFunc:getFileData在3.10上暂时用不了,所以修改这个来处理,getStringFromFile没有处理 \0 问题,所以在长度上有问题,用 getDataFromFile 然后 push给lua时加一个长度就行了修改文件: lua原创 2016-05-25 19:00:16 · 5519 阅读 · 1 评论 -
TexturePacker 关于unpack_plist.py 拆分offset bug
unpack_list.py cocos2d plist文件 offset bug原创 2016-01-26 21:58:18 · 2145 阅读 · 0 评论 -
cocos 一个描边shader
原地址:http://blog.youkuaiyun.com/u011281572/article/details/44999609对效率进行了优化 local glProgramState = node:getGLProgramState(); local texSize = node:getTexture():getContentSize(); if原创 2016-05-03 19:20:37 · 3870 阅读 · 0 评论 -
TexturePacker批处理python
TexturePacker版本 4.2.11.安装TexturePacker Command Line Tool1.1 Mac下安装 TexturePacker => Install Command Line Tool => Install1.2 win下安装 必须配置环境变量。2.TexturePacker命令说明(主要命令)2.1 --texture-forma原创 2016-05-20 18:31:18 · 13264 阅读 · 1 评论 -
XXXXXX Mac[14082:159927] NSConcreteAttributedString initWithString:: nil value
cocos2d Mac 模拟器打印报错 NSConcreteAttributedString initWithString:: nil value出现问题是在 SimulatorApp.mm 文件里- (void)handleNotification:(NSNotification *)note{// NSLog(@"Received notification: %@",原创 2016-09-10 14:20:07 · 4092 阅读 · 0 评论 -
疏忽导致易接SDK OpenGL error
犹豫把 SFLuaAdapter 初始化OnGLThread 在GL线程中回调写成 OnUiThread了。。导致了OpenGL error 以为是易接没有在GLThread中回调。然后自己实现了一遍同样的接口。后来越想越不对翻看易接文档多次才发现他有注册 GLThread 回调。主要是以前才开始接入什么都拷贝,然后自己修改init回调。然后没在意,强迫症犯了才修改。易接代码: SFLu原创 2016-09-14 10:00:35 · 1793 阅读 · 1 评论 -
CCHTTPRequestAndroid() 与 curl处理方式不同的问题
查看代码发现Android与CURL处理方工不一样,android 通过200。如果不成功可以通过getErrorCode()来获得。由于大部分用的getResponseStatusCode获取并且curl处理上有出入。暂时考虑每一次请求都是成功的来处理这个问题。CCHTTPRequest m_errorCode = code; m_errorMessage = (cod原创 2016-04-09 11:16:56 · 1060 阅读 · 0 评论 -
java.io.FileNotFoundException: http://www.xxxxx.net:8080/test/test/ 403错误
POST请求错误内容java.io.FileNotFoundException: http://www.xxxxx.net:8080/test/test/ at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:186) at org.cocos2dx.lib.QuickHTTPIn原创 2016-03-27 11:18:25 · 15706 阅读 · 0 评论 -
Cocos2dx-lua 播放音循环播放问题
测试代码 local count = 0; local audioHandle = audio.playSound("Test1.mp3", true) print("audioHandle = ", audioHandle) scheduler.scheduleGlobal(function() count = count + 1; print("count =原创 2016-02-22 17:15:21 · 2962 阅读 · 0 评论 -
quick 3.3 C++回调lua方法
以前在quick 2.x的时候直接用LUA_FUNCTION,然后弄一个.tolua文件直接生成,就可以传入lua fucntion保存,然后用c++调用。虽然3.3也可以使用这个方法,但是没有tolua文件的地方了,剩下的是各种.ini和genbindings.py来生成tolua cpp文件。一个简单的例子cpp文件void MyClass::foo(std::func原创 2015-04-15 18:27:53 · 702 阅读 · 0 评论 -
Cocos2d-x Tutorial 之 如何绑定 C++ 类到 Lua
转载地址:http://geekgaoyang.herokuapp.com/blog/2015/02/11/cocos2d-x-tutorial-of-binding-c-plus-plus-class-to-lua-usage/本篇博文主要记录一下 C++ 如何绑定一个类到 Lua一、先决条件1、Python 使用brew包管理器安装 Python转载 2015-04-15 18:35:22 · 872 阅读 · 0 评论 -
iap内购 无法连接到 iTunes Store (拿坑砸自己)
昨天朋友遇到iap沙盒测试, 购买商品一直不显示用沙盒账号登录窗口,一直显示 无法连接itunes,先前已经测试通过了,但是一直这样。搞了1天多。原因:他用以前测试过的沙盒账号购买过物品没有finishTransaction掉,我猜测是苹果把测试账号和 app ID 绑定在一起的,下次登录应用还会发过来,并且叫会弹出登录提示框,但是一直不弹出来。我就猜测是不是:原创 2015-04-15 18:11:31 · 12468 阅读 · 0 评论 -
QuickCocos2d - math.newrandomseed()
由于要支持ios64位,不得不把quickcocos2d 2.2.5 版本升级到2.2.6,而升级把luajit 改成了 lua, luajit 现不支持64位,但math.random()随机出来的数字没有任何改变。 查看代码后,发现每次随机都调用了math.newrandomseed()方法,于是做个了测试for i=1,10 do math.newrandomseed原创 2015-01-15 12:58:23 · 2101 阅读 · 0 评论 -
cocos2dx-3.8 xcode7编译64位报错
ld: in /Users/apple/Library/Developer/Xcode/DerivedData/GameCity-cthafamtdulbnvhbxrosfnfjdwal/Build/Products/Debug-iphonesimulator/libcocos2d iOS.a(ftbase.ios8_x86_64.o), building for iOS simulator, b原创 2015-10-03 13:40:16 · 2781 阅读 · 0 评论 -
CCLabelTTF 显示不全
cocos2d版本:quick 2.2.6测试字符串:abcd\n\n\nefg\n\n\nhijk结果:如图hijk几个字母没有显示出来。原因:是因为cocos2d计算文字高度的时候把文字以\n分割开来,然后计算每段文字在高度,如果\n\n连接起就行形成一个空字符,导致计算高度变小,所以在显示文字的时候hijk没有显示出来。解决方法:修改这个方法计算文字高度,红色的是原创 2015-05-08 01:34:13 · 1221 阅读 · 0 评论 -
TextAtlas设置Gray
ccui.TextAtlas:create("100", "num.png", 20, 30, '0') :getVirtualRenderer() :setGLProgramState(cc.GLProgramState:getOrCreateWithGLProgramName("ShaderUIGrayScale")) cc.Sprite:create("title.p原创 2015-10-04 21:21:58 · 1142 阅读 · 0 评论 -
cocos2dx-3.0 中的关于物理引擎Box2D与chipmunk
上面这个链接是官方的,我随便翻译了一下,其实大意就是:cocos2dx 3.0(只能确定3.0,不知道后面版本有没有添加)中有两种物理引擎Box2D与chipmunk,但是官方只封装了chipmunk,并没有封装Box2D,也就是说如果使用Box2D的话,需要直接操作Box2D的API,有好有坏!简单的看看下面的新特性:(1) 物理世界被融入到Scene中,即当创建一个场景转载 2016-02-16 11:04:54 · 854 阅读 · 0 评论 -
纯lua实现 utf-16le 和 utf-8互转
原帖地址:http://www.cocoachina.com/bbs/read.php?tid-312194.html做了一些小小的修改:do local bit = require("bit") local resultStr={} local function utf16le_to_utf8(convertStr) if type(convert转载 2016-03-16 16:08:26 · 5003 阅读 · 2 评论 -
谈谈我喜欢的编码方式(lua代码)
以前喜欢这样用: --上栏 local topBar = UIImageBox.new("speed_shanglan"); topBar:align(display.LEFT_TOP, 0, display.height); self:addChild(topBar); --下栏 local bottomBar = UIImageBox.new("speed_xialan")原创 2015-03-31 23:22:17 · 1218 阅读 · 0 评论