bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.46k stars 3.6k forks source link

bevy_picking UI example #16412

Open richchurcher opened 1 week ago

richchurcher commented 1 week ago

Objective

This example demonstrates responding to picking events within the UI context.

https://github.com/user-attachments/assets/5cca1a82-9646-4e4b-8186-8c3572caebf7

Solution

It's been fun playing with this, but I'm also open to changing it dramatically if it doesn't quite meet our needs. I was trying to think of a way to demonstrate without making the example too complex. With one-shot systems, I may not have succeeded there... but they do reduce the overall masses of nested UI code, which helps with readability.

I'm also aware other examples partially cover this territory, like sprite_picking.

I did have some hover highlighting in there, but took it out to reduce length/complexity.

richchurcher commented 1 week ago

Heh. It kinda broke with some of the latest changes... :eyes: :construction:

... sorted, for the most part.