New to Defold...Stuck on the colorslide tutorial

I’m guessing that you hide one gui but fail to show the other?

In a sense yes. Upon hitting play, the screens are suppose to reverse so the start is hidden and the level select appears. This is in the function on_input of the start script I believe. Again both scripts are running and with no error message it makes these problems rather tough to solve.

Well, if the code hasn’t changed since you shared the code with me then this is wrong:

-- start.gui_script
msg.post("#level_select", "#show_level_select")

There is no message handler for "#show_level_select" (note the ‘#’ sign that shouldn’t be there):

-- level_select.gui_script
function on_message(self, message_id, message, sender)
	if message_id == hash("show_level_select") then
		msg.post("#", "enable")
		self.active = true
	elseif message_id == hash("hide_level_select") then
		msg.post("#", "disable")
		self.active = false
	end
end

You can always set a breakpoint on the first line of your on_message functions to check the incoming messages. Or add print() statements.

3 Likes

Well that fixed it. I will continue on with the tutorial. I appreciate all the support everyone has given me on this thread. Thank you!

2 Likes