widget component
A HUD element drawn every frame: kind picks label, button, panel and more, anchor places it in design pixels. A button sets clicked and calls on_click.
ในหน้านี้
ui · 223 properties · UI
A HUD element drawn every frame: kind picks label, button, panel and more, anchor places it in design pixels. A button sets clicked and calls on_click.
In a scene, widget is the node key that applies it. A script reaches each property below as a field on node.widget: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.widget.get() and node.widget.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
absolute |
bool | false |
Take this child out of its container's run and place it by inset against the container's box inside its border, drawn in its turn among its siblings; a root ignores it |
align_content |
enum | stretch |
How a container that wraps spreads its lines across its direction, and a grid its rows, where they leave room: stretch shares the room among them One of start, center, end, stretch, between, around, evenly. |
align_items |
enum | stretch |
Where a container puts its children across its own direction, and a grid each child in its cell down: stretch makes each as wide (or tall) as the container, baseline lines up their first lines of text, the others keep each child's own size One of start, center, end, stretch, baseline. |
align_self |
enum | auto |
Where this child sits across its container's direction; auto takes the container's align_items One of auto, start, center, end, stretch, baseline. |
alpha |
enum | blend |
What a color_picker offers for alpha: none keeps the colour opaque, blend offers transparency, additive that and additive blending One of none, blend, additive. |
alt_text |
string | — | Text an image draws in place of a picture that will not load |
anchor |
enum | top_left |
Corner, edge or middle the offset is measured from: of the surface for a root, of the parent's box inside a stack; fill takes the whole of it less inset One of top_left, top_right, bottom_left, bottom_right, center, center_left, center_right, center_top, center_bottom, fill, fill_top, fill_bottom, fill_left, fill_right, fill_across, fill_down. |
angle_degrees |
float | 0 |
How far an image is turned clockwise about angle_origin, in degrees; a turned image keeps square corners |
angle_origin |
vec2 | [0.5,0.5] |
The point an image turns about, as fractions of its box from the top left: [0.5, 0.5] is its middle |
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 |
animated |
bool | true |
Ease a scroll, list, tree or table to where it is sent, such as a row scrolled into view, rather than jump |
areas |
list | [] |
A grid's named areas, one string a row of space-separated names with . for a cell in none: ["head head", "side main"]. A child names one in row and column |
arrows |
bool | false |
Draw a step up and a step down beside a number_field, each moving it by step within min and max |
aspect_ratio |
float | 0 |
Width over height, kept where the layout decides only one of them; 0 keeps none At least 0. |
auto_columns |
string | — | The size of each column a grid adds past grid_columns, for a child placed beyond them or flowing down under auto_flow = "column", in the words grid_columns takes without repeat; several take turns. Empty is auto |
auto_flow |
enum | row |
The order a grid fills cells with the children that name none: along each row, or down each column; a _dense order goes back to fill a hole a bigger child left One of row, column, row_dense, column_dense. |
auto_rows |
string | — | The size of each row a grid adds past grid_rows, in the words auto_columns takes; empty is auto |
avoid_keyboard |
bool | false |
On a root: measure the bottom of the surface from the top of the on-screen keyboard, so a form or a chat bar stays above it; nothing on a desktop |
axis |
enum | both |
Which way a scroll moves, the other way its contents filling the box it was given. A slider runs up its box under vertical, and a separator draws the line it names, both leaving it across its parent's direction One of both, horizontal, vertical. |
backdrop_color |
color | [0,0,0,0.549] |
What a dialog dims the screen behind it with |
basis |
float | -1 |
The size this child starts from along its container's direction, before grow and shrink, in design pixels; below zero is 0 for one that grows and its own size otherwise |
bitmap_font |
string | — | A project-relative AngelCode .fnt naming a bitmap face for a shaped label or caption; empty shapes with the project's vector fonts |
border |
vec4 | [0,0,0,0] |
The width of this widget's outline on each side, left, top, right and bottom, in design pixels: the layout keeps it clear inside the edge as it keeps padding, and the stroke is painted in exactly that band. All zero leaves the stroke at the theme's stroke_width, over the padding |
box_sizing |
enum | border |
What width and height measure: border, the whole box, or content, the box inside padding and border One of border, content. |
breakpoints |
list | [] |
The lines a code widget dots in its gutter, counting from 1; whole numbers or the text of them. A click on the gutter reports its line through on_gutter and the script decides what the mark means |
caret_at_end |
bool | true |
Put the caret at the end of a text_field, text_area or code's text when it first takes focus; off, at the start |
checked |
bool | false |
Whether a checkbox is ticked, every click flipping it and calling on_change with the new state; a checked button is held down, wearing its pressed look |
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 |
clicked |
bool | false |
True on the frame the button was clicked Read-only: engine output the inspector shows but never writes. |
clip_text |
bool | true |
Cut a text_field's text at its edge; off, the field grows to show it whole |
closable |
bool | true |
Draw a window's cross; ui.window takes it too |
close_on |
enum | click_outside |
What shuts a menu's popup besides a row: a click outside it, any click at all, or nothing but Escape One of click_outside, click, never. |
collapsible |
bool | false |
Give a window's title bar an arrow that folds the window to its bar and back; ui.window takes it too |
column |
string | — | On a grid's child: the columns it covers, in the words row takes |
constrain |
bool | false |
Keep a movable root inside its surface while it is dragged; ui.window takes it too |
contain |
flags | [] |
Containment: layout or paint makes the box lay out on its own, and layout also gives it no baseline for a parent's baseline alignment One of layout, paint. |
context |
string | — | Name of a menu node whose rows open at the pointer on a right click or a long press; give that menu visible = false to show no button of its own |
corner_radius |
float | -1 |
Corner radius in design pixels, a progress_bar's and an image's included; below zero takes the theme's own, which for a button is as round as its text is tall |
current_line |
int | 0 |
The line a code widget fills across its whole width, counting from 1, for the row a debugger is stopped on; 0 fills none At least 0. |
current_page |
string | — | Which child a tabs shows, by node name; empty shows the first. A click on the strip writes it and calls on_change with the page's name |
cursor |
enum | arrow |
The pointer's shape while it is over the widget: hand over anything that opens on a click, none to hide it; arrow is the platform's own One of arrow, none, hand, text, vertical_text, cross, cell, wait, progress, help, context_menu, move, grab, grabbing, alias, copy, no_drop, forbidden, all_scroll, resize_x, resize_y, resize_n, resize_e, resize_s, resize_w, resize_ne, resize_nw, resize_se, resize_sw, resize_nesw, resize_nwse, resize_col, resize_row, zoom_in, zoom_out. |
decimals |
int | -1 |
How many decimals a slider's or number_field's number shows; below zero lets egui decide |
default_open |
bool | true |
Whether a collapsible window starts unfolded; ui.window takes it too |
direction |
enum | left_to_right |
Which way a row and a grid's columns run: right_to_left starts them at the right edge One of left_to_right, right_to_left. |
dismissable |
bool | true |
Let Escape or a click on the dim shut a dialog; off, only the scene does |
drag_cursor |
enum | arrow |
The pointer's shape while a drag scrolls a scroll, list, tree or table's content; arrow leaves it as it is One of arrow, none, hand, text, vertical_text, cross, cell, wait, progress, help, context_menu, move, grab, grabbing, alias, copy, no_drop, forbidden, all_scroll, resize_x, resize_y, resize_n, resize_e, resize_s, resize_w, resize_ne, resize_nw, resize_se, resize_sw, resize_nesw, resize_nwse, resize_col, resize_row, zoom_in, zoom_out. |
drag_scroll |
enum | touch |
When dragging a scroll, list, tree or table's content scrolls it: on a touch screen, always, or never; a scroll_deadzone takes the drag over itself One of touch, always, never. |
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. |
draggable |
bool | false |
Let a drag carry a card of a list with grid_columns out of it, drawn under the pointer; on_drop says where it was let go |
draw |
string | — | What fills a draw widget: a script method on this node or the nearest scripted ancestor, or scripts/file.rn:function for a free function |
duration |
float | 3 |
How long a toast stays, in seconds, counting the half second it fades over; zero leaves it up until the game takes it away At least 0. |
editable |
bool | true |
Let the reader change a text_field, text_area or code's text; off, it can be neither edited nor selected |
enabled |
bool | true |
Off, the widget is greyed out and swallows its clicks |
fade_in |
bool | false |
Fade a root in as it appears, over egui's fade time |
fill |
string | — | What is painted behind this widget, an image's picture included, as #rrggbb or a name from the theme's [colors]; empty takes the theme's own |
fit |
enum | — | How an image sits in the box it was given: contain and cover keep its shape, fill stretches, none leaves it its own size, centred. Empty lets the picture decide the box instead One of ``, contain, `cover`, `fill`, `none`. |
focusable |
bool | true |
Let focus land here. A widget nothing can activate is never focused whatever this says; set it false to skip one that could be |
font_family |
enum | ui |
Which of the theme's families the widget draws in One of ui, mono, heading, icon. |
font_features |
list | [] |
OpenType features: smcp turns one on, liga=0 turns one off |
font_name |
string | — | A face by family name, tried before the chain |
font_size |
float | 0 |
Text size in design pixels; 0 takes the size the role or the kind carries At least 0. |
font_stretch |
enum | normal |
How wide a face is picked among the faces its family ships One of ultra_condensed, extra_condensed, condensed, semi_condensed, normal, semi_expanded, expanded, extra_expanded, ultra_expanded. |
font_style |
enum | normal |
Upright, the family's italic face, or the upright face slanted; a family with no italic is slanted either way One of normal, italic, oblique. |
font_weight |
float | 400 |
Weight on the CSS scale, resolved against the faces the project ships: 400 regular, 700 bold Range 100–900. |
gap |
vec2 | [-1,-1] |
Space between a container's children, across and down, in design pixels: a row puts the first between its children and the second between the lines it wraps onto, a column the second between its children, and a grid the first between its columns and the second between its rows. On a button the first is the space between its picture, icon and caption. Below zero on an axis takes the theme's own, which is 8 where it says nothing and half the font size on a button, and a stated zero puts them edge to edge |
grid_columns |
string | — | A grid's columns, left to right and space-separated: design pixels (120), a share of what is left (1fr), a percentage (25%), auto, min_content, max_content, fit_content(120), minmax(80, 1fr), and repeat(3, 1fr), whose count may be auto_fill or auto_fit. Empty is two equal columns. A list flows its cards into as many columns as this names, and draws a line a row where it is empty; a table's columns are its titles |
grid_rows |
string | — | A grid's rows, top to bottom, in the words grid_columns takes; empty makes each row as tall as what is in it |
group |
string | — | A name this checkbox or toggle button shares with the ones it is exclusive with: ticking one unticks the rest, and one already ticked stays ticked. Empty leaves it flipping on its own |
grow |
float | 0 |
Share of the leftover space a container hands out along its own direction; 0 takes only what this widget asks for At least 0. |
gutter_width |
float | 0 |
How wide a code widget's gutter is, in design pixels; 0 takes the built-in width, which holds four digits 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. |
header |
bool | true |
Draw the strip that names a table's columns, and a window's title bar. Off, a table's columns are still titles', and a table that names none keeps its first row as a row; ui.window takes it too |
height |
float | 0 |
Panel height in design pixels; 0 sizes to content At least 0. |
height_percent |
float | 0 |
Height as a percentage of the container's box inside its padding; 0 leaves it to height, which a stated percentage wins over At least 0. |
hide_narrower |
float | 0 |
Not drawn while the room is narrower than this many design pixels. The room is the nearest container that states a size or grows, and the screen for a root: a minimum in numbers, where the class words are not fine enough. Zero is no line At least 0. |
hide_on_close |
bool | true |
Whether a window's close button shuts it; off, the button only emits close_request and the script decides |
hide_shorter |
float | 0 |
Not drawn while the room is shorter than this many design pixels. Zero is no line At least 0. |
hide_taller |
float | 0 |
Not drawn while the room is this tall or taller, in design pixels. Zero is no line At least 0. |
hide_wider |
float | 0 |
Not drawn while the room is this wide or wider, in design pixels: a control only a small space wants. Zero is no line At least 0. |
hinting |
enum | auto |
Snap outlines to the pixel grid; auto takes the face's import setting One of auto, on, off. |
icon |
string | — | A glyph from the theme's icon family, drawn before text |
icon_color |
string | — | What that glyph is tinted with, as #rrggbb or a name from the theme's [colors]; empty takes the role's own |
icon_size |
float | -1 |
That glyph's size in design pixels; below zero takes the caption's |
image |
string | — | The project-relative image an image widget draws, or the picture a button draws before its caption at the caption's height |
indeterminate |
bool | false |
Draw a checkbox as neither ticked nor clear, for a group whose members disagree; a click still flips checked |
inline |
bool | false |
Draw a color_picker's picker in place, rather than behind a swatch that opens it |
inset |
vec4 | [0,0,0,0] |
Left, top, right and bottom margins a root with anchor = "fill" keeps from its surface, and how far an absolute child sits in from each edge of its container inside its border, where a side below zero is left free; in design pixels |
interactive |
bool | true |
Off, the pointer passes through to the scene: the widget is drawn, never hovered or clicked, and ui.wants_pointer() stays false over it. A full-screen container over the world wants this |
justify |
enum | start |
How a container spreads its children along its own direction once they have their sizes, and a grid its columns: stretch grows a grid's auto columns into the room, and in a row or a column is start One of start, center, end, stretch, between, around, evenly. |
keep_open |
bool | false |
A menu row that leaves its menu open when clicked, as a toggle does; any other row closes it. A dropdown with it stays open past a pick until a click outside it |
kind |
enum | label |
The HUD element the widget layer draws One of label, button, panel, row, column, scroll, tabs, draw, image, text_field, text_area, checkbox, switch, color_picker, dropdown, menu, list, tree, table, slider, number_field, progress_bar, grid, flow, fold, dialog, toast, window, separator, code, stack. |
language |
string | — | The language a code widget highlights |
largest_finite |
float | 0 |
The largest number a logarithmic slider reaches short of an unbounded end; 0 is no limit At least 0. |
layer |
string | — | The drawing surface this root belongs to; empty is the default one, and a name nothing has configured takes the default surface |
letter_spacing |
float | 0 |
Extra space between glyphs, in the caption's pixels |
line_break |
enum | word_or_glyph |
Where a wrapped line may break One of word_or_glyph, word, glyph. |
line_height |
float | 0 |
Baseline to baseline as a multiple of the size; zero takes the default At least 0. |
list_height |
float | 0 |
The tallest a dropdown's list grows before it scrolls, in design pixels; 0 takes egui's At least 0. |
logarithmic |
bool | false |
Space a slider's track logarithmically, for a range across orders of magnitude |
margin |
vec4 | [0,0,0,0] |
Space outside this widget's edge that its container keeps clear, left, top, right and bottom, in design pixels; below zero lets a neighbour over it |
markup |
bool | false |
Read inline marks in the text: [b], [i], [color=#hex], [center], [right], [wave amp=N freq=N] and [img=path width=N]; off, brackets are text |
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 |
max_height |
float | 0 |
Largest height a container may give this widget, and a resizable window be dragged to, in design pixels; 0 is no limit At least 0. |
max_length |
float | 0 |
The most characters a text_field takes; 0 is no limit At least 0. |
max_lines |
int | 0 |
The most lines a wrapped label keeps; zero keeps every line At least 0. |
max_width |
float | 0 |
Largest width a container may give this widget, and a resizable window be dragged to, in design pixels; 0 is no limit At least 0. |
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 |
min_height |
float | 0 |
Smallest height a container may give this widget, and a resizable window be dragged to, in design pixels At least 0. |
min_lines |
int | 1 |
How many lines a wrapping container divides its children between at least: balance evens them over this many, and any wrap shares a known cross size among them At least 1. |
min_scrolled_height |
float | 0 |
The shortest a scroll, list, tree or table draws while its content runs past it downwards, in design pixels; 0 takes egui's At least 0. |
min_scrolled_width |
float | 0 |
The narrowest a scroll, list, tree or table draws while its content runs past it sideways, in design pixels; 0 takes egui's At least 0. |
min_width |
float | 0 |
Smallest width a container may give this widget, and a resizable window be dragged to, in design pixels At least 0. |
monospace_width |
float | 0 |
Pixels a monospace face's advance is set to; zero keeps its own At least 0. |
movable |
bool | false |
Let a drag move this root and write its x and y: a window by its title bar, any other root by its whole box where no child takes the press; ui.window takes it too, on by default there |
multi_select |
bool | false |
Let a list, tree or table hold more than one row: the platform's command key toggles a row and shift takes the run from the last one clicked |
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. |
numeric |
bool | false |
Keep a text_field to digits, a sign and a point |
on_change |
string | — | Script method called with a text_field's text after every edit, on this node or the nearest ancestor whose script declares it |
on_click |
string | — | Script method called when the widget is clicked, on this node or the nearest ancestor whose script declares it. An image that names one senses clicks too, which is how a picture becomes a button |
on_drop |
string | — | Script method called with the card a drag let go outside the list, on this node or the nearest ancestor whose script declares it; the pointer is where it landed |
on_focus |
string | — | Script method called when focus arrives, on this node or the nearest ancestor whose script declares it |
on_gutter |
string | — | Script method called with the line a click on a code widget's gutter landed on, on this node or the nearest ancestor whose script declares it |
on_link |
string | — | Script method called with the target of a [url=target] span in markup text that was clicked, on this node or the nearest ancestor whose script declares it |
on_mark |
string | — | Script method called with #{ row, mark } when a mark at the right of a list or tree row is clicked, on this node or the nearest ancestor whose script declares it. The click picks nothing |
on_move |
string | — | Script method called when a dragged row is dropped, with the row moved, the row it landed on, and before, after or into, on this node or the nearest ancestor whose script declares it |
on_submit |
string | — | Script method called with a text_field's text on Enter, or when focus leaves it, on this node or the nearest ancestor whose script declares it |
open |
bool | true |
Whether a fold shows its children; its header flips it and calls on_change with the new state |
options |
list | [] |
The items a dropdown, menu, list, tree or table holds; text is the one picked, except on a menu where it is the button caption. A tree row starts with one tab per level, a list or tree row splits on U+001F into icon, label, a trailing note, an #rrggbb for that row, a key that is never drawn, which two rows with the same label need to stay two rows, and marks, each name=glyph from the icon face and joined on U+001E, drawn at the right and reported by on_mark; and a table row splits on the same into one cell a column. on_change hears every pick |
outline_color |
color | [0,0,0,1] |
The outline's colour |
outline_size |
float | 0 |
Pixels the outline reaches round a shaped label's glyphs; zero draws none At least 0. |
overflow |
enum | visible |
What the layout keeps for content past this widget's box: scroll keeps scrollbar_width clear inside its edge, the others nothing. Layout only: a container never gives a child a floor of its own content here (min_width is that floor), a scroll kind is what scrolls, and each kind clips as it draws One of visible, clip, hidden, scroll. |
overhang |
float | 0 |
How far a separator's line runs past each end of the room it was given, in design pixels; below zero stops it short |
overline |
bool | false |
A line over a shaped label's text; egui's own kinds have none |
overline_color |
color | [0,0,0,0] |
The overline's colour; alpha 0 takes the glyphs' own |
padding |
vec4 | [-1,-1,-1,-1] |
Space inside the widget's edge, in design pixels: one number for every side, or left, top, right and bottom. A container keeps it round its children, a button and a label round their text, and every other kind in its box. A side below zero takes the theme's (padding_x across and padding_y down, else padding), else 8 round a panel, 12 either side of a button's or menu's caption and 0 elsewhere; a stated zero is no space at all. On a text_field, text_area or code it is the margin round the text, where below zero takes egui's |
pass_node |
bool | false |
Hand every handler this widget calls its own node as the last argument, so one method can serve many widgets |
picked_color |
color | [1,1,1,1] |
What a color_picker holds; on_change hears the new one |
pixel_snap |
bool | false |
Rasterise on whole pixels, for a pixel face |
placeholder |
string | — | What a text_field or text_area shows while it is empty |
placement |
enum | below |
Where a menu opens: under its button, above it, to its right or to its left, each from the side's start (below starts at the button's left edge, right at its top) or at _center or _end; at the pointer; or centred on the screen One of below, below_center, below_end, above, above_center, above_end, right, right_center, right_end, left, left_center, left_end, pointer, center. |
placement_fallbacks |
list | [] |
The placements a menu's popup tries, in order, where its own does not fit the screen; empty tries egui's, and naming the placement alone keeps it where it is |
popup_gap |
float | -1 |
The space between a menu's button and its popup, in design pixels; below zero takes egui's |
popup_width |
float | 0 |
How wide a menu's popup starts, in design pixels; 0 sizes it to its rows At least 0. |
prefix |
string | — | Text drawn before a number_field's or a shown slider's number with a space between, and before a text_field's or text_area's text |
problems |
list | [] |
The lines a code widget underlines as errors, counting from 1, each also marked on the inner edge of its gutter |
region |
vec4 | [0,0,0,0] |
The part of an image drawn, as left, top, width and height in the picture's own pixels, which is how an atlas shows one tile; a zero width or height draws the whole picture. ui.image takes it too |
reorderable |
bool | false |
Let a drag move a row of a list or a tree. The kind moves nothing itself: it draws where the row would land and calls on_move, and the rows are the script's to reorder |
resizable |
bool | false |
Give a window a grip in its bottom-right corner that a drag resizes it by, writing width and height within min_width, min_height, max_width and max_height; ui.window takes it too, on by default there |
reverse |
bool | false |
Take a table's rows the other way round: the sort descending, or the order they were given bottom to top where none is named. A row, column or flow lays its children out from its far end |
role |
string | — | A [roles.<name>] entry of the widget's theme, taken over its kind's own style; the one place a look is named rather than spelled |
row |
string | — | On a grid's child: the rows it covers, as a line counted from 1 (2, or from the end below zero), a first and last line (1 / 3), a span (span 2, 2 / span 2), or the name of one of the grid's areas. Empty puts it in the next free cell |
row_height |
float | 0 |
The pitch of a list or tree row, in design pixels; 0 takes the font's own line height At least 0. |
safe_align |
bool | false |
Where align_items, align_self, align_content or justify would push a child past its container's start, put it at the start instead, so the start stays in view |
safe_area |
flags | [] |
The edges this root keeps clear of what a notch, a status bar or a home bar covers. Empty by default: a backdrop is meant to reach the edge and a control is not, and a screen often wants content above the notch and its background under the gesture bar One of left, top, right, bottom. |
scroll_deadzone |
float | 0 |
How far a finger drags a scroll before it scrolls, in design pixels, so a tap on a child still lands; 0 scrolls at once At least 0. |
scroll_offset |
vec2 | [-1,-1] |
Where a scroll, list, tree or table is scrolled to, across and down, in design pixels: written as the reader scrolls, and a new one written by the scene or a script scrolls it there. Below zero on an axis leaves that axis where it is; ui.scroll takes it too |
scrollbar |
enum | auto |
When a scroll, list, tree or table has its bars: while its content runs past it, always, or never. The bars float, so one shows once the pointer is over the box One of auto, always, never. |
scrollbar_width |
float | 0 |
The room a box with overflow = "scroll" keeps clear inside its edge for a bar, in design pixels At least 0. |
secret |
bool | false |
Draw a text_field's text as dots, for a password |
selectable |
bool | false |
Let a drag over this label select its text, and the platform's copy key take it |
selection |
list | [] |
The rows a list, tree or table has picked, one of them where it holds one. text is the last row clicked, which is where a shift range measures from; on_change hears the whole list where the widget holds many, and the row where it holds one |
sense |
enum | click |
What the pointer may do to a button: click reports a press let go as a click; under click_and_drag a press that moves past egui's drag distance is a drag and no click; drag and hover never click One of click, click_and_drag, drag, hover. |
shadow_color |
color | [0,0,0,0.5] |
The shadow's colour |
shadow_offset_x |
float | 0 |
Pixels a shaped label's shadow is moved along x; zero with y draws none |
shadow_offset_y |
float | 0 |
Pixels the shadow is moved along y |
shaping |
enum | complex |
Complex shaping joins scripts that need it and falls back to another face; simple does neither One of complex, simple. |
sheet |
string | — | The picture a list cuts its card faces from |
shortcut |
string | — | A chord that clicks this widget wherever it is, as cmd+shift+s or f5; a menu row fires while its menu is shut, and draws the chord against its far edge unless it says its own trailing |
show_percentage |
bool | false |
Draw a progress_bar's fill as a percentage on it, in place of its text |
show_tooltip_when_elided |
bool | true |
Show a label's whole text when the pointer rests on it and truncate cut it short |
show_value |
bool | false |
Draw a slider's number beside its track, for the reader to drag or type into |
showing |
bool | false |
Holds a menu's rows up from the scene, as a click would; for an offscreen run or a tutorial, since nothing can click there |
shrink |
float | -1 |
Share of the shortfall this child gives up when its container is too small along its direction; below zero is 1 for one that grows and 0 otherwise |
slice |
vec4 | [0,0,0,0] |
Left, top, right and bottom borders of an image kept unstretched, in the picture's own pixels; all zero stretches the whole picture |
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 |
snap_advances |
bool | false |
Round each glyph's advance to a whole pixel |
sort |
string | — | The table column its rows are ordered by, by the name in titles; empty leaves them in the order they were given. A cell that starts with a number sorts as one, so 12 KB follows 3 KB |
sortable |
bool | false |
Let a click on a table's header sort by that column, and the next click on the same one turn it round; the column sorted by carries a caret |
spacing |
float | -1 |
The room a separator takes across its line, in design pixels, the line drawn down its middle; below zero is 6 |
splitter_width |
float | 0 |
How wide a grab the seams between this container's children get, in design pixels; 0 leaves them fixed. A drag writes the new size onto the neighbour that states one. On a table it is the grab between two columns, which is six pixels where it says nothing At least 0. |
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. |
stick_to_end |
bool | false |
Keep a scroll, list, tree or table at its end as content arrives, until the reader scrolls away from it; ui.scroll takes it too |
strikethrough |
bool | false |
A line through the text |
strikethrough_color |
color | [0,0,0,0] |
The strikethrough's colour; alpha 0 takes the glyphs' own |
stroke |
string | — | The outline around this widget, as #rrggbb or a name from the theme's [colors]; empty takes the theme's own |
submit_key |
string | — | The chord that submits a text_field, as enter or cmd+enter; empty is Enter. A text_area submits when focus leaves it whatever this says |
submitted |
bool | false |
True for the one frame a text_field was submitted, the way clicked reports a press |
suffix |
string | — | Units drawn after a number_field's or a shown slider's number with a space between, and after a text_field's or text_area's text |
tab_inserts |
bool | false |
Let Tab type a tab into a text_field, text_area or code rather than move focus on |
tab_width |
int | 8 |
Spaces between tab stops Range 1–64. |
text |
string | label |
Label or button caption |
text_align |
enum | start |
Where text sits in the width the widget was given, what a text_field or text_area edits included, and where every cell of a table sits in its column; a column whose name ends in > pins its own to the right One of start, center, end. |
text_background |
color | [0,0,0,0] |
A wash behind the text of the kinds egui draws; alpha 0 is none |
text_color |
color | [0,0,0,0] |
Text color; fully transparent takes the theme's colour for this widget's role or kind, and failing that a near-white |
text_key |
string | — | A localization key drawn in place of text, re-read every frame so a locale switch shows at once |
theme |
asset · widget_theme |
— | How this widget and everything under it is drawn; inherited from the nearest ancestor that names one |
tint |
color | [1,1,1,1] |
What an image is multiplied by; white draws it as it is |
title_bar |
bool | false |
On a fold's child: drawn in the fold's header after its arrow and caption, as Godot's title bar control is |
titles |
list | [] |
A table's column names, in order, and with them how many columns it has: a name ending in > draws its column against the right edge, which is what a column of numbers wants. None takes the first row as the names |
toggle |
bool | false |
A button a click holds down and the next releases, flipping checked as a checkbox does, before on_click runs: Godot's toggle mode |
tooltip |
string | — | Text shown after the pointer rests on the widget; still shown while enabled is off, which is where it says why |
trailing |
string | — | Text a button draws against its far edge, dimmer than its caption: a shortcut, or a menu's caret |
trailing_fill |
bool | false |
Fill a slider's track from its start up to the handle |
truncate |
bool | false |
Cut a caption too long for the width the widget was given and end it with an ellipsis; with neither this nor wrap a button clips it at its edge. A dropdown cuts its picked text |
truncate_at |
enum | end |
Which part of a cut caption the ellipsis stands in for One of end, start, middle. |
underline |
enum | none |
A line under the text, once or twice; egui's own kinds draw one either way One of none, single, double. |
underline_color |
color | [0,0,0,0] |
The underline's colour; alpha 0 takes the glyphs' own |
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 |
visible |
bool | true |
Draw the widget; hidden widgets keep their state |
warnings |
list | [] |
The lines a code widget underlines as warnings, counting from 1; an error on the same line outranks it |
wheel_scroll |
bool | true |
Let the mouse wheel scroll a scroll, list, tree or table |
wheel_speed |
vec2 | [1,1] |
How far a mouse wheel scrolls a scroll, list, tree or table, across and down, as a multiple of egui's own |
width |
float | 0 |
Panel width in design pixels; 0 sizes to content At least 0. |
width_percent |
float | 0 |
Width as a percentage of the container's box inside its padding; 0 leaves it to width, which a stated percentage wins over At least 0. |
widths |
list | [] |
Each table column's share of the width, in the order titles names them: ["2", "1", "1"] gives the first half and the other two a quarter each. Numbers and the text of them both; empty divides the width evenly, and a drag on a seam in the header writes the shares back |
wrap |
bool | false |
Break text to the width the widget was given instead of running past it on one line; a dropdown breaks its picked text |
wrap_children |
enum | auto |
Whether a container's children run onto more lines when they do not fit: auto wraps a flow and keeps every other container on one line; balance evens the lines out over at least min_lines; a _reverse word stacks the lines the other way One of auto, none, wrap, wrap_reverse, balance, balance_reverse. |
x |
float | 16 |
Horizontal offset from the anchor, in design pixels |
y |
float | 16 |
Vertical offset from the anchor, in design pixels |
Asset types this component references: widget_theme.