Originally Posted by Katae
This is happening because the cursor is being intercepted by the DBM button, so the parent "thinks" that the cursor is leaving it, thus triggering the OnLeave function.
You can get around this pretty easily by checking if the cursor is not hovering over a child panel:
Code:
OnLeave = function(self)
if GetMouseFocus():GetParent() ~= self then self:SetAlpha(0) end
end,
|
Thank you for your help.
Now, sometimes diverting the cursor on the panel, it does not disappear.
Code:
Code:
{ name = "Buttons panel",
anchor_to = "BOTTOM", x_off = 285, y_off = 6,
width = 200, height = 7,
bg_alpha = 1,
OnLoad = function(self) self:SetAlpha(0) end,
OnEnter = function(self) self:SetAlpha(1) end,
OnLeave = function(self)
if GetMouseFocus():GetParent() ~= self then self:SetAlpha(0) end
end,
},
{ name = "DBM Button", parent = "Buttons panel",
anchor_to = "LEFT", x_off = 0, y_off = 1,
OnClick = function(self, button)
if button == "LeftButton" then
DBM:LoadGUI()
end
end,
text = {
{ string = "DBM",
anchor_to = "CENTER",
outline=1,
font = main_font,
size = main_font_size,
color = "CLASS"
},
},
},