Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 995 Bytes

LUA_API.md

File metadata and controls

34 lines (22 loc) · 995 Bytes

Soup Lua Bindings

Although the Lua bindings themselves are compatible with vanilla Lua, some of the code samples provided here require Pluto.

I/O

userdata soup.FileReader(string path)

userdata soup.StringReader(string data)

userdata soup.ZipReader(userdata reader)

Note that the ZipReader takes a pointer to the reader instance, so a ZipReader instance must not reach scopes that the reader instance can't reach.

local fr = soup.FileReader("test.zip")
local zr = soup.ZipReader(fr)
for _, f in zr:getFileList() do
    print(f.name .. ": " .. zr:getFileContents(f))
end

Math

userdata soup.Matrix()

Returns a soup::Matrix instance which provides setPosRotXYZ method and multiplication operator taking soup::Vector3.

userdata soup.Vector3()
userdata soup.Vector3(number x, number y, number z)

Returns a soup::Vector3 instance.