Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
function newpos(xScale, xOffset, yScale, yOFfset) print(f.Position) end local f = {} f.Position = 1 f.Size = newpos(1, 0, 1, 0) f.Filled = true f.Visible = true
我如何从 newpos 获取 f 表?
我如何从 newpos 获取 f 表
如果要从函数中获取表,则该函数需要返回该表。
假设您要创建一个表示 2d 点的表:
function newpos(x, y) local p = { x = x, y = y, } return p end
然后你可以做类似的事情
local origin = newpos(0, 0) print(origin.x, origin.y)