function init(self)
	msg.post(".", "acquire_input_focus")
	gui.set_alpha(gui.get_node("startgame_highlight"), 0) 
	gui.set_alpha(gui.get_node("instructions_highlight"), 0) 
	gui.set_alpha(gui.get_node("settings_highlight"), 0) 
end

function final(self)
	-- Add finalization code here
	-- Learn more: https://defold.com/manuals/script/
	-- Remove this function if not needed
end

function update(self, dt)
	-- Add update code here
	-- Learn more: https://defold.com/manuals/script/
	-- Remove this function if not needed
end

function on_message(self, message_id, message, sender)
	-- Add message-handling code here
	-- Learn more: https://defold.com/manuals/message-passing/
	-- Remove this function if not needed
end

function on_input(self, action_id, action)
	if action_id == hash("touch") and action.pressed then
		if gui.pick_node(gui.get_node("startgame"), action.x, action.y) then
			msg.post("main:/controller#main", "show level1 screen")
		elseif gui.pick_node(gui.get_node("instructions"), action.x, action.y) then
			msg.post("main:/controller#main", "show instructions screen")
		elseif gui.pick_node(gui.get_node("settings"), action.x, action.y) then
			msg.post("main:/controller#main", "show settings screen")
		end
	elseif action_id == nil then
		--Check if mouse is over the button
		if gui.pick_node(gui.get_node("startgame"), action.x, action.y) then
			gui.set_alpha(gui.get_node("startgame_highlight"), 1)  -- Show highlight
		else
			gui.set_alpha(gui.get_node("startgame_highlight"), 0)  -- Hide highlight
		end
		if gui.pick_node(gui.get_node("instructions"), action.x, action.y) then
			gui.set_alpha(gui.get_node("instructions_highlight"), 1)  -- Show highlight
		else
			gui.set_alpha(gui.get_node("instructions_highlight"), 0)  -- Hide highlight
		end
		if gui.pick_node(gui.get_node("settings"), action.x, action.y) then
			gui.set_alpha(gui.get_node("settings_highlight"), 1)  -- Show highlight
		else
			gui.set_alpha(gui.get_node("settings_highlight"), 0)  -- Hide highlight
		end
	end
end

function on_reload(self)
	-- Add reload-handling code here
	-- Learn more: https://defold.com/manuals/hot-reload/
	-- Remove this function if not needed
end
