Struct TextFieldView
#[non_exhaustive]pub struct TextFieldView {
pub rect: [f32; 4],
pub value: String,
pub cursor: usize,
pub highlight: usize,
pub max_length: usize,
pub scroll: usize,
pub focused: bool,
pub caret_shown: bool,
pub bordered: bool,
pub text_color: u32,
pub suggestion: Option<String>,
pub message: String,
}Expand description
A text field as DrawContext::widget_text_field draws it: the game’s EditBox look,
filled in by Widgets.
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.
value: StringThe text.
cursor: usizeThe cursor and the other end of the selection, in characters.
highlight: usizeThe selection’s anchor.
max_length: usizeThe field’s maximum length: a full field shows a bar for its caret.
scroll: usizeThe first character shown, from the last draw.
focused: boolIt has the keyboard focus: highlighted sprite, caret, narration.
caret_shown: boolThe caret is in the visible half of its blink.
bordered: boolOn the widget/text_field sprite with a 4-pixel margin.
text_color: u32The text’s colour, ARGB.
suggestion: Option<String>Grey text after the end of the text.
message: StringThe narrator’s name for it.
Trait Implementations§
§impl Clone for TextFieldView
impl Clone for TextFieldView
§fn clone(&self) -> TextFieldView
fn clone(&self) -> TextFieldView
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for TextFieldView
impl Debug for TextFieldView
§impl PartialEq for TextFieldView
impl PartialEq for TextFieldView
impl StructuralPartialEq for TextFieldView
Auto Trait Implementations§
impl Freeze for TextFieldView
impl RefUnwindSafe for TextFieldView
impl Send for TextFieldView
impl Sync for TextFieldView
impl Unpin for TextFieldView
impl UnsafeUnpin for TextFieldView
impl UnwindSafe for TextFieldView
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