Thread Tools Display Modes
02-03-09, 03:03 PM   #1
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
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.
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"
  Reply With Quote
02-05-09, 01:56 PM   #2
Bitwise
A Defias Bandit
Join Date: Feb 2009
Posts: 2
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)
  Reply With Quote
02-05-09, 07:32 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
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)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
02-05-09, 10:10 PM   #4
Bitwise
A Defias Bandit
Join Date: Feb 2009
Posts: 2
Originally Posted by Seerah View Post
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.
  Reply With Quote
02-05-09, 11:13 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
That's because the MinimapCluster frame *behind* the minimap still has mouse enabled.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
02-06-09, 06:11 PM   #6
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
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).
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"
  Reply With Quote
02-06-09, 09:12 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I'm not sure if a frame's being mouse enabled is inheritable...
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
02-07-09, 11:08 PM   #8
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
Originally Posted by Seerah View Post
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.
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"
  Reply With Quote
02-09-09, 04:51 AM   #9
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by Seerah View Post
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.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Making Blizzard UI frame "transparent" to the mouse?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off