Cocos Protocol Buffer Memo

This is not a tutorial but a learning memo on using Protobuf v2.5.0 in Cocos2d-JS v3.10.

Main Content

Demo (cpp/java/python/js)

  • Create Instance
  • Serialize to String
  • Serialize to File
  • Parse from String
  • Parse from File
  • Dump GameInfo Instance
  • Relection Dump Message
  • Relection Generate Message
  • Load Proto
  • Encode / Decode / js
  • Excel .xls to ProtoBuf .bin / Python

Protobuf-2.5.0

Generated libs

CocosProtobuf

Using Protobuf with Cocos2d-JS in JSBinding
– Send Data from C++
– Receive Data from C++
– Send Data from javascript
– Receive Data from javascript

A complete project can be found here on GitHub.

Continue reading