Setting gui pie bound

Hi All,
does anyone know how to set the gui pie node’s bound to the area which is actually drawn and not to the whole circle. The point is if i create a circular menu with several slices around, then a mouseover detection will fail to detect the proper slice.
thanks,
Ákos

This is not possible to do with the provided Defold APIs. I guess you could calculate it yourself somehow.

If you only wish to “pick” the circle, then this should work (untested):

if gui.pick_node(node, x, y) then
    local radius = box_size/2
    local diff = gui.get_position(node) - circle_center
    if vmath.length_sqr(diff) < radius then
        -- calculate the angle of diff, to find the menu item
    end
end
2 Likes