[][src]Trait bevy_inspector_egui::Inspectable

pub trait Inspectable {
    type Attributes: Default;
    pub fn ui(
        &mut self,
        ui: &mut Ui,
        options: Self::Attributes,
        context: &Context<'_>
    ); }

This trait describes how a struct should be displayed. It can be derived for structs and enums, see the crate-level docs for how to do that.

Associated Types

type Attributes: Default[src]

The Attributes associated type specifies what attributes can be passed to a field. See the following snippet for an example:

struct MyCustomType;
struct MyWidgetAttributes { a: f32, b: Option<String> }

impl Inspectable for MyCustomType {
  type Attributes = MyWidgetAttributes;

  fn ui(&mut self, _: &mut egui::Ui, options: MyWidgetAttributes, context: &Context) {
    println!("a = {}, b = {:?}", options.a, options.b);
  }
}

// ...

#[derive(Inspectable)]
struct InspectorData {
  #[inspectable(a = 10.0, b = None)]
  value: MyCustomType,
}
Loading content...

Required methods

pub fn ui(
    &mut self,
    ui: &mut Ui,
    options: Self::Attributes,
    context: &Context<'_>
)
[src]

This methods is responsible for building the egui ui.

Loading content...

Implementations on Foreign Types

impl Inspectable for Quat[src]

type Attributes = NumberAttributes<[f32; 4]>

impl Inspectable for Transform[src]

type Attributes = ()

impl Inspectable for Mat3[src]

type Attributes = ()

impl Inspectable for Mat4[src]

type Attributes = ()

impl Inspectable for Color[src]

type Attributes = ColorAttributes

impl Inspectable for StandardMaterial[src]

type Attributes = ()

impl<T> Inspectable for Vec<T> where
    T: Inspectable + Default,
    T::Attributes: Clone
[src]

type Attributes = <T as Inspectable>::Attributes

impl Inspectable for f32[src]

type Attributes = NumberAttributes<f32>

impl Inspectable for f64[src]

type Attributes = NumberAttributes<f64>

impl Inspectable for u8[src]

type Attributes = NumberAttributes<u8>

impl Inspectable for i32[src]

type Attributes = NumberAttributes<i32>

impl Inspectable for u16[src]

type Attributes = NumberAttributes<u16>

impl Inspectable for u32[src]

type Attributes = NumberAttributes<u32>

impl Inspectable for u64[src]

type Attributes = NumberAttributes<u64>

impl Inspectable for i8[src]

type Attributes = NumberAttributes<i8>

impl Inspectable for i16[src]

type Attributes = NumberAttributes<i16>

impl Inspectable for i64[src]

type Attributes = NumberAttributes<i64>

impl Inspectable for String[src]

type Attributes = StringAttributes

impl Inspectable for bool[src]

type Attributes = ()

impl<T> Inspectable for RangeInclusive<T> where
    T: Inspectable + Default,
    T::Attributes: Clone
[src]

type Attributes = T::Attributes

impl<T> Inspectable for Range<T> where
    T: Inspectable + Default,
    T::Attributes: Clone
[src]

type Attributes = T::Attributes

impl Inspectable for Vec2[src]

type Attributes = Vec2dAttributes

impl Inspectable for Vec3[src]

type Attributes = NumberAttributes<Vec3>

impl Inspectable for Vec4[src]

type Attributes = NumberAttributes<Vec4>

impl<T: Asset + Inspectable> Inspectable for Handle<T>[src]

type Attributes = T::Attributes

Loading content...

Implementors

impl<T: Reflect> Inspectable for ReflectedUI<T>[src]

type Attributes = ()

Loading content...