WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Making Blizzard UI frame "transparent" to the mouse? (https://www.wowinterface.com/forums/showthread.php?t=20409)

acapela 02-03-09 03:03 PM

Making Blizzard UI frame "transparent" to the mouse?
 
how would one go about hijacking an existing Blizzard UI frame (or any other frame, really) and rendering it completely transparent to the mouse?

the old Eclipse library (mentioned here) apparently did this (and i am happy to reverse-engineer stuff), but i cannot find any record of this library on Google or any of the main addon sites.

looking at other addons, it appears Frame:EnableMouse() and various "OnClick"/etc hooks might be relevant (and Button:RegisterForClicks() maybe not so relevant, not generally for frames), but i was hoping someone could point me directly to some documentation and/or an example (so i don't have to do a ton of trial/error).

thanks.

Bitwise 02-05-09 01:56 PM

Drop this in a .LUA to have a frame in the center of the screen that you can click through. The final two functions called are what makes it work, theoretically they should work on any frame Blizzard or not.

Code:

local exampleFrame = CreateFrame("FRAME", nil, UIParent)
exampleFrame:SetWidth(100)
exampleFrame:SetHeight(100)
exampleFrame:SetPoint("CENTER", UIParent, "CENTER")
exampleFrame:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", edgeFile = "Interface/Tooltips/UI-Tooltip-Border", tile = true, tileSize = 16, edgeSize = 16, insets = { left = 4, right = 4, top = 4, bottom = 4 }});
exampleFrame:SetBackdropColor(0,0,0,1);

exampleFrame:SetFrameStrata(BACKGROUND)
exampleFrame:SetFrameLevel(0)


Seerah 02-05-09 07:32 PM

Those two lines do not set whether a frame is click through or not, they merely set the frames draw level. (Think z-axis for your UI.) frame:EnableMouse(true or false) is what makes a frame click-through or not. (Your frame above is click-through by default)

Bitwise 02-05-09 10:10 PM

Quote:

Originally Posted by Seerah (Post 116632)
Those two lines do not set whether a frame is click through or not, they merely set the frames draw level. (Think z-axis for your UI.) frame:EnableMouse(true or false) is what makes a frame click-through or not. (Your frame above is click-through by default)

Yes, I suppose I should have mentioned that. I assumed he would already use EnableMouse(false) on his frame since he mentioned it in the first post. I'm not entirely sure which of those two lines sets it to be click-through, but i've seen EnableMouse(false) prevent you from clicking through but nothing happens if you click it. To test that, call Minimap:EnableMouse(false) and try to ping the minimap.

Seerah 02-05-09 11:13 PM

That's because the MinimapCluster frame *behind* the minimap still has mouse enabled. ;)

acapela 02-06-09 06:11 PM

in my case, i am calling EnableMouse() on the ultimate "parent" frame of a group of frames, to disable the mouse, and never calling it in any form on any of the dependent/children frames.

the result of this is that the frame hierarchy rooted at the "parent" frame is not responsive to the mouse, but neither is anything else that happens to be underneath the "parent" frame.

so, i am guessing there is something else required. i have not been able to figure out what it is. Seerah's post implies that these child frames are not defaulting to something i don't want (and therefore should not be "blocking" the mouse even though the parent frame is disabled).

Seerah 02-06-09 09:12 PM

I'm not sure if a frame's being mouse enabled is inheritable...

acapela 02-07-09 11:08 PM

Quote:

Originally Posted by Seerah (Post 116718)
I'm not sure if a frame's being mouse enabled is inheritable...

i was assuming that these children/dependent elements would default to "mouse disabled". but i can try experimenting with explicitly disabling the mouse on everything, before enabling the mouse on the one parent element, just to make certain.

Duugu 02-09-09 04:51 AM

Quote:

Originally Posted by Seerah (Post 116718)
I'm not sure if a frame's being mouse enabled is inheritable...

It is inheritable. But the attributes are inherited only once (frame creation) - not at runtime. Setting a attribute at runtime won't affect the child frames.

Imho you'll have to iterate over all the child frames.


All times are GMT -6. The time now is 08:23 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI