I’m not sure if that is intended but,
if I try to call a gui function in a gui_script file but not inside any function like this:
local box_node = gui.get_node("box_node")
function init (self)
gui.animate ( box_node, ... )
end
function update(self, dt)
gui.animate ( box_node, ... )
end
I get this error :
ERROR:SCRIPT: You can only access gui.* functions and values from a gui script instance (.gui_script file)
I found a way around like this :
local my_nodes = {}
function init (self)
my_nodes.box_node = gui.get_node("box_node")
gui.animate ( my_nodes.box_node, ... )
end
function update(self, dt)
gui.animate ( my_nodes.box_node, ... )
end
But this gives me the same error:
local my_nodes = { box_node = gui.get_node("box_node") }
Shouldn’t we be able to use gui functions inside a gui script even tho they are not inside a function ?