StatusBars are similar to Sliders, but they are generally used for display as they don't offer any tools to receive user input. You define them with a bar texture and an optional color, and they fill a portion of their area in a given direction with that texture according to their value.
StatusBars can be oriented to fill from left to right (HORIZONTAL
) or from bottom to top (VERTICAL
). If you need to share the same bar texture between horizontal and vertical bars, they offer support for rotating the texture automatically to match. Presently, the StatusBar object does not support right-to-left or top-to-bottom bars.
StatusBars also offer an OnValueChanged handler to update information associated with the bar, such as updating a FontString that displays the bar's value as a number.
The most famous StatusBars in the stock UI are the bars that show your health and mana, and those of your group members and target.
Defined Methods
- StatusBar:GetStatusBarAtlas() - This function is not yet documented
- StatusBar:SetStatusBarAtlas() - This function is not yet documented
- StatusBar:SetStatusBarColor(red, green, blue [, alpha]) - Sets the color shading for the status bar's texture
- StatusBar:SetStatusBarTexture(texture [, "layer"]) or StatusBar:SetStatusBarTexture("filename" [, "layer"]) - Sets the texture used for drawing the filled-in portion of the status bar
- StatusBar:SetValue(value) - Sets the value of the status bar
Inherited Methods
- StatusBar:GetPropagateKeyboardInput() - This function is not yet documented
- StatusBar:IsForbidden() - This function is not yet documented
- StatusBar:RegisterUnitEvent() - This function is not yet documented
- StatusBar:SetDontSavePosition() - This function is not yet documented
- StatusBar:SetPropagateKeyboardInput() - This function is not yet documented
- StatusBar:SetShown() - This function is not yet documented
- StatusBar:SetSize(width, height) - Sets the size of the region to the specified values
- StatusBar:SetToplevel(enable) - Sets whether the frame should automatically come to the front when clicked
- StatusBar:SetUserPlaced(enable) - Flags the frame for automatic saving and restoration of position and dimensions
- StatusBar:SetWidth(width) - Sets the region's width
- StatusBar:Show() - Shows the region
- StatusBar:StartMoving() - Begins repositioning the frame via mouse movement
- StatusBar:StartSizing() - Begins resizing the frame via mouse movement
- StatusBar:StopAnimating() - Stops any active animations involving the region or its children
- StatusBar:StopMovingOrSizing() - Ends movement or resizing of the frame initiated with [[docs/widgets/Frame/StartMoving|`:StartMoving()`]] or [[docs/widgets/Frame/StartSizing|`:StartSizing()`]]
- StatusBar:UnregisterAllEvents() - Unregisters the frame from any [[docs/events|events]] for which it is registered
- StatusBar:UnregisterEvent("event") - Unregisters the frame for an event
Script Handlers
- OnAttributeChanged(self, "name", value) - Run when a frame attribute is changed
- OnChar(self, "text") - Run for each text character typed in the frame
- OnDisable(self) - Run when the frame is disabled
- OnDragStart(self, "button") - Run when the mouse is dragged starting in the frame
- OnDragStop(self) - Run when the mouse button is released after a drag started in the frame
- OnEnable(self) - Run when the frame is enabled
- OnEnter(self, motion) - Run when the mouse cursor enters the frame's interactive area
- OnEvent(self, "event", ...) - Run whenever an [[docs/events|event]] fires for which the frame is registered
- OnHide(self) - Run when the frame's visbility changes to hidden
- OnKeyDown(self, "key") - Run when a keyboard key is pressed if the frame is keyboard enabled
- OnKeyUp(self, "key") - Run when a keyboard key is released if the frame is keyboard enabled
- OnLeave(self, motion) - Run when the mouse cursor leaves the frame's interactive area
- OnLoad(self) - Run when the frame is created
- OnMinMaxChanged(self, min, max) - Run when the slider's or status bar's minimum and maximum values change
- OnMouseDown(self, "button") - Run when a mouse button is pressed while the cursor is over the frame
- OnMouseUp(self, "button") - Run when the mouse button is released following a mouse down action in the frame
- OnMouseWheel(self, delta) - Run when the frame receives a mouse wheel scrolling action
- OnReceiveDrag(self) - Run when the mouse button is released after dragging into the frame
- OnShow(self) - Run when the frame becomes visible
- OnSizeChanged(self, width, height) - Run when a frame's size changes
- OnUpdate(self, elapsed) - Run each time the screen is drawn by the game engine
- OnValueChanged(self, value) - Run when the slider's or status bar's value changes