I click one sprite but pressed with other sprites

function on_input(self, action_id, action)
if action_id == hash("touch") and action.pressed then
	local idim = go.get_id()
	print(idim)
	--go.set(".".."#sprite", "tint", vmath.vector4(0.36, 0.12, 0.5, 0.1))
end

end

which one I want to do only with her

You need to check the click position against the bounding boxes of the nodes. See https://www.defold.com/examples/gui/button/

2 Likes

You could also filter the click positions through a secondary hex shape which fits the node hex shape.

2 Likes

(That is an awesome resource for hex games! First time I’ve read about cube and axial coordinates for hex grids. Cool!)

A third option is to keep the hex grid and sizes in a datastructure and then do pixel to hex coordinate conversion. See https://www.redblobgames.com/grids/hexagons/#pixel-to-hex

2 Likes