Skip to content

Search

ドキュメント

widget_range

The rows a slider, number_field or progress_bar reads: where it stands in its range, how it moves and how it is drawn.

このページの内容

ui · 21 properties · UI

The rows a slider, number_field or progress_bar reads: where it stands in its range, how it moves and how it is drawn.

In a scene, widget_range is the node key that applies it. A script reaches each property below as a field on node.widget_range: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.widget_range.get() and node.widget_range.set(table).

Properties

property type default description
animate bool false Shimmer a progress_bar that is short of full, with a spinner at its end unless it states a corner_radius. It repaints every frame while it is on screen and short of full, and never otherwise
arrows bool false Draw a step up and a step down beside a number_field, each moving it by step within min and max
clamp enum always Whether a slider holds its number inside min and max: always, one the scene set outside them included; edits, only what the reader enters; never, only the track One of always, edits, never.
clamp_existing bool false Pull a number_field's number back inside min and max where the scene set it outside them; off, it is shown as set and only an edit is bounded
decimals int -1 How many decimals a slider's or number_field's number shows; below zero lets egui decide
drag_speed float 0 How far a number_field, or a slider's shown number, moves per design pixel dragged; 0 takes egui's, which is 1 on a number field and scales with the range on a slider At least 0.
handle enum circle A slider's handle: a circle, or a rect handle_aspect times as wide as the track is tall One of circle, rect.
handle_aspect float 0.5 How wide a rect handle is against its height At least 0.
largest_finite float 0 The largest number a logarithmic slider reaches short of an unbounded end; 0 is no limit At least 0.
logarithmic bool false Space a slider's track logarithmically, for a range across orders of magnitude
max float 1 The high end of a slider or progress_bar; a number_field runs free while this pair is the default 0 and 1
min float 0 The low end of a slider or progress_bar; a number_field runs free while this pair is the default 0 and 1
number_format enum decimal The base a slider or number_field writes its number in; the others than decimal write it whole One of decimal, binary, octal, hex.
show_percentage bool false Draw a progress_bar's fill as a percentage on it, in place of its text
show_value bool false Draw a slider's number beside its track, for the reader to drag or type into
smallest_positive float 0 The smallest number above zero a logarithmic slider reaches, for a range that starts at or crosses zero; 0 takes egui's millionth At least 0.
smart_aim bool true Round a dragged slider to the simplest number near the pointer
step float 0 The grid a slider snaps to, and how far a number_field's arrows move it; 0 is continuous, and 1 for the arrows At least 0.
trailing_fill bool false Fill a slider's track from its start up to the handle
update_while_editing bool true Write a slider's or number_field's number as the reader types it; off, only once the typing is left
value float 0 Where a slider, number_field or progress_bar stands, between min and max; a slider and a drag value write it and call on_change with it