[−][src]Struct amethyst_ui::UiLabelBuilder
Convenience structure for building a label
Methods
impl<'a, I> UiLabelBuilder<I> where
I: WidgetId + 'static,
[src]
I: WidgetId + 'static,
pub fn new<S: ToString>(text: S) -> UiLabelBuilder<I>
[src]
Construct a new UiLabelBuilder.
This allows the user to easily build a UI element with a text that can
easily be retrieved and updated through the appropriate resource,
see Widgets
.
pub fn with_id(self, id: I) -> Self
[src]
Sets an ID for this widget. The type of this ID will determine which Widgets
resource this widget will be added to, see Widgets
.
pub fn with_size(self, width: f32, height: f32) -> Self
[src]
Set button size
pub fn with_position(self, x: f32, y: f32) -> Self
[src]
This will create a default UiTransform if one is not already attached.
See DEFAULT_Z
, DEFAULT_WIDTH
, DEFAULT_HEIGHT
, and DEFAULT_TAB_ORDER
for
the values that will be provided to the default UiTransform.
pub fn with_anchor(self, anchor: Anchor) -> Self
[src]
Add an anchor to the button.
pub fn with_stretch(self, stretch: Stretch) -> Self
[src]
Stretch the button.
pub fn with_text<S>(self, text: S) -> Self where
S: ToString,
[src]
S: ToString,
This will set the rendered characters within the button. Use this to just change what
characters will appear. If you need to change the font size, color, etc., then you should
use
with_uitext
and provide a new UiText
object.
pub fn with_text_color(self, text_color: [f32; 4]) -> Self
[src]
Set text color
pub fn with_font(self, font: FontHandle) -> Self
[src]
Use a different font for the button text.
pub fn with_font_size(self, size: f32) -> Self
[src]
Set font size
pub fn with_parent(self, parent: Entity) -> Self
[src]
Add a parent to the button.
pub fn build(self, res: UiLabelBuilderResources<'a, I>) -> (I, UiLabel)
[src]
Build this with the UiLabelBuilderResources
.
pub fn build_from_world(self, world: &World) -> (I, UiLabel)
[src]
Create the UiLabel based on provided configuration parameters.
Trait Implementations
impl<'a, I> Default for UiLabelBuilder<I> where
I: WidgetId + 'static,
[src]
I: WidgetId + 'static,
impl<I: Debug> Debug for UiLabelBuilder<I> where
I: WidgetId,
[src]
I: WidgetId,
Auto Trait Implementations
impl<I> Unpin for UiLabelBuilder<I> where
I: Unpin,
I: Unpin,
impl<I> Sync for UiLabelBuilder<I>
impl<I> Send for UiLabelBuilder<I>
impl<I> UnwindSafe for UiLabelBuilder<I> where
I: UnwindSafe,
I: UnwindSafe,
impl<I> RefUnwindSafe for UiLabelBuilder<I> where
I: RefUnwindSafe,
I: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> SP
[src]
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> Any for T where
T: Any,
[src]
T: Any,
fn get_type_id(&self) -> TypeId
[src]
impl<T> TryDefault for T where
T: Default,
[src]
T: Default,
fn try_default() -> Result<T, String>
[src]
fn unwrap_default() -> Self
[src]
Calls try_default
and panics on an error case.
impl<T> Event for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T> Erased for T
[src]
impl<T> SetParameter for T
[src]
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
[src]
T: Parameter<Self>,
Sets value
as a parameter of self
.
impl<T> Supports<T> for T
[src]
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
Convert the source color to the destination color using the bradford method by default Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,