is there a way to do a "mask" so if i click on a button there is no way that i click on terrain behind button?
All MyGUI inject***functions return boolean variable, meaning that GUI handled event, so if inject mouseMove/Press/Release returned true you should not pass mouse event further into non-gui game controls. By default all widgets are not transparent to input, but if you need them to be use setNeedMouseFocus to false or use same property with the same name in LayoutEditor.
if you mean that if i set needmouse in layouteditor as false i can use a code as this below i tested it and when i tried i had result that all widget aren't able to click
if (MyGUI::InputManager::getInstance().injectMousePress(arg.state.X.abs, arg.state.Y.abs, MyGUI::MouseButton::Enum(id)) == true)
txt_write("you clicked inside");
txt_write("you clicked outside");
thanks for help
All widgets react on mouse input by default, so to make gui "transparent" for mouse you need to set NeedMouse for all underlying widgets as well.
Edit: I misunderstood you. If you have Some widget that should be transparent to mouse with child widgets that should react on mouse and be not transparent set NeedMouse to false and InheritsPick to true for transparent widgets and keep default settings for other widgets. Setting NeedMouse to false for root widget make all it's childs ignore mouse as well, unless you set InheritsPick.