Thread Tools Display Modes
06-03-11, 03:43 PM   #1
nelothi
An Aku'mai Servant
AddOn Compiler - Click to view compilations
Join Date: Jul 2008
Posts: 36
Changing bartender alpha with kgpanels.

I want to make a kgpanel that will set the alpha of 2 bartender bars to 100 or 0 depending on what alpha they are already at.

right now i can hide them, but that causes major problems in combat.
Code:
if pressed then
if BT4Bar3:IsVisible () then

 BT4Bar3:Hide()

 BT4Bar4:Hide()
  else 
 
 BT4Bar3:Show()

 BT4Bar4:Show()

end
elseif released then
end
this is what i have right now, to hide them. Can anyone show me how to change their alpha, if at all possible?
  Reply With Quote
06-03-11, 03:59 PM   #2
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
SetAlpha/GetAlpha should work.
  Reply With Quote
06-03-11, 04:03 PM   #3
nelothi
An Aku'mai Servant
AddOn Compiler - Click to view compilations
Join Date: Jul 2008
Posts: 36
Originally Posted by Nibelheim View Post
SetAlpha/GetAlpha should work.
sweet, thanks!
  Reply With Quote
06-03-11, 04:14 PM   #4
nelothi
An Aku'mai Servant
AddOn Compiler - Click to view compilations
Join Date: Jul 2008
Posts: 36
Code:
if pressed then
if BT4Bar3:GetAlpha (1) then
 BT4Bar3:SetAlpha (0)
 BT4Bar4:SetAlpha (0)
  elseif BT4Bar3:GetAlpha (0) then
 BT4Bar3:SetAlpha (1)
 BT4Bar4:SetAlpha (1)
end
elseif released then
end
What am i doing wrong? It will set the alpha to 0, but it wont switch it back to 1.
  Reply With Quote
06-03-11, 04:20 PM   #5
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by nelothi View Post
Code:
if pressed then
if BT4Bar3:GetAlpha (1) then
 BT4Bar3:SetAlpha (0)
 BT4Bar4:SetAlpha (0)
  elseif BT4Bar3:GetAlpha (0) then
 BT4Bar3:SetAlpha (1)
 BT4Bar4:SetAlpha (1)
end
elseif released then
end
What am i doing wrong? It will set the alpha to 0, but it wont switch it back to 1.
Get lines need to be like: if BT4Bar3:GetAlpha() == 0 then
Set lines need to be like: BT4Bar3:SetAlpha(1)
  Reply With Quote
06-03-11, 04:23 PM   #6
nelothi
An Aku'mai Servant
AddOn Compiler - Click to view compilations
Join Date: Jul 2008
Posts: 36
Originally Posted by Nibelheim View Post
Get lines need to be like: if BT4Bar3:GetAlpha() == 0 then
Set lines need to be like: BT4Bar3:SetAlpha(1)
Ah. thanks. works now.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Changing bartender alpha with kgpanels.


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