#Child of Nodebundle not rendering

3 messages · Page 1 of 1 (latest)

rain bear
#

Anyone have any thoughts why this child is not rendering? This is ultimately going to be a row/column display with data. Right now I am trying to just get the pieces in the correct hierarchy, but this isn't working.

fn row_element(
mut commands: Commands,
){

commands
    .spawn(NodeBundle{
        style: Style {
            display: Display::Flex,
            width: Val::Percent(80.),
            height: Val::Percent(40.),
            bottom: Val::Px(300.),
            flex_direction: FlexDirection::Column,
            flex_wrap: FlexWrap::Wrap,

            ..default()
        },
        visibility: Visibility::Visible,

        ..default()
    }).insert(RowElementParent);
#

fn update_row_element(
mut commands : Commands,
mut entity_query: Query<Entity, &RowElementParent>,
mut style_query: Query<&mut Style, &RowElementParent>,
resize_event: Res<Events<WindowResized>>,

                 ) {

let mut event_reader = resize_event.get_reader();

for event in event_reader.iter(&resize_event) {

    for mut entity in entity_query.iter_mut() {


       for i in 0..2 {

       let child = commands.spawn(TextBundle::from_section(
                                "test2".to_string(),
                                TextStyle {
                                    font_size: 60.0,
                                    color: Color::rgb(0.9, 0.0, 0.9),
                                    ..default()
                                },

                                )

                                .with_style(Style {
                                    width: Val::Px(event.width * 0.2),
                                    height: Val::Px(event.height * 0.2),
                                    flex_wrap: FlexWrap::Wrap,
                                    //left: Val::Px(100.0),
                                ..default()
                                },)

                                .with_background_color(Color::rgb(0.9, 0.9, 0.9))

                                ).id();

        commands.entity(entity).push_children(&[child]);
#

the text bundle is not rendering