WeaselGames / godot_luaAPI

Godot LuaAPI
https://luaapi.weaselgames.info
Other
348 stars 27 forks source link

Feature Resuest: Pushing modules to lua #197

Open Fran6nd opened 4 months ago

Fran6nd commented 4 months ago

Is your feature request related to a problem? Please describe. Currently there is no way to push a gdscript made library to lua.

Describe the solution you'd like I would like to have a pushModule(name, array) function pushing an array as global. The array would formatted as follows: [[function_name1, function1],...] So we can use as follow from lua: module_name.function_name()

I have done yet unsuccessful attempts to implement it but working on it!

Thank you!

RadiantUwU commented 1 month ago

Use

api.push_variant("module_name",{
   "function_name_1":function_1,
   "function_name_2":function_2
})

it will behave as expected