muhuk / yer

A terrain generation toolkit
GNU General Public License v3.0
0 stars 0 forks source link

Viewport interactions should only work when the mouse is over the viewport. #15

Closed muhuk closed 1 month ago

muhuk commented 1 month ago

Currently viewport renders to the entire window, and egui is overdrawn on top of it. So keyboard & mouse interactions happens as long as the window (app) is active.

Possible solutions:

muhuk commented 1 month ago

Render onto egui's central panel. This makes the UI architecture a bit questionable.

This example illustrates how a camera can be targeted to render onto an image.

muhuk commented 1 month ago

Using bevy UI and setting FocusPolicy::Block does not product desired effect. Viewport interation still works when the mouse is over the UI node.

Instead of the 2 methods mentioned above, detection of the UI section mouse is over is necessary.