PitBull Unit Frames 4.0

API / Controls / BetterStatusBar

BetterStatusBar:GetAnimDuration()

Get the duration of the animation and/or fade effects.

Return value

duration of the animation effects.

Usage

local duration = bar:GetAnimDuration()


BetterStatusBar:GetAnimated()

Get whether the bar updates are animated

Return value

whether the bar is animating updates

Usage

(assert(bar:GetAnimated() == true))


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:GetExtra2Alpha()

Get the alpha value of the bar's extra2 portion

Return value

the alpha value [0, 1]

Usage

local alpha = bar:SetExtra2Alpha()


BetterStatusBar:GetExtra2Color()

Get the extra2 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:GetExtra2Color()


BetterStatusBar:GetExtra2Value2()

Return the extra value

Return value

the extra value

Usage

assert(bar:GetExtraValue() == 0.25)


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:GetFade()

Get whether the bar updates will be faded in/out.

Return value

whether the bar is fading on update

Usage

(assert(bar:GetFade() == true))


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:SetAnimDuration(anim_duration)

Set the duration of the animation and/or fade effects.

Parameters

anim_duration
the time that the animation effect takes to play.

Usage

bar:SetAnimDuration(0.5)


BetterStatusBar:SetAnimated(animated)

Set whether the bar updates are animated If set to true bar updates will be animated

Parameters

animated
whether the bar updates are animated

Usage

bar:SetAnimated(true)


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, extra or extra2 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:SetExtra2Alpha(a)

Set the alpha value of the bar's extra2 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:SetExtra2Alpha(0.7)
bar:SetExtra2Alpha()


BetterStatusBar:SetExtra2Color(er, eg, eb)

Set the extra2 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:SetExtra2Color(0.8, 0.6, 0)
bar:SetExtra2Color()


BetterStatusBar:SetExtra2Value(extra2Value)

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

extra2Value

Usage

bar:SetExtraValue(0.25)


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:SetFade(fade)

Set whether the bar updates will be fadded in/out.
If set to true he updated portions of the bar will be faded in/out.

Parameters

fade
whether bar updates will be faded in/out.

Usage

bar:SetFade(true)


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, extra, extra2 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:GetAnimDuration()
    1. 1.1 Return value
    2. 1.2 Usage
  2. 2 BetterStatusBar:GetAnimated()
    1. 2.1 Return value
    2. 2.2 Usage
  3. 3 BetterStatusBar:GetBackgroundAlpha()
    1. 3.1 Return value
    2. 3.2 Usage
  4. 4 BetterStatusBar:GetBackgroundColor()
    1. 4.1 Return values
    2. 4.2 Usage
  5. 5 BetterStatusBar:GetColor()
    1. 5.1 Return values
    2. 5.2 Usage
  6. 6 BetterStatusBar:GetDeficit()
    1. 6.1 Return value
    2. 6.2 Usage
  7. 7 BetterStatusBar:GetExtra2Alpha()
    1. 7.1 Return value
    2. 7.2 Usage
  8. 8 BetterStatusBar:GetExtra2Color()
    1. 8.1 Return values
    2. 8.2 Usage
  9. 9 BetterStatusBar:GetExtra2Value2()
    1. 9.1 Return value
    2. 9.2 Usage
  10. 10 BetterStatusBar:GetExtraAlpha()
    1. 10.1 Return value
    2. 10.2 Usage
  11. 11 BetterStatusBar:GetExtraColor()
    1. 11.1 Return values
    2. 11.2 Usage
  12. 12 BetterStatusBar:GetExtraValue()
    1. 12.1 Return value
    2. 12.2 Usage
  13. 13 BetterStatusBar:GetFade()
    1. 13.1 Return value
    2. 13.2 Usage
  14. 14 BetterStatusBar:GetIcon()
    1. 14.1 Return value
    2. 14.2 Usage
  15. 15 BetterStatusBar:GetIconPosition()
    1. 15.1 Return value
    2. 15.2 Usage
  16. 16 BetterStatusBar:GetMinMaxValues()
    1. 16.1 Return values
    2. 16.2 Usage
  17. 17 BetterStatusBar:GetNormalAlpha()
    1. 17.1 Return value
    2. 17.2 Usage
  18. 18 BetterStatusBar:GetOrientation()
    1. 18.1 Return value
    2. 18.2 Usage
  19. 19 BetterStatusBar:GetReverse()
    1. 19.1 Return value
    2. 19.2 Usage
  20. 20 BetterStatusBar:GetTexture()
    1. 20.1 Return value
    2. 20.2 Usage
  21. 21 BetterStatusBar:GetValue()
    1. 21.1 Return value
    2. 21.2 Usage
  22. 22 BetterStatusBar:SetAnimDuration(anim_duration)
    1. 22.1 Parameters
    2. 22.2 Usage
  23. 23 BetterStatusBar:SetAnimated(animated)
    1. 23.1 Parameters
    2. 23.2 Usage
  24. 24 BetterStatusBar:SetBackgroundAlpha(a)
    1. 24.1 Parameters
    2. 24.2 Usage
  25. 25 BetterStatusBar:SetBackgroundColor(br, bg, bb)
    1. 25.1 Parameters
    2. 25.2 Usage
  26. 26 BetterStatusBar:SetColor(r, g, b)
    1. 26.1 Parameters
    2. 26.2 Usage
  27. 27 BetterStatusBar:SetDeficit(deficit)
    1. 27.1 Parameters
    2. 27.2 Usage
  28. 28 BetterStatusBar:SetExtra2Alpha(a)
    1. 28.1 Parameters
    2. 28.2 Usage
  29. 29 BetterStatusBar:SetExtra2Color(er, eg, eb)
    1. 29.1 Parameters
    2. 29.2 Usage
  30. 30 BetterStatusBar:SetExtra2Value(extra2Value)
    1. 30.1 Parameters
    2. 30.2 Usage
  31. 31 BetterStatusBar:SetExtraAlpha(a)
    1. 31.1 Parameters
    2. 31.2 Usage
  32. 32 BetterStatusBar:SetExtraColor(er, eg, eb)
    1. 32.1 Parameters
    2. 32.2 Usage
  33. 33 BetterStatusBar:SetExtraValue(extraValue)
    1. 33.1 Parameters
    2. 33.2 Usage
  34. 34 BetterStatusBar:SetFade(fade)
    1. 34.1 Parameters
    2. 34.2 Usage
  35. 35 BetterStatusBar:SetIcon(path)
    1. 35.1 Parameters
    2. 35.2 Usage
  36. 36 BetterStatusBar:SetIconPosition(value)
    1. 36.1 Parameters
    2. 36.2 Usage
  37. 37 BetterStatusBar:SetNormalAlpha(a)
    1. 37.1 Parameters
    2. 37.2 Usage
  38. 38 BetterStatusBar:SetOrientation(orientation)
    1. 38.1 Parameters
    2. 38.2 Usage
  39. 39 BetterStatusBar:SetReverse(reverse)
    1. 39.1 Parameters
    2. 39.2 Usage
  40. 40 BetterStatusBar:SetTexture(texture)
    1. 40.1 Parameters
    2. 40.2 Usage
  41. 41 BetterStatusBar:SetValue(value)
    1. 41.1 Parameters
    2. 41.2 Usage
  42. 42 PitBull4.Controls.MakeBetterStatusBar(parent)
    1. 42.1 Parameters
    2. 42.2 Return value
    3. 42.3 Usage

Facts

Date created
Jan 03, 2009
Last updated
Sep 16, 2013

Author