Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.13 KB

File metadata and controls

37 lines (24 loc) · 1.13 KB

Soup Lua Bindings

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

I/O

Warning

These functions can easily be used incorrectly so new code is highly advised to use pluto-zip instead.

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.