Passing lua tables to a pallene script? #360
-
Hi, local function vec2_mag(p: table): float
return math.sqrt(p.x as integer * p.x as integer, p.y as integer * p.y as integer)
end Right now, the closest I can get is to pass the members explicitly for simple tables. export function vec2_mag(x: float, b: float): float
return math.sqrt(x * x, y * y)
end But for tables with many members, this gets a bit hairy. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
You can use a table type.
You can also use a typealias to give a name to the type
|
Beta Was this translation helpful? Give feedback.
You can use a table type.
You can also use a typealias to give a name to the type