bevyengine / bevyengine/bevy

sprite picking not work with fullscreen ui node

Open
#16,342 5 comments 0 reactions 0 assignees View on GitHub
A-Picking C-Bug S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

The release number or commit hash of the version you're using.

0.15.0-rc.3 and lastest #e155fe1d

## \[Optional\] Relevant system information

```
SystemInfo { os: "Linux rolling Arch Linux", kernel: "6.11.6-arch1-1", cpu: "AMD Ryzen 7 5800X 8-Core Processor", core_count: "8", memory: "31.3 GiB" }
AdapterInfo { name: "NVIDIA GeForce GTX 1060 3GB", vendor: 4318, device: 7044, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "565.57.01", backend: Vulkan }
```

## What you did

bevy 2d add a sprite and observe click event and add a fullscreen ui above it .

``` toml
[dependencies]
# bevy = { git = "https://github.com/bevyengine/bevy", features = ["bevy_sprite_picking_backend"]}
bevy = { version = "0.15.0-rc.3", features = ["bevy_sprite_picking_backend"] }
```

```
use bevy::prelude::*;

fn main() {
App::new().add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.run();
}

fn setup(mut commands: Commands) {
commands.spawn(Camera2d::default());

commands
.spawn(Node {
width: Val::Percent(100.),
height: Val::Percent(100.),
justify_content: JustifyContent::SpaceBetween,
..default()
});

commands.spawn(Sprite::from_color(Color::WHITE, Vec2::new(100.0, 100.0))).observe(on_click);
}

fn on_click(trigger: Trigger>,) {
println!("Clicked! {:?}", trigger);
}
```

## What went wrong
click sprite should trigger event

## Additional information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.