function init(self)
	msg.post("main:/controller#main", "send_table")
--	gui.set_color(node, vmath.vector4(105, 73, 18, 1))
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)
	if message_id == hash("highscore_table") then
		gui.set_text(gui.get_node("name1"), message.high_scores[1][1])
		gui.set_text(gui.get_node("score1"), message.high_scores[1][2])
		gui.set_text(gui.get_node("name2"), message.high_scores[2][1])
		gui.set_text(gui.get_node("score2"), message.high_scores[2][2])
		gui.set_text(gui.get_node("name3"), message.high_scores[3][1])
		gui.set_text(gui.get_node("score3"), message.high_scores[3][2])
		gui.set_text(gui.get_node("name4"), message.high_scores[4][1])
		gui.set_text(gui.get_node("score4"), message.high_scores[4][2])
		gui.set_text(gui.get_node("name5"), message.high_scores[5][1])
		gui.set_text(gui.get_node("score5"), message.high_scores[5][2])
		gui.set_text(gui.get_node("name6"), message.high_scores[6][1])
		gui.set_text(gui.get_node("score6"), message.high_scores[6][2])
		gui.set_text(gui.get_node("name7"), message.high_scores[7][1])
		gui.set_text(gui.get_node("score7"), message.high_scores[7][2])
		gui.set_text(gui.get_node("name8"), message.high_scores[8][1])
		gui.set_text(gui.get_node("score8"), message.high_scores[8][2])
		gui.set_text(gui.get_node("name9"), message.high_scores[9][1])
		gui.set_text(gui.get_node("score9"), message.high_scores[9][2])
		gui.set_text(gui.get_node("name10"), message.high_scores[10][1])
		gui.set_text(gui.get_node("score10"), message.high_scores[10][2])
	end
end

function on_input(self, action_id, action)
	-- Add input-handling code here. The game object this script is attached to
	-- must have acquired input focus:
	--
	--    msg.post(".", "acquire_input_focus")
	--
	-- All mapped input bindings will be received. Mouse and touch input will
	-- be received regardless of where on the screen it happened.
	-- Learn more: https://defold.com/manuals/input/
	-- Remove this function if not needed
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
