macro_rules! arrow {
(vlogger: $vlogger:expr, target: $target:expr, $surface:expr, $($arg:tt)+) => { ... };
(vlogger: $vlogger:expr, $surface:expr, $($arg:tt)+) => { ... };
(target: $target:expr, $surface:expr, $($arg:tt)+) => { ... };
($surface:expr, $($arg:tt)+) => { ... };
}Expand description
Sends an arrow or multiple arrows to the vlogger.
ยงExamples
use v_log::arrow;
// Points must be of the same type for arrays to work,
// but are only required to implement IntoIterator.
// They can be arbitrary dimension, but only the first 3 are used.
let pos = [3.234, -1.223];
let dir = [0.7071, 0.7071];
let space = [[1.0, 0.0], [0.0, 1.0]];
// Draw an arrow from `pos` pointing in direction `dir` with length 50.0 and thickness 5.0.
// If `dir` has length zero or zero length is specified, a zero length arrow will get sent.
// The label may get displayed, but the size, position and and format is up
// to the vlogger implementation. E.g. it may only be displayed as a tooltip.
arrow!("main_surface", pos, dir, (50.0), 5.0, Base, "Position is: x: {}, y: {}", pos[0], pos[1]);
arrow!("main_surface", pos, dir, (50.0), 5.0, Base);
// Draw an arrow from `pos` pointing in direction `dir` with the length of `dir` and thickness 5.0.
arrow!("main_surface", pos, dir, 5.0, Base, "Position is: x: {}, y: {}", pos[0], pos[1]);
arrow!("main_surface", pos, dir, 5.0, Base);
// Draw multiple arrows from `pos` and scale them with 50.0.
// The colors are X, Y, Z and then "Missing" for all others.
arrow!("main_surface", pos, space, (50.0), 5.0);