美文网首页cocos2d
cocos2dx-lua读取json文件

cocos2dx-lua读取json文件

作者: 亮亮同学 | 来源:发表于2018-11-02 11:32 被阅读1次

cocos2d-x技术群新群:117871561
c++技术交流群:593010226

    local str = cc.FileUtils:getInstance():getStringFromFile("xxxx.json")
    local ok, datatable = pcall(function()
                   return cjson.decode(str)
                end)
    if true == ok and type(datatable) == "table" then
        dump(datatable, "文字", 6)
        --todo
    else
        --todo
    end

相关文章

网友评论

    本文标题:cocos2dx-lua读取json文件

    本文链接:https://www.haomeiwen.com/subject/egbqxqtx.html