[−][src]Struct imgui::WindowDrawList
Object implementing the custom draw API.
Called from Ui::get_window_draw_list
. No more than one instance of this
structure can live in a program at the same time.
The program will panic on creating a second instance.
Implementations
impl<'ui> WindowDrawList<'ui>
[src]
pub fn channels_split<F: FnOnce(&ChannelsSplit<'_>)>(
&self,
channels_count: u32,
f: F
)
[src]
&self,
channels_count: u32,
f: F
)
Split into channels_count drawing channels. At the end of the closure, the channels are merged. The objects are then drawn in the increasing order of their channel number, and not in the order they were called.
Example
fn custom_drawing(ui: &Ui) { let draw_list = ui.get_window_draw_list(); draw_list.channels_split(2, |channels| { channels.set_current(1); // ... Draw channel 1 channels.set_current(0); // ... Draw channel 0 }); }
impl<'ui> WindowDrawList<'ui>
[src]
Drawing functions
pub fn add_line<C>(&'ui self, p1: [f32; 2], p2: [f32; 2], c: C) -> Line<'ui> where
C: Into<ImColor>,
[src]
C: Into<ImColor>,
Returns a line from point p1
to p2
with color c
.
pub fn add_rect<C>(&'ui self, p1: [f32; 2], p2: [f32; 2], c: C) -> Rect<'ui> where
C: Into<ImColor>,
[src]
C: Into<ImColor>,
Returns a rectangle whose upper-left corner is at point p1
and lower-right corner is at point p2
, with color c
.
pub fn add_rect_filled_multicolor<C1, C2, C3, C4>(
&self,
p1: [f32; 2],
p2: [f32; 2],
col_upr_left: C1,
col_upr_right: C2,
col_bot_right: C3,
col_bot_left: C4
) where
C1: Into<ImColor>,
C2: Into<ImColor>,
C3: Into<ImColor>,
C4: Into<ImColor>,
[src]
&self,
p1: [f32; 2],
p2: [f32; 2],
col_upr_left: C1,
col_upr_right: C2,
col_bot_right: C3,
col_bot_left: C4
) where
C1: Into<ImColor>,
C2: Into<ImColor>,
C3: Into<ImColor>,
C4: Into<ImColor>,
Draw a rectangle whose upper-left corner is at point p1
and lower-right corner is at point p2
.
The remains parameters are the respective color of the corners
in the counter-clockwise starting from the upper-left corner
first.
pub fn add_triangle<C>(
&'ui self,
p1: [f32; 2],
p2: [f32; 2],
p3: [f32; 2],
c: C
) -> Triangle<'ui> where
C: Into<ImColor>,
[src]
&'ui self,
p1: [f32; 2],
p2: [f32; 2],
p3: [f32; 2],
c: C
) -> Triangle<'ui> where
C: Into<ImColor>,
Returns a triangle with the given 3 vertices p1
, p2
and p3
and color c
.
pub fn add_circle<C>(
&'ui self,
center: [f32; 2],
radius: f32,
color: C
) -> Circle<'ui> where
C: Into<ImColor>,
[src]
&'ui self,
center: [f32; 2],
radius: f32,
color: C
) -> Circle<'ui> where
C: Into<ImColor>,
Returns a circle with the given center
, radius
and color
.
pub fn add_text<C, T>(&self, pos: [f32; 2], col: C, text: T) where
C: Into<ImColor>,
T: AsRef<str>,
[src]
C: Into<ImColor>,
T: AsRef<str>,
Draw a text whose upper-left corner is at point pos
.
pub fn add_bezier_curve<C>(
&'ui self,
pos0: [f32; 2],
cp0: [f32; 2],
cp1: [f32; 2],
pos1: [f32; 2],
color: C
) -> BezierCurve<'ui> where
C: Into<ImColor>,
[src]
&'ui self,
pos0: [f32; 2],
cp0: [f32; 2],
cp1: [f32; 2],
pos1: [f32; 2],
color: C
) -> BezierCurve<'ui> where
C: Into<ImColor>,
Returns a Bezier curve stretching from pos0
to pos1
, whose
curvature is defined by cp0
and cp1
.
pub fn with_clip_rect<F>(&self, min: [f32; 2], max: [f32; 2], f: F) where
F: FnOnce(),
[src]
F: FnOnce(),
Push a clipping rectangle on the stack, run f
and pop it.
Clip all drawings done within the closure f
in the given
rectangle.
pub fn with_clip_rect_intersect<F>(&self, min: [f32; 2], max: [f32; 2], f: F) where
F: FnOnce(),
[src]
F: FnOnce(),
Push a clipping rectangle on the stack, run f
and pop it.
Clip all drawings done within the closure f
in the given
rectangle. Intersect with all clipping rectangle previously on
the stack.
Trait Implementations
impl<'ui> Drop for WindowDrawList<'ui>
[src]
Auto Trait Implementations
impl<'ui> !RefUnwindSafe for WindowDrawList<'ui>
impl<'ui> !Send for WindowDrawList<'ui>
impl<'ui> !Sync for WindowDrawList<'ui>
impl<'ui> Unpin for WindowDrawList<'ui>
impl<'ui> !UnwindSafe for WindowDrawList<'ui>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,