Struct fyrox_ui::text::TextBuilder
source · pub struct TextBuilder { /* private fields */ }Expand description
TextBuilder is used to create instances of Text widget and register them in the user interface.
Implementations§
source§impl TextBuilder
impl TextBuilder
sourcepub fn new(widget_builder: WidgetBuilder) -> Self
pub fn new(widget_builder: WidgetBuilder) -> Self
Creates new TextBuilder instance using the provided base widget builder.
sourcepub fn with_font(self, font: SharedFont) -> Self
pub fn with_font(self, font: SharedFont) -> Self
Sets the desired font of the widget.
sourcepub fn with_opt_font(self, font: Option<SharedFont>) -> Self
pub fn with_opt_font(self, font: Option<SharedFont>) -> Self
Sets the desired font of the widget using font wrapped in Option.
sourcepub fn with_vertical_text_alignment(self, valign: VerticalAlignment) -> Self
pub fn with_vertical_text_alignment(self, valign: VerticalAlignment) -> Self
Sets the desired vertical alignment of the widget.
sourcepub fn with_horizontal_text_alignment(self, halign: HorizontalAlignment) -> Self
pub fn with_horizontal_text_alignment(self, halign: HorizontalAlignment) -> Self
Sets the desired horizontal alignment of the widget.
sourcepub fn with_wrap(self, wrap: WrapMode) -> Self
pub fn with_wrap(self, wrap: WrapMode) -> Self
Sets the desired word wrapping mode of the widget.
sourcepub fn with_shadow(self, shadow: bool) -> Self
pub fn with_shadow(self, shadow: bool) -> Self
Whether the shadow enabled or not.
sourcepub fn with_shadow_brush(self, brush: Brush) -> Self
pub fn with_shadow_brush(self, brush: Brush) -> Self
Sets desired shadow brush. It will be used to render the shadow.
sourcepub fn with_shadow_dilation(self, thickness: f32) -> Self
pub fn with_shadow_dilation(self, thickness: f32) -> Self
Sets desired shadow dilation in units. Keep in mind that the dilation is absolute, not percentage-based.
sourcepub fn with_shadow_offset(self, offset: Vector2<f32>) -> Self
pub fn with_shadow_offset(self, offset: Vector2<f32>) -> Self
Sets desired shadow offset in units.
sourcepub fn build(self, ui: &mut BuildContext<'_>) -> Handle<UiNode>
pub fn build(self, ui: &mut BuildContext<'_>) -> Handle<UiNode>
Finishes text widget creation and registers it in the user interface, returning its handle to you.
Auto Trait Implementations§
impl !RefUnwindSafe for TextBuilder
impl !Send for TextBuilder
impl !Sync for TextBuilder
impl Unpin for TextBuilder
impl !UnwindSafe for TextBuilder
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
source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere T: 'static,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.