IMPORTANT
Status: Supported
Minimum version: 1.4
Item condition and percent display
Overview
CUIItemStateDisplay supports two basic modes: a bar and text percent display.
Modes
- Bar:
percent_displayis not set.- Uses
CUIProgressBar.
- Text:
percent_displayis enabled.- Text is configured via
percent_display:text.
Output formats
percent— a number with a percent sign.number— a number without a percent sign.fraction— a fraction usingfraction_max.portion— a part counter for stackable items.
Example
xml
<percent_display>
<background stretch="1">
<texture>ui_inv_condition_back</texture>
</background>
<text format="percent" align="c" vert_align="c" font="letterica16"/>
</percent_display>Usage
- Add the node to the desired UI element.
- Choose the
format. - If needed, set
min_color,middle_color,max_color.
Related material: item parameters, UI overview.