Struct amethyst_ui::UiButtonBuilder [−][src]
pub struct UiButtonBuilder { /* fields omitted */ }
Convenience structure for building a button
Methods
impl UiButtonBuilder
[src]
impl UiButtonBuilder
pub fn new<N: ToString, S: ToString>(name: N, text: S) -> UiButtonBuilder
[src]
pub fn new<N: ToString, S: ToString>(name: N, text: S) -> UiButtonBuilder
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_parent(self, parent: Entity) -> Self
[src]
pub fn with_parent(self, parent: Entity) -> Self
Add a parent to the button.
pub fn with_anchor(self, anchor: Anchor) -> Self
[src]
pub fn with_anchor(self, anchor: Anchor) -> Self
Add an anchor to the button.
pub fn with_stretch(self, stretch: Stretch) -> Self
[src]
pub fn with_stretch(self, stretch: Stretch) -> Self
Stretch 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) -> Self
Replace the default UiImage with image
.
pub fn with_font(self, font: FontHandle) -> Self
[src]
pub fn with_font(self, font: FontHandle) -> Self
Use 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) -> Self
Provide 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) -> Self
Provide 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) -> Self
Set button size
pub fn with_tab_order(self, tab_order: i32) -> Self
[src]
pub fn with_tab_order(self, tab_order: i32) -> Self
Set button tab order
pub fn with_font_size(self, size: f32) -> Self
[src]
pub fn with_font_size(self, size: f32) -> Self
Set font size
pub fn with_text_color(self, text_color: [f32; 4]) -> Self
[src]
pub fn with_text_color(self, text_color: [f32; 4]) -> Self
Set text color
pub fn with_hover_text_color(self, text_color: [f32; 4]) -> Self
[src]
pub fn with_hover_text_color(self, text_color: [f32; 4]) -> Self
Text color to use when the mouse is hovering over this button
pub fn with_press_text_color(self, text_color: [f32; 4]) -> Self
[src]
pub fn with_press_text_color(self, text_color: [f32; 4]) -> Self
Set text color when the button is pressed
pub fn with_hover_image(self, image: TextureHandle) -> Self
[src]
pub fn with_hover_image(self, image: TextureHandle) -> Self
Button image to use when the mouse is hovering over this button
pub fn with_press_image(self, image: TextureHandle) -> Self
[src]
pub fn with_press_image(self, image: TextureHandle) -> Self
Button image to use when this button is pressed
pub fn with_hover_sound(self, sound: SourceHandle) -> Self
[src]
pub fn with_hover_sound(self, sound: SourceHandle) -> Self
Sound emitted when this button is hovered over
pub fn with_press_sound(self, sound: SourceHandle) -> Self
[src]
pub fn with_press_sound(self, sound: SourceHandle) -> Self
Sound emitted when this button is pressed
pub fn with_release_sound(self, sound: SourceHandle) -> Self
[src]
pub fn with_release_sound(self, sound: SourceHandle) -> Self
Sound emitted when this button is released
pub fn build(self, res: UiButtonBuilderResources) -> Entity
[src]
pub fn build(self, res: UiButtonBuilderResources) -> Entity
Build this with the UiButtonBuilderResources
.
pub fn build_from_world(self, world: &World) -> Entity
[src]
pub fn build_from_world(self, world: &World) -> Entity
Create the UiButton based on provided configuration parameters.
Trait Implementations
impl Default for UiButtonBuilder
[src]
impl Default for UiButtonBuilder
Auto Trait Implementations
impl Send for UiButtonBuilder
impl Send for UiButtonBuilder
impl Sync for UiButtonBuilder
impl Sync for UiButtonBuilder