Hello there!
Sorry, first post with some questions already.
GUI related. I’m using the gui.set_enabled() to disable my container (after pressing the start button) that contains two elements: a button (gooey) and a box (background). Calling the method only removes the first one. I couldn’t find anything related in Defold’s documentation.
and how can I open files from external libraries (like gooey) using vscode? I think the only way to do it is downloading and setting up the libraries manually idk.
Can you double check that the node you disable is the root node and that all others are children?
The library dependencies are zip files in the .internal folder. The Defold editor will show them as it is designed to do so, but VSCode obviously doesn’t know about them.
GUI copied from my main project. Error persist. I just followed the same steps on a new project and worked. I don’t know what Im missing. I’m sorry if this is some trivial thing =/
Ah, found the problem. The things is that as opposed to the lifecycle functions the callback from the Gooey button press doesn’t start with self. The first value is the button table structure itself:
local function hide(self)
gui.set_enabled(self.node, false)
end
function on_input(self, action_id, action)
gooey.button("start/bg", action_id, action, hide)
end
And it just happens that the button data structure has a value called node which references the root node of the button. This is why the call to gui.set_enabled() doesn’t fail and only the button is hidden. Change to this:
function on_input(self, action_id, action)
gooey.button("start/bg", action_id, action, function(button)
gui.set_enabled(self.node, false)
end)
end
Ahh makes sense now. It’s working, thank you! Ill read more carefully the libraries docs from now on (or even debug what Im send thought those methods). Sorry to bother and thanks again!