Struct amethyst_ui::UiButtonBuilder [−][src]
pub struct UiButtonBuilder<'a> { /* fields omitted */ }Builder for a UiButton.
Methods
impl<'a> UiButtonBuilder<'a>[src]
impl<'a> UiButtonBuilder<'a>pub fn new<'b, S: ToString>(
name: &'a str,
text: S,
resources: UiButtonResources<'b>
) -> UiButtonBuilder<'a>[src]
pub fn new<'b, S: ToString>(
name: &'a str,
text: S,
resources: UiButtonResources<'b>
) -> UiButtonBuilder<'a>Construct a new UiButtonBuilder. This allows easy use of default values for text and button appearance and allows the user to easily set other UI-related options.
pub fn with_anchored(self, anchored: Anchored) -> Self[src]
pub fn with_anchored(self, anchored: Anchored) -> SelfAdd an anchor to the button.
pub fn with_parent(self, parent: Parent) -> Self[src]
pub fn with_parent(self, parent: Parent) -> SelfAdd a parent to the button.
pub fn with_stretched(self, stretched: Stretched) -> Self[src]
pub fn with_stretched(self, stretched: Stretched) -> SelfStretch the button.
pub fn with_transform(self, transform: UiTransform) -> Self[src]
pub fn with_transform(self, transform: UiTransform) -> SelfAdd a UiTransform to the image to offset it within the UI.
pub fn with_uitext(self, text: UiText) -> Self[src]
pub fn with_uitext(self, text: UiText) -> SelfThis will completely replace the UiText object representing the button's text.
Use this if you want to change more than just the characters, but the font size, color,
etc. as well.
Use with_text to just change the underlying text.
pub fn with_text<S>(self, text: S) -> Self where
S: ToString, [src]
pub fn with_text<S>(self, text: S) -> Self where
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_image(self, image: UiImage) -> Self[src]
pub fn with_image(self, image: UiImage) -> SelfReplace the default UiImage with image.
pub fn with_font(self, font: FontHandle) -> Self[src]
pub fn with_font(self, font: FontHandle) -> SelfUse a different font for the button text.
pub fn with_position(self, x: f32, y: f32) -> Self[src]
pub fn with_position(self, x: f32, y: f32) -> SelfProvide an X and Y position for the button.
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 build_from_world(self, world: &World) -> UiButton[src]
pub fn build_from_world(self, world: &World) -> UiButtonCreate the UiButton based on provided configuration parameters.
Auto Trait Implementations
impl<'a> Send for UiButtonBuilder<'a>
impl<'a> Send for UiButtonBuilder<'a>impl<'a> Sync for UiButtonBuilder<'a>
impl<'a> Sync for UiButtonBuilder<'a>