
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 评论 -
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 评论 -
channel '537f2e7c com.xxxxx.xxxxx/com.xxxxx.xxxxx.AppActivity (server)' ~ Channel is unrecoverably b
cocos2d HttpClient ios没有问题,然而Android报错模拟器报错:channel '537f2e7c com.xxxxx.xxxxx/com.xxxxx.xxxxx.AppActivity (server)' ~ Channel is unrecoverably broken and will be disposed!应该是模拟器没法处理报错内容然后报错。原创 2016-08-20 13:44:15 · 21077 阅读 · 0 评论 -
疏忽导致易接SDK OpenGL error
犹豫把 SFLuaAdapter 初始化OnGLThread 在GL线程中回调写成 OnUiThread了。。导致了OpenGL error 以为是易接没有在GLThread中回调。然后自己实现了一遍同样的接口。后来越想越不对翻看易接文档多次才发现他有注册 GLThread 回调。主要是以前才开始接入什么都拷贝,然后自己修改init回调。然后没在意,强迫症犯了才修改。易接代码: SFLu原创 2016-09-14 10:00:35 · 1793 阅读 · 1 评论 -
error: 'function' in namespace 'std' does not name a template type
导入这个头文件error: 'function' in namespace 'std' does not name a template type#include原创 2017-01-06 03:23:26 · 11387 阅读 · 2 评论 -
被放弃的CocosStudio也支持命令发布资源
MacBook-Pro:~ apple$ /Applications/Cocos/Library/Cocos.Tool publish2017-05-24 21:00:06.959 Cocos.Tool[41524:1575455] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and原创 2017-05-24 21:10:18 · 1983 阅读 · 2 评论 -
cocos用RenderTexture截图白色
修改cc.RenderTexture:create(width * scaleSize, height * scaleSize);到cc.RenderTexture:create(width * scaleSize, height * scaleSize, cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888, gl.DEPTH24_STENCIL8_OES);原创 2017-05-06 15:12:40 · 1325 阅读 · 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 评论 -
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 评论 -
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.8.1 Mac模拟器打印行数太多显示不全
修改 ConsoleWindowController.m 定义的宏。#define SKIP_LINES_COUNT 3#define MAX_LINE_LEN 4096#define MAX_LINES_COUNT 200改成#define SKIP_LINES_COUNT 200#define MAX_LINE_LEN原创 2015-10-03 00:03:31 · 972 阅读 · 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 评论 -
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 评论 -
android 音乐播放bug
用这张图表达我今晚的心情。。。。。一万个草泥马在奔腾。。。。。原创 2016-02-19 22:37:04 · 839 阅读 · 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 评论 -
luajit ios arm64 编译bytecode
1.先做一个比对 lua luajit 32 64 bytecode 执行结果测试代码 AppEntry.lua print("Hello Lua Compile")Version.luaprint("luaversion", _VERSION)local jit = require("jit")print("jitversion", jit.version_num)l原创 2016-02-04 21:09:11 · 5960 阅读 · 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 评论 -
CCHTTPRequestAndroid() 与 curl处理方式不同的问题
查看代码发现Android与CURL处理方工不一样,android 通过200。如果不成功可以通过getErrorCode()来获得。由于大部分用的getResponseStatusCode获取并且curl处理上有出入。暂时考虑每一次请求都是成功的来处理这个问题。CCHTTPRequest m_errorCode = code; m_errorMessage = (cod原创 2016-04-09 11:16:56 · 1060 阅读 · 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 评论 -
cocos2d3.8升级后狂闪退
void cocos_android_app_init (JNIEnv* env,jobject thiz) 修改成void cocos_android_app_init (JNIEnv* env)怪自己升级的时候不小心,被坑死了原创 2015-09-02 03:33:37 · 913 阅读 · 0 评论