Struct amethyst_ui::UiButtonBuilder [−][src]
pub struct UiButtonBuilder { /* fields omitted */ }Convenience structure for building a button
Methods
impl UiButtonBuilder[src]
impl UiButtonBuilderpub fn new<N: ToString, S: ToString>(name: N, text: S) -> UiButtonBuilder[src]
pub fn new<N: ToString, S: ToString>(name: N, text: S) -> UiButtonBuilderConstruct 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_parent(self, parent: Entity) -> Self[src]
pub fn with_parent(self, parent: Entity) -> SelfAdd a parent to the button.
pub fn with_anchor(self, anchor: Anchor) -> Self[src]
pub fn with_anchor(self, anchor: Anchor) -> SelfAdd an anchor to the button.
pub fn with_stretch(self, stretch: Stretch) -> Self[src]
pub fn with_stretch(self, stretch: Stretch) -> SelfStretch the button.
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: TextureHandle) -> Self[src]
pub fn with_image(self, image: TextureHandle) -> 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 with_layer(self, z: f32) -> Self[src]
pub fn with_layer(self, z: f32) -> SelfProvide a Z position, i.e UI layer
pub fn with_size(self, width: f32, height: f32) -> Self[src]
pub fn with_size(self, width: f32, height: f32) -> SelfSet button size
pub fn with_tab_order(self, tab_order: i32) -> Self[src]
pub fn with_tab_order(self, tab_order: i32) -> SelfSet button tab order
pub fn with_font_size(self, size: f32) -> Self[src]
pub fn with_font_size(self, size: f32) -> SelfSet font size
pub fn with_text_color(self, text_color: [f32; 4]) -> Self[src]
pub fn with_text_color(self, text_color: [f32; 4]) -> SelfSet text color
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.
Trait Implementations
impl Default for UiButtonBuilder[src]
impl Default for UiButtonBuilderAuto Trait Implementations
impl Send for UiButtonBuilder
impl Send for UiButtonBuilderimpl Sync for UiButtonBuilder
impl Sync for UiButtonBuilder