Struct TextField
#[non_exhaustive]pub struct TextField {
pub rect: [f32; 4],
pub edit: TextEdit,
pub active: bool,
pub bordered: bool,
pub text_color: u32,
pub suggestion: Option<String>,
pub message: String,
/* private fields */
}Expand description
A single-line text field (EditBox).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.rect: [f32; 4]Where it is, [x, y, width, height] in GUI pixels (vanilla’s are 20 high).
edit: TextEditThe text, cursor and selection.
active: boolAn inactive field shows its text greyed out, takes no input and is skipped by Tab.
bordered: boolDrawn on the widget/text_field sprite with a 4-pixel margin; without, the bare text.
text_color: u32The text’s colour, ARGB (EditBox.setTextColor).
suggestion: Option<String>Grey text shown after the end of the text (EditBox.setSuggestion).
message: StringWhat the narrator calls it (EditBox’s message: <message> edit box: <text>).
Implementations§
Trait Implementations§
impl StructuralPartialEq for TextField
Auto Trait Implementations§
impl Freeze for TextField
impl RefUnwindSafe for TextField
impl Send for TextField
impl Sync for TextField
impl Unpin for TextField
impl UnsafeUnpin for TextField
impl UnwindSafe for TextField
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more