PitBull Unit Frames 4.0

API/Controls/BetterStatusBar

BetterStatusBar:GetBackgroundAlpha()

Get the alpha value of the bar's background

Return value

the alpha value [0, 1]

Usage

local alpha = bar:GetBackgroundAlpha()


BetterStatusBar:GetBackgroundColor()

Get the background color of the bar

Return values

  1. the red value [0, 1]
  2. the green value [0, 1]
  3. the blue value [0, 1]

Usage

local r, g, b = bar:GetBackgroundColor()


BetterStatusBar:GetColor()

Get the color of the bar

Return values

  1. the red value [0, 1]
  2. the green value [0, 1]
  3. the blue value [0, 1]

Usage

local r, g, b = bar:GetColor()


BetterStatusBar:GetDeficit()

Get whether the bar is showing its deficit

Return value

whether the bar is showing its deficit

Usage

assert(bar:GetDeficit() == true)


BetterStatusBar:GetExtraAlpha()

Get the alpha value of the bar's extra portion

Return value

the alpha value [0, 1]

Usage

local alpha = bar:SetExtraAlpha()


BetterStatusBar:GetExtraColor()

Get the extra color of the bar

Return values

  1. the red value [0, 1]
  2. the green value [0, 1]
  3. the blue value [0, 1]

Usage

local r, g, b = bar:GetExtraColor()


BetterStatusBar:GetExtraValue()

Return the extra value

Return value

the extra value

Usage

assert(bar:GetExtraValue() == 0.25)


BetterStatusBar:GetIcon()

Return the icon's texture path of the bar

Return value

the texture path or nil

Usage

local icon = bar:GetIcon()


BetterStatusBar:GetIconPosition()

Return whether the icon is on the left or bottom.
If the bar is reversed, then the icon will be on the right or top instead.

Return value

true if the icon is on left or top, otherwise, false.

Usage

local left = bar:GetIconPosition()


BetterStatusBar:GetMinMaxValues()

Return the minimum and maximum values of the bar Since this can't be changed, it will always return 0, 1

Return values

  1. the minimum value: 0
  2. the maximum value: 1

Usage

local min, max = bar:GetMinMaxValues()


BetterStatusBar:GetNormalAlpha()

Get the alpha value of the bar

Return value

the alpha value [0, 1]

Usage

local alpha = bar:GetNormalAlpha()


BetterStatusBar:GetOrientation()

Get the current orientation of the bar

Return value

"HORIZONTAL" or "VERTICAL"

Usage

assert(bar:GetOrientation() == "VERTICAL")


BetterStatusBar:GetReverse()

Get whether the bar is currently reversed

Return value

whether the bar is reversed

Usage

assert(bar:GetReverse() == true)


BetterStatusBar:GetTexture()

Get the texture that the bar is using

Return value

the path to the texture

Usage

assert(bar:GetTexture() == [[Interface\TargetingFrame\UI-StatusBar]])


BetterStatusBar:GetValue()

Return the current value

Return value

the value between [0, 1]

Usage

assert(bar:GetValue() == 0.5)


BetterStatusBar:SetBackgroundAlpha(a)

Set the alpha value of the bar's background If you do not specify the alpha, it will be the same as the bar's normal alpha

Parameters

a
the alpha value [0, 1] or nil

Usage

bar:SetBackgroundAlpha(0.7)
bar:SetBackgroundAlpha()


BetterStatusBar:SetBackgroundColor(br, bg, bb)

Set the background color of the bar If you don't specify the colors, then it will come up with a good color based on the normal color

Parameters

br
the red value [0, 1] or nil
bg
the green value [0, 1] or nil
bb
the blue value [0, 1] or nil

Usage

bar:SetBackgroundColor(0.5, 0.41, 0)
bar:SetBackgroundColor()


BetterStatusBar:SetColor(r, g, b)

Set the color of the bar If the background color or the extra color is not set, they will take on a similar color to what is specified here

Parameters

r
the red value [0, 1]
g
the green value [0, 1]
b
the blue value [0, 1]

Usage

bar:SetColor(1, 0.82, 0)


BetterStatusBar:SetDeficit(deficit)

Set whether the bar is showing its deficit Showing deficit means that if the value is set to 25%, it'd show 75%

Parameters

deficit
whether the bar shows its deficit

Usage

bar:SetDeficit(true)


BetterStatusBar:SetExtraAlpha(a)

Set the alpha value of the bar's extra portion If you do not specify the alpha, it will be the same as the bar's normal alpha

Parameters

a
the alpha value [0, 1] or nil

Usage

bar:SetExtraAlpha(0.7)
bar:SetExtraAlpha()


BetterStatusBar:SetExtraColor(er, eg, eb)

Set the extra color of the bar If you don't specify the colors, then it will come up with a good color based on the normal color

Parameters

er
the red value [0, 1] or nil
eg
the green value [0, 1] or nil
eb
the blue value [0, 1] or nil

Usage

bar:SetExtraColor(0.8, 0.6, 0)
bar:SetExtraColor()


BetterStatusBar:SetExtraValue(extraValue)

Set the extra value of a status bar This is useful if you have a base value and an auxillary value, such as experience and rested experience.

Parameters

extraValue

Usage

bar:SetExtraValue(0.25)


BetterStatusBar:SetIcon(path)

Set the icon's texture path of the bar, or remove it.

Parameters

path
the texture path or nil

Usage

bar:SetIcon([[Interface\Icons\Ability_Parry]])
bar:SetIcon(nil)


BetterStatusBar:SetIconPosition(value)

