No, I'm not sure. But I got curious and wrote this function to search the whole environment for identifiers:
Code: Select all
local function searchVar(name, scope, scopeName)
local stack, path = {}, {}
local function descend(var, name, search)
if stack[var] then return end
stack[var] = name
table.insert(path, name)
for key, v in pairs(var) do
if key == search then
print(table.concat(path, ".") .. "." .. tostring(key), v)
end
local meta = getmetatable(v)
if meta then
descend(meta, key, search)
end
if type(v) == "table" then
descend(v, key, search)
end
end
table.remove(path, #path)
stack[var] = nil
end
return descend(scope or _G, scopeName or "_G", name)
end
returns nothing.
returns functions in love.audio, mouse, window and touch, but not physics.
Code: Select all
body = love.physics.newBody(love.physics.newWorld())
searchVar("getPosition")
additionally returns getPosition in the body instance.
So at least I'm sure it does not exist in Lua space.