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)



Comments

Posts Quoted:
Reply
Clear All Quotes