lua使用probuf(cocos2dx)
2018-03-12 00:00
281 查看
ios先集成probuf环境网上有教程:http://blog.csdn.net/qq446569365/article/details/46981521
http://gad.qq.com/article/detail/19128
上面的教程的流程是:先加载probuf二进制文件,然后register文件buffer,就可以encode或者decode了如下代码所示:
local pbFilePath = cc.FileUtils:getInstance():fullPathForFilename("res/addressbook.pb")
local pb = require "protobuf"
local buffer = readProtobufFile(pbFilePath)
pb.register(buffer)
pb文件的生成方式为:
http://gad.qq.com/article/detail/19128
上面的教程的流程是:先加载probuf二进制文件,然后register文件buffer,就可以encode或者decode了如下代码所示:
local pbFilePath = cc.FileUtils:getInstance():fullPathForFilename("res/addressbook.pb")
local pb = require "protobuf"
local buffer = readProtobufFile(pbFilePath)
pb.register(buffer)
pb文件的生成方式为:
protoc -o addressbook.pb addressbook.proto
相关文章推荐
- cocos2dx中protobuf的lua使用
- cocos2dx使用lua和protobuf
- cocos2dx 使用lua自定义事件
- 【COCOS2DX-LUA 脚本开发之一】在Cocos2dX游戏中使用Lua脚本进行游戏开发(基础篇)并介绍脚本在游戏中详细用途!
- cocos2dx 2.x版本:简化提炼tolua++绑定自定义类到lua中使用
- 在Cocos2dX游戏中使用Lua脚本进行游戏开发(基础篇)
- 关于cocos2dx之lua使用TableView
- cocos2dx lua 使用cocostudio编辑的动画文件并监听帧事件
- cocos2dx-lua sqlite3使用
- cocos2dx中使用tolua++使lua调用c++函数
- 【COCOS2DX-LUA 脚本开发之五】Lua 使用OOP(面对对象思想编程),免Binding创建自定义lua类
- 项目后期Lua接入笔记05--网络协议protobuf在lua中的使用pbc
- 【COCOS2DX-LUA 脚本开发之四】使用tolua++编译pk创建自定义类 推荐
- 【COCOS2DX-LUA 脚本开发之五】Lua 使用OOP免Binding创建自定义lua类
- cocos2dx-lua中如何使用自定义类以及tolua++的使用
- cocos2dx LUA使用ClippingNode来制作新手引导
- 【COCOS2DX-LUA 脚本开发之五】Lua 使用OOP(面对对象思想编程),免Binding创建自定义lua类
- 【COCOS2DX-LUA 脚本开发之八】使用Lua实现Http交互
- 【COCOS2DX-LUA 脚本开发之一】LUA语言基础在Cocos2dX游戏中使用Lua脚本进行游戏开发(基础篇)并介绍脚本在游戏中详细用途
- CCProgressTimer 进度条动画在cocos2dx+lua中的使用