Set whether the icon is on the left or bottom.
If the bar is reversed, then the icon will be on the right or top instead.

Parameters

value
a boolean

Usage

bar:SetIconPosition(true)
bar:SetIconPosition(false)


BetterStatusBar:SetNormalAlpha(a)

Set the alpha value of the bar If the background or extra alpha is not set, they will be the same as the alpha specified here

Parameters

a
the alpha value [0, 1]

Usage

bar:SetNormalAlpha(0.7)


BetterStatusBar:SetOrientation(orientation)

Set the orientation of the bar

Parameters

orientation
"HORIZONTAL" or "VERTICAL"

Usage

bar:SetOrientation("VERTICAL")


BetterStatusBar:SetReverse(reverse)

Set whether the bar is reversed Reversal means the bar goes right-to-left instead of left-to-right

Parameters

reverse
whether the bar is reversed

Usage

bar:SetReverse(true)


BetterStatusBar:SetTexture(texture)

Set the texture that the bar is currently using

Parameters

texture
the path to the texture

Usage

bar:SetTexture([[Interface\TargetingFrame\UI-StatusBar]])


BetterStatusBar:SetValue(value)

Set the current value

Parameters

value
value between [0, 1]

Usage

bar:SetValue(0.5)


PitBull4.Controls.MakeBetterStatusBar(parent)

Make a better status bar than what Blizzard provides

Parameters

parent
frame the status bar is parented to

Return value

a BetterStatusBar object

Usage

local bar = PitBull4.Controls.MakeBetterStatusBar(someFrame)


You must login to post a comment. Don't have an account? Register to get one!

Table of contents

  1. 1 BetterStatusBar:GetBackgroundAlpha()
    1. 1.1 Return value
    2. 1.2 Usage
  2. 2 BetterStatusBar:GetBackgroundColor()
    1. 2.1 Return values
    2. 2.2 Usage
  3. 3 BetterStatusBar:GetColor()
    1. 3.1 Return values
    2. 3.2 Usage
  4. 4 BetterStatusBar:GetDeficit()
    1. 4.1 Return value
    2. 4.2 Usage
  5. 5 BetterStatusBar:GetExtraAlpha()
    1. 5.1 Return value
    2. 5.2 Usage
  6. 6 BetterStatusBar:GetExtraColor()
    1. 6.1 Return values
    2. 6.2 Usage
  7. 7 BetterStatusBar:GetExtraValue()
    1. 7.1 Return value
    2. 7.2 Usage
  8. 8 BetterStatusBar:GetIcon()
    1. 8.1 Return value
    2. 8.2 Usage
  9. 9 BetterStatusBar:GetIconPosition()
    1. 9.1 Return value
    2. 9.2 Usage
  10. 10 BetterStatusBar:GetMinMaxValues()
    1. 10.1 Return values
    2. 10.2 Usage
  11. 11 BetterStatusBar:GetNormalAlpha()
    1. 11.1 Return value
    2. 11.2 Usage
  12. 12 BetterStatusBar:GetOrientation()
    1. 12.1 Return value
    2. 12.2 Usage
  13. 13 BetterStatusBar:GetReverse()
    1. 13.1 Return value
    2. 13.2 Usage
  14. 14 BetterStatusBar:GetTexture()
    1. 14.1 Return value
    2. 14.2 Usage
  15. 15 BetterStatusBar:GetValue()
    1. 15.1 Return value
    2. 15.2 Usage
  16. 16 BetterStatusBar:SetBackgroundAlpha(a)
    1. 16.1 Parameters
    2. 16.2 Usage
  17. 17 BetterStatusBar:SetBackgroundColor(br, bg, bb)
    1. 17.1 Parameters
    2. 17.2 Usage
  18. 18 BetterStatusBar:SetColor(r, g, b)
    1. 18.1 Parameters
    2. 18.2 Usage
  19. 19 BetterStatusBar:SetDeficit(deficit)
    1. 19.1 Parameters
    2. 19.2 Usage
  20. 20 BetterStatusBar:SetExtraAlpha(a)
    1. 20.1 Parameters
    2. 20.2 Usage
  21. 21 BetterStatusBar:SetExtraColor(er, eg, eb)
    1. 21.1 Parameters
    2. 21.2 Usage
  22. 22 BetterStatusBar:SetExtraValue(extraValue)
    1. 22.1 Parameters
    2. 22.2 Usage
  23. 23 BetterStatusBar:SetIcon(path)
    1. 23.1 Parameters
    2. 23.2 Usage
  24. 24 BetterStatusBar:SetIconPosition(value)
    1. 24.1 Parameters
    2. 24.2 Usage
  25. 25 BetterStatusBar:SetNormalAlpha(a)
    1. 25.1 Parameters
    2. 25.2 Usage
  26. 26 BetterStatusBar:SetOrientation(orientation)
    1. 26.1 Parameters
    2. 26.2 Usage
  27. 27 BetterStatusBar:SetReverse(reverse)
    1. 27.1 Parameters
    2. 27.2 Usage
  28. 28 BetterStatusBar:SetTexture(texture)
    1. 28.1 Parameters
    2. 28.2 Usage
  29. 29 BetterStatusBar:SetValue(value)
    1. 29.1 Parameters
    2. 29.2 Usage
  30. 30 PitBull4.Controls.MakeBetterStatusBar(parent)
    1. 30.1 Parameters
    2. 30.2 Return value
    3. 30.3 Usage

Facts

Date created
03 Jan 2009
Last updated
05 Apr 2009

Author