Closed kyrosle closed 1 year ago
Yeah, each screen_print!
call has a "slot." And calling it repetitively will overwrite the previous value, even within the same frame. The workaround is to first collect your iterator and then screen_print!
the resulting value.
// WORKAROUND:
// do not do this
for foo in &iterator {
screen_print!("{foo:?}");
}
// do this instead
let foos: Vec<_> = iterator.iter().collect();
screen_print!("{foos:#?}");
This is not a trivial fix because, I need to be able to "identify" the line to print, so that calling it once per frame doesn't spawn an additional line per frame, but rather just replaces the previous line.
all right, thanks for you reply
Would you consider changing this? I'm using this for my game and I would like to log messages when clients connect.
Naturally, if two clients connect in quick succession, I don't see what I expect. Maybe an optional parameter?
I've missed this functionality myself a bunch. This is a good reason to add it.
Fixed by 0e19579
Wow, awesome! Thank you so much!
hello , i feel confused when i am using the
screen_paint!
in my query in the system function, my query type is such asquery: Query<&GlobalTrasnform>
, then the using postion isscreen_print!("{:?}", trans.translation())