Struct pixels_graphics_lib::ui::text_field::TextField
source · pub struct TextField { /* private fields */ }
Implementations§
source§impl TextField
impl TextField
sourcepub fn new<P: Into<Coord>>(
xy: P,
max_length: usize,
text_size: TextSize,
size_limits: (Option<usize>, Option<usize>),
initial_content: &str,
filters: &[TextFilter],
style: &TextFieldStyle
) -> Self
pub fn new<P: Into<Coord>>( xy: P, max_length: usize, text_size: TextSize, size_limits: (Option<usize>, Option<usize>), initial_content: &str, filters: &[TextFilter], style: &TextFieldStyle ) -> Self
UI element that allows text input Only supports characters in A-Z, a-z, 0-9, and some symbols a-z will be rendered as A-Z Does not support multiline
By default the width of the field is max_length * font width
but this can be restricted/overridden using size_limits
Params
xy
- Coord of top left cornemax_length
- Max number of charstext_size
- Size of text, effects width and heightsize_limits
- Optional min and optional max width of field in pixels (including border + padding)filters
- Filter allowed key, if empty then defaults to All