StatusBar

The StatusBar provides a windows style status bar control.  This Window element is an automated combination of several other window components.

Summary
StatusBarThe StatusBar provides a windows style status bar control.
Implementation DetailsThe StatusBar is a combined window element that provides a percentage bar based on min/max values.
XML DefinitionThis is the StatusBar xml definition.
XML Tag
Required AttributesYou need to specify valid values for all of these elements to get the StatusBar to create properly.
foregroundThe name of a <HorizontalResizeIMage> definition for the foregroupd ‘filled’image.
Optional AttributesThese attributes are optional, depending on the StatusBar that you are trying to create.
backgroundThe name of a <HorizontalResizeIMage> definition for the background ‘unfilled’image.
reverseFillWhen set, the bar will fill from right to left, rather than left to right.
interpolateWhen set, the bar will interpolate between value changes.
interpolaterateThe rate of interpolation if “interpolate” is set to true.
Functions
Functions
StatusBarSetCurrentValue()Sets the current value for the StatusBar.
Functions
Functions
StatusBarGetCurrentValue()Returns the the current value for the StatusBar.
StatusBarSetMaximumValue()Sets the maximum value for the StatusBar.
Functions
Functions
StatusBarGetMaximumValue()Returns the the maximum value for the StatusBar.
Functions
Functions
StatusBarStopInterpolating()Stops interpolating to a new value and applies it immediately instead.
Functions
Functions
StatusBarSetForegroundTint()Sets the color tint value for the window used as the ‘filled’ portion of the StatusBar.
Functions
Functions
StatusBarSetBackgroundTint()Sets the color tint value for the window used as the ‘unfilled’ portion of the StatusBar.

Implementation Details

The StatusBar is a combined window element that provides a percentage bar based on min/max values.

Components

The The StatusBar is a combined window element that provides a percentage bar based on min/max values. is comprised of the following components:

Values

You use a StatusBar by calling StatusBarSetMaximumValue() to set the ‘full’ value for the bar.  You can then set StatusBarSetCurrentValue() to set the amount displayed.  By default, StatusBars will immediately apply value changes.  By setting the “interpolate” property to “true,” you can change them to instead interpolate to changes over time.  To immediately apply a change to an interpolating StatusBar, call StatusBarStopInterpolating().

XML Definition

This is the StatusBar xml definition.

Summary
XML Tag
Required AttributesYou need to specify valid values for all of these elements to get the StatusBar to create properly.
foregroundThe name of a <HorizontalResizeIMage> definition for the foregroupd ‘filled’image.
Optional AttributesThese attributes are optional, depending on the StatusBar that you are trying to create.
backgroundThe name of a <HorizontalResizeIMage> definition for the background ‘unfilled’image.
reverseFillWhen set, the bar will fill from right to left, rather than left to right.
interpolateWhen set, the bar will interpolate between value changes.
interpolaterateThe rate of interpolation if “interpolate” is set to true.

XML Tag

<StatusBar>
....
</StatusBar>

Required Attributes

You need to specify valid values for all of these elements to get the StatusBar to create properly.

foreground

The name of a <HorizontalResizeIMage> definition for the foregroupd ‘filled’image.

Expects

A string value, which is the name of a valid HorizontalResizeImage.

Default Value

  • ””

Optional Attributes

These attributes are optional, depending on the StatusBar that you are trying to create.

background

The name of a <HorizontalResizeIMage> definition for the background ‘unfilled’image.

Expects

A string value, which is the name of a valid HorizontalResizeImage.

Default Value

  • ””

reverseFill

When set, the bar will fill from right to left, rather than left to right.

Expects

A boolean value.

”true”Fill right->left.
”false”Fill left->right.

Default Value

  • ”false”

interpolate

When set, the bar will interpolate between value changes.

Expects

A boolean value.

”true”Interpolates.
”false”Does not interpolate.

Default Value

  • ”false”

interpolaterate

The rate of interpolation if “interpolate” is set to true.

Expects

A float_t value specifying what percentage of the bar should fill over the course of one second.

50Fill the entire bar in 2 seconds.
100Fill the entire bar in 1 second.
200Fill the entire bar in 0.5 seconds.

Default Value

  • 150

Functions

Summary
Functions
StatusBarSetCurrentValue()Sets the current value for the StatusBar.

Functions

StatusBarSetCurrentValue()

Sets the current value for the StatusBar.

Parameters

statusBarName(string) The name of the StatusBar.
curValue(number) The value to display on the status bar.

Returns

nilno return value

Notes

  • The current value will be clamped from 0 to the max value.

Example

StatusBarSetCurrentValue( "PlayerWindowHealthBar", GameData.Player.hitPoints.current )

Functions

Summary
Functions
StatusBarGetCurrentValue()Returns the the current value for the StatusBar.
StatusBarSetMaximumValue()Sets the maximum value for the StatusBar.

Functions

StatusBarGetCurrentValue()

Returns the the current value for the StatusBar.

Parameters

statusBarName(string) The name of the StatusBar.

Returns

curValue(number) The value to display on the status bar.

Notes

  • The current value will be clamped from 0 to the max value.

Example

local playerHealth = StatusBarGetCurrentValue( "PlayerWindowHealthBar" )

StatusBarSetMaximumValue()

Sets the maximum value for the StatusBar.

Parameters

statusBarName(string) The name of the StatusBar.
maxValue(number) The max value to display on the status bar.

Returns

nilno return value

Notes

  • none

Example

StatusBarSetMaximumValue( "PlayerWindowHealthBar", GameData.Player.hitPoints.maximum )

Functions

Summary
Functions
StatusBarGetMaximumValue()Returns the the maximum value for the StatusBar.

Functions

StatusBarGetMaximumValue()

Returns the the maximum value for the StatusBar.

Parameters

statusBarName(string) The name of the StatusBar.

Returns

maxValue(number) The max value to display on the status bar.

Notes

  • The current value will be clamped from 0 to the max value.

Example

local playerMaxHealth = StatusBarGetMaximumValue( "PlayerWindowHealthBar" )

Functions

Summary
Functions
StatusBarStopInterpolating()Stops interpolating to a new value and applies it immediately instead.

Functions

StatusBarStopInterpolating()

Stops interpolating to a new value and applies it immediately instead.

Parameters

statusBarName(string) The name of the StatusBar.

Returns

nilno return value

Notes

  • Use this function to apply changes to interpolating status bars immediately, rather than interpolating to them.  For example:

StatusBarSetCurrentValue( “PlayerWindowHealthBar”, GameData.Player.hitPoints.current ) StatusBarStopInterpolating( “PlayerWindowHealthBar” )

Example

none

Functions

Summary
Functions
StatusBarSetForegroundTint()Sets the color tint value for the window used as the ‘filled’ portion of the StatusBar.

Functions

StatusBarSetForegroundTint()

Sets the color tint value for the window used as the ‘filled’ portion of the StatusBar.

Parameters

statusBarName(string) The name of the StatusBar.
red(number) The 0 to 255 hue value for red tint level.
green(number) The 0 to 255 hue value for green tint level.
blue(number) The 0 to 255 hue value for blue tint level.

Returns

nilno return value, regardless of success or failure

Notes

  • The current value will be clamped from 0 to the max value.

Example

StatusBarSetForegroundTint( "PlayerWindowHealthBar", 234, 54, 45 )

Functions

Summary
Functions
StatusBarSetBackgroundTint()Sets the color tint value for the window used as the ‘unfilled’ portion of the StatusBar.

Functions

StatusBarSetBackgroundTint()

Sets the color tint value for the window used as the ‘unfilled’ portion of the StatusBar.

Parameters

statusBarName(string) The name of the StatusBar.
red(number) The 0 to 255 hue value for red tint level.
green(number) The 0 to 255 hue value for green tint level.
blue(number) The 0 to 255 hue value for blue tint level.

Returns

nilno return value, regardless of success or failure

Notes

  • The current value will be clamped from 0 to the max value.

Example

StatusBarSetBackgroundTint( "PlayerWindowHealthBar", 234, 54, 45 )
The HorizontalResizeImage allows you to create an image that will automatically resize to fit a window of any width.
Sets the maximum value for the StatusBar.
Sets the current value for the StatusBar.
Stops interpolating to a new value and applies it immediately instead.