Thread Tools Display Modes
10-08-14, 01:56 PM   #1
Ansi
An Aku'mai Servant
 
Ansi's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Post Strata

I copy/pasted myself an addon to show damage/healing on target portrait.
However, the strata is lower on the target frame, than on my self frame. Can anyone help me take the text to the front? Probably DIALOG strata.

Thanks in advance.
-- This file is loaded from "AnsiPortraitDamage.toc"local text = TargetFrame:CreateFontString(nil, "OVERLAY", "NumberFontNormalHuge")
text:SetPoint("CENTER", TargetFrame, "TOPLEFT", 160, -40)
text:Hide()local f = CreateFrame("Frame", nil, TargetFrame)
f:RegisterUnitEvent("UNIT_COMBAT", "target")CombatFeedback_Initialize(f, text, 30)f:SetScript("OnEvent", function(self, event, unit, ...)
CombatFeedback_OnCombatEvent(self, ...)
end)
f:SetScript("OnUpdate", function(self, elapsed)
CombatFeedback_OnUpdate(self, elapsed)
end)
__________________
twitter.com/ansirox

Last edited by Ansi : 10-08-14 at 01:58 PM.
  Reply With Quote
10-08-14, 02:05 PM   #2
Danielps1
Guest
Posts: n/a
Your code looks fine, actually.


Lua Code:
  1. local text = TargetFrame:CreateFontString(nil, "OVERLAY", "NumberFontNormalHuge")

OVERLAY is the layer which should be the right one.

more Information here: http://wowprogramming.com/docs/api_types#layer

But you can try using

Lua Code:
  1. local text = TargetFrame:CreateFontString(nil, "HIGHLIGHT", "NumberFontNormalHuge")

Just to test if it does anything. But that's not the right thing to do. What Unit Frames are you using? Maybe you can lower the strata of those?

Last edited by Danielps1 : 10-08-14 at 02:10 PM.
  Reply With Quote
10-08-14, 02:32 PM   #3
Ansi
An Aku'mai Servant
 
Ansi's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
HIGHLIGHT doesn't work at all. If I put DIALOG it's even further behind than OVERLAY.

If you know what I mean.

Using default frames.
__________________
twitter.com/ansirox
  Reply With Quote
10-08-14, 02:37 PM   #4
Danielps1
Guest
Posts: n/a
Originally Posted by Ansi View Post
HIGHLIGHT doesn't work at all. If I put DIALOG it's even further behind than OVERLAY.

If you know what I mean.

Using default frames.
uh yeah, you have to mouseover the element. I just wanted to know if it is an Issue with the layer or something else.

Edit: make sure mouse is enabled on the frame
http://wowprogramming.com/docs/widge...me/EnableMouse

Last edited by Danielps1 : 10-08-14 at 02:51 PM.
  Reply With Quote
10-08-14, 03:08 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
DIALOG is a frame strata, not a drawlayer. A strata is which level a frame is rendered among other frames. A drawlayer is a level within the same frame to establish rendering order among other regions (textures and fontstrings). If you have a frame rendered above another, there is no drawlayer setting to make a region from the lower frame render above the upper frame.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
10-08-14, 03:12 PM   #6
Ansi
An Aku'mai Servant
 
Ansi's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Oh you're right. But even with HIGHLIGHT I cannot get the targetframe to look exactly like the selfframe.
__________________
twitter.com/ansirox
  Reply With Quote
10-08-14, 03:48 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
I took what Blizzard did with PlayerFrame and applied it to TargetFrame. The code turned out similar, but I made a few optimizations. First of all, there's a child frame called TargetFrameTextureFrame that's rendering most of the textures above TargetFrame. I moved the fontstring to render there in the same layer as what happens with PlayerFrame. Since the TargetFrame is just a flipped PlayerFrame, I used the same anchor and flipped it accordingly. I bypassed the need for a dedicated event frame by registering TargetFrame to receive the event and used a secure hook into the OnEvent and OnUpdate handlers.

Lua Code:
  1. local txt=TargetFrameTextureFrame:CreateFontString("TargetHitIndicator","OVERLAY","NumberFontNormalHuge");
  2. txt:SetPoint("CENTER",TargetFrameTextureFrame,"TOPRIGHT",-73,-42);
  3. txt:Hide();
  4. CombatFeedback_Initialize(TargetFrame,txt,30);
  5.  
  6. TargetFrame:RegisterUnitEvent("UNIT_COMBAT","target");
  7. TargetFrame:HookScript("OnEvent",function(self,event,unit,...)
  8.     if event=="UNIT_COMBAT" then CombatFeedback_OnCombatEvent(self,...); end
  9. end);
  10.  
  11. TargetFrame:HookScript("OnUpdate",CombatFeedback_OnUpdate);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
10-09-14, 01:26 AM   #8
Ansi
An Aku'mai Servant
 
Ansi's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 33
Perfect! Thank you :-)
__________________
twitter.com/ansirox
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Strata


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