Quantcast kgPanels Help - WoWInterface
Thread Tools Display Modes
05-12-13, 08:43 AM   #1
Redigit
A Kobold Labourer
Join Date: May 2013
Posts: 1
kgPanels Help

I'm really new to this whole kgPanels thing (I got it today haha) was just wondering what the script would be to only show a texture when i have a target. I am trying to go for the infamous Kait:Auras glowing health orb look if that helps anybody. Have made a circle texture, just need the script/code to make it only appear when i target something, so that i dont have a random circle in the middle of my screen. Any help would be greatly appreciated, thanks!
  Reply With Quote
05-12-13, 09:44 AM   #2
lynce
A Cyclonian
 
lynce's Avatar
Join Date: Jul 2008
Posts: 48
I don't use kgPanels myself. But this may help you.
- KgPanels, Player, Target, Anchoring -

Now we're going to create panels for the player and target frame. The problem with target frame is obvious. We're not always targeting someone or something, so we need the panel to disappear if we're not targeting anything. This is done by parenting frames.

Go ahead and create a new panel with the name "Player". Copy All from Buttons and move it into place, very simple.

Now that we've made it fit with the player frame, the target frame will use the same dimensions. So it's going to be very easy for us. Make a new panel named "Target" and copy all from Player. Sometimes, as in my case it refuse to copy, simply type "/rl" and do it again.

Lock the panel once it's in place. Now we need to figure out what the target frame is called, so that we can parent the panel to the frame. Do this by using this macro. "/run ChatFrame1:AddMessage(GetMouseFocus():GetName())" while your mouse is hovering over the target frame. My target frame is called: "PitBullUnitFrame3". Remember that you need to copy EXACTLY what it says, including capital letters.

At the absolute bottom of Target are two options. Anchor and Parent. Anchor decides the position, if you move the target frame, it will move with. The Parent frame follows whatever action happens. Shown, Hidden etc.

So set the Parent to "PitBullUnitFrame3" or whatever yours was, be sure to press Okay. You don't need to anchor this frame unless you're planning on moving your target frame constantly.
  Reply With Quote
05-12-13, 11:15 AM   #3
Kendian
A Molten Giant
 
Kendian's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 614
Just parent it to your targets unit frame, then it will only show up when you have a target.
__________________
  Reply With Quote
05-13-13, 10:57 AM   #4
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Here is some code not depending on any unitframe addon.

Onload:
Code:
self:RegisterEvent('PLAYER_TARGET_CHANGED')
OnEvent:
Code:
self:SetShown(UnitExists('target'))
  Reply With Quote
05-13-13, 04:11 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,527
well, yes, but parenting the kgPanel to the frame is 100x better...
__________________
"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

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » kgPanels Help

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