Struct bevy_mod_imgui::prelude::Slider
source · pub struct Slider<'ui, Label, Data, Format = &'static str> { /* private fields */ }Expand description
Builder for a slider widget.
Implementations§
source§impl<'ui, Label, Data, Format> Slider<'ui, Label, Data, Format>
impl<'ui, Label, Data, Format> Slider<'ui, Label, Data, Format>
sourcepub fn range(self, min: Data, max: Data) -> Slider<'ui, Label, Data, Format>
pub fn range(self, min: Data, max: Data) -> Slider<'ui, Label, Data, Format>
Sets the range inclusively, such that both values given are valid values which the slider can be dragged to.
ui.slider_config("Example", i8::MIN, i8::MAX)
.range(4, 8)
// Remember to call .build()
;It is safe, though up to C++ Dear ImGui, on how to handle when
min > max.
Note for f32 and f64 sliders, Dear ImGui limits the available
range to half their full range (e.g f32::MIN/2.0 .. f32::MAX/2.0)
Specifying a value above this will cause an abort.
For large ranged values, consider using Ui::input_scalar instead
sourcepub fn display_format<Format2>(
self,
display_format: Format2,
) -> Slider<'ui, Label, Data, Format2>
pub fn display_format<Format2>( self, display_format: Format2, ) -> Slider<'ui, Label, Data, Format2>
Sets the display format using a C-style printf string
sourcepub fn flags(self, flags: SliderFlags) -> Slider<'ui, Label, Data, Format>
pub fn flags(self, flags: SliderFlags) -> Slider<'ui, Label, Data, Format>
Replaces all current settings with the given flags
sourcepub fn build(self, value: &mut Data) -> bool
pub fn build(self, value: &mut Data) -> bool
Builds a slider that is bound to the given value.
Returns true if the slider value was changed.
sourcepub fn build_array(self, values: &mut [Data]) -> bool
pub fn build_array(self, values: &mut [Data]) -> bool
Builds a horizontal array of multiple sliders attached to the given slice.
Returns true if any slider value was changed.
Trait Implementations§
impl<'ui, Label, Data, Format> Copy for Slider<'ui, Label, Data, Format>
Auto Trait Implementations§
impl<'ui, Label, Data, Format> Freeze for Slider<'ui, Label, Data, Format>
impl<'ui, Label, Data, Format = &'static str> !RefUnwindSafe for Slider<'ui, Label, Data, Format>
impl<'ui, Label, Data, Format = &'static str> !Send for Slider<'ui, Label, Data, Format>
impl<'ui, Label, Data, Format = &'static str> !Sync for Slider<'ui, Label, Data, Format>
impl<'ui, Label, Data, Format> Unpin for Slider<'ui, Label, Data, Format>
impl<'ui, Label, Data, Format = &'static str> !UnwindSafe for Slider<'ui, Label, Data, Format>
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.