Struct arcdps_imgui::AngleSlider

source ·
pub struct AngleSlider<Label, Format = &'static str> { /* private fields */ }
Expand description

Builder for an angle slider widget.

Implementations§

source§

impl<Label> AngleSlider<Label>
where Label: AsRef<str>,

source

pub fn new(label: Label) -> Self

Constructs a new angle slider builder, where its minimum defaults to -360.0 and maximum defaults to 360.0

source§

impl<Label, Format> AngleSlider<Label, Format>
where Label: AsRef<str>, Format: AsRef<str>,

source

pub fn range_degrees(self, min_degrees: f32, max_degrees: f32) -> Self

Sets the range in degrees (inclusive)

arcdps_imgui::AngleSlider::new(im_str!("Example"))
    .range_degrees(-20.0, 20.0)
    // Remember to call .build(&ui)
    ;

It is safe, though up to C++ Dear ImGui, on how to handle when min > max.

source

pub fn min_degrees(self, min_degrees: f32) -> Self

Sets the minimum value (in degrees)

source

pub fn max_degrees(self, max_degrees: f32) -> Self

Sets the maximum value (in degrees)

source

pub fn display_format<Format2: AsRef<str>>( self, display_format: Format2, ) -> AngleSlider<Label, Format2>

Sets the display format using a C-style printf string

source

pub fn flags(self, flags: SliderFlags) -> Self

Replaces all current settings with the given flags

source

pub fn build(self, ui: &Ui<'_>, value_rad: &mut f32) -> bool

Builds an angle slider that is bound to the given value (in radians).

Returns true if the slider value was changed.

Trait Implementations§

source§

impl<Label: Clone, Format: Clone> Clone for AngleSlider<Label, Format>

source§

fn clone(&self) -> AngleSlider<Label, 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<Label: Debug, Format: Debug> Debug for AngleSlider<Label, Format>

source§

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

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

impl<Label: Copy, Format: Copy> Copy for AngleSlider<Label, Format>

Auto Trait Implementations§

§

impl<Label, Format> Freeze for AngleSlider<Label, Format>
where Label: Freeze, Format: Freeze,

§

impl<Label, Format> RefUnwindSafe for AngleSlider<Label, Format>
where Label: RefUnwindSafe, Format: RefUnwindSafe,

§

impl<Label, Format> Send for AngleSlider<Label, Format>
where Label: Send, Format: Send,

§

impl<Label, Format> Sync for AngleSlider<Label, Format>
where Label: Sync, Format: Sync,

§

impl<Label, Format> Unpin for AngleSlider<Label, Format>
where Label: Unpin, Format: Unpin,

§

impl<Label, Format> UnwindSafe for AngleSlider<Label, Format>
where Label: UnwindSafe, Format: UnwindSafe,

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

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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,

source§

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

source§

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

source§

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.