Expand description
Screen is a widget that always has the size of the screen of the UI in which it is used. See
docs for Screen
for more info and usage examples.
Structsยง
- Screen
- Screen is a widget that always has the size of the screen of the UI in which it is used. It is
main use case is to provide automatic layout functionality, that will always provide screen size
to its children widgets. This is needed, because the root node of any UI is
crate::canvas::Canvas
which provides infinite bounds as a layout constraint, thus making it impossible for automatic fitting to the current screen size. For example, Screen widget could be used as a root node forcrate::grid::Grid
widget - in this case the grid instance will always have the size of the screen and will automatically shrink or expand when the screen size changes. It is ideal choice if you want to have some widgets always centered on screen (for example - crosshair, main menu of your game, etc.). - Screen
Builder - Screen builder creates instances of
Screen
widgets and adds them to the user interface.