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, T, K> Slider<'ui, T, K>
where T: AsRef<str>, K: DataTypeKind,

source

pub fn new(ui: &'ui Ui, label: T, min: K, max: K) -> Slider<'ui, T, K>

👎Deprecated since 0.9.0: Use Ui::slider or Ui::slider_config.

Constructs a new slider builder with the given range.

source§

impl<'ui, Label, Data, Format> Slider<'ui, Label, Data, Format>
where Label: AsRef<str>, Data: DataTypeKind, Format: AsRef<str>,

source

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

source

pub fn display_format<Format2>( self, display_format: Format2, ) -> Slider<'ui, Label, Data, Format2>
where Format2: AsRef<str>,

Sets the display format using a C-style printf string

source

pub fn flags(self, flags: SliderFlags) -> Slider<'ui, Label, Data, Format>

Replaces all current settings with the given flags

source

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.

source

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§

source§

impl<'ui, Label, Data, Format> Clone for Slider<'ui, Label, Data, Format>
where Label: Clone, Data: Clone, Format: Clone,

source§

fn clone(&self) -> Slider<'ui, Label, Data, Format>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'ui, Label, Data, Format> Debug for Slider<'ui, Label, Data, Format>
where Label: Debug, Data: Debug, Format: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'ui, Label, Data, Format> Copy for Slider<'ui, Label, Data, Format>
where Label: Copy, Data: Copy, Format: Copy,

Auto Trait Implementations§

§

impl<'ui, Label, Data, Format> Freeze for Slider<'ui, Label, Data, Format>
where Label: Freeze, Data: Freeze, Format: Freeze,

§

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>
where Label: Unpin, Data: Unpin, Format: Unpin,

§

impl<'ui, Label, Data, Format = &'static str> !UnwindSafe for Slider<'ui, Label, Data, Format>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T, U> AsBindGroupShaderType<U> for T
where U: ShaderType, &'a T: for<'a> Into<U>,

source§

fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U

Return the T ShaderType for self. When used in AsBindGroup derives, it is safe to assume that all images in self exist.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more