Defold Protobuf
Defold NE for work with protobuf
Defold-Protobuf Native Extension for the Defold Game Engine
This extension allow you work with google protobuf protocol (files .proto), encode and decode them.
Short API:
local protoc = require("pb.protoc")
protoc:loadfile("/resources/test.proto")
local data = {
values = {
first = {
number = 1.5,
unumber = 20,
string = "hello"
}
}
-- some.Example - name of message from test.proto
local bytes = pb.encode("some.Example", data)
local unpackage = pb.decode("some.Example", bytes)
Examples you can find in GitHub repository
Notes
This is extension, what we use in Family Age
If you will use our extension and find some bugs or have some suggestions, you are welcome, tell about it!
NE wrapped by @vergil12345678