Sugui wrote: Wed Mar 18, 2026 9:23 pm
So I guess that the .Draw() function adds them to the current recording, if there is one. But do elements call .Draw() also when they aren't visible on the screen? Because it can be elements not visible due to the scrollbar progress, but its .Draw() function being called anyways
I should take the time to properly blog about this at some point, but the way UI interaction works here is inspired by how dear imgui (and other similar imgui libraries) do it. During its draw method, widgets "sense" a portion of the screen. This call to .Sense() returns information about UI interaction on that location of the screen for the previous frame[1], so whether the mouse was hovering, clicking or dragging over that screen portion (a rectangle). In my case it's not just the mouse, but also whether key focus was on that widget, and whether the accept button was pressed over that widget.