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
sicher
October 6, 2018, 6:02pm
2
You need to check the click position against the bounding boxes of the nodes. See https://www.defold.com/examples/gui/button/
2 Likes
Pkeod
October 6, 2018, 11:35pm
3
You could also filter the click positions through a secondary hex shape which fits the node hex shape.
2 Likes
sicher
October 7, 2018, 8:00am
4
(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