Skip to content

Tagging ImageBundle makes it disappear #1329

@smokku

Description

@smokku
  • Bevy version: 0.4
  • Operating system: Windows 10

I am building an UI and have an absolutely positioned image using ImageBundle. It works until I add an additional component to it (no matter empty or not) - image then disappears.

        .spawn(ImageBundle {
            style: Style {
                size: Size::new(Val::Px(25.0), Val::Px(25.0)),
                position_type: PositionType::Absolute,
                position: Rect {
                    left: Val::Px(10.0),
                    bottom: Val::Px(10.0),
                    ..Default::default()
                },
                ..Default::default()
            },
            material: materials.add(asset_server.load("crosshairs/crosshair026.png").into()),
            ..Default::default()
        })
        .with(control::MouseCursor)

The same code, but with TextBundle works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions