SpriteFrameCache.cpp 中的注释有说明 lua 侧的 api 是 addSpriteFrames
:
/** Adds multiple Sprite Frames from a plist file.
* A texture will be loaded automatically. The texture name will composed by replacing the .plist suffix with .png.
* If you want to use another texture, you should use the addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName) method.
* @js addSpriteFrames
* @lua addSpriteFrames
*
* @param plist Plist file name.
*/
void addSpriteFramesWithFile(const std::string& plist);
这个映射是在 tolua 的过程中做的, 配置在 tools/tolua/cocos2dx.ini
中的这行:
rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames
lua 的 api 基本上和 c++ 是一致的, 但是有些也略有不同, api 位于 cocos/scripting/lua-bindings/auto/api
文件夹下, 你可以去这里查找, 当然也有在线的文档, 查找到之后在右上角选中 lua 就可以查看.