Skip to main content

Ingameable

Trait Ingameable 

Source
pub trait Ingameable: Widget + Sized {
    // Provided method
    fn position_ingame(self, pos: Vec3<f32>) -> Ingame<Self> { ... }
}
Expand description

Extension trait for positioning a widget at a 3D point in the game world.

Provided Methods§

Source

fn position_ingame(self, pos: Vec3<f32>) -> Ingame<Self>

Positions a widget as if it was at pos in the 3D game world.

Wraps the widget in a parent Ingame widget which collaborates with custom code in our UI renderering logic to pass the positioning information through.

Note, the widget size will not be scaled based on distance for performance and stylistic purposes.

Note, widgets set in the Widget::update impl of self should not use position_ingame themselves. I.E. nested usage is not supported.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<W: Widget> Ingameable for W