#Changing the position of text after the text is spawned
4 messages · Page 1 of 1 (latest)
if you're using text bundle, then it's using the ui layout system, which has a transform but it's calculated based on the style:
/// This field is automatically managed by the UI layout system.
/// To alter the position of the `NodeBundle`, use the properties of the [`Style`] component.
pub transform: Transform,
if you're using absolute position for your text then you can modify style.position instead
fn move_text(mut styles_query: Query<&mut Style>) {
for mut style in styles_query.iter_mut() {
style.position.top.try_add_assign(Val::Px(1.0)).ok();
}
}
this will move the text down 1px every time it runs