raylib ui: common state update function (#35546)

* add _update_state

* nonlya

* visible already does this for us!

* do hud renderer and exp button

* temp

* this really needs some type of timer like QT

* this really needs some type of timer like QT

* todo

* use in model renderer

* Revert "use in model renderer"

This reverts commit d35f774155c9875209d06b8cd0b4849b1d8a60c4.

* no passing rect

* cl

* unused now
This commit is contained in:
Shane Smiskol
2025-06-12 21:22:13 -07:00
committed by GitHub
parent f275d6d892
commit 25e123a23a
6 changed files with 18 additions and 24 deletions
+5
View File
@@ -34,6 +34,8 @@ class Widget(abc.ABC):
if rect is not None:
self.set_rect(rect)
self._update_state()
if not self.is_visible:
return None
@@ -56,6 +58,9 @@ class Widget(abc.ABC):
def _render(self, rect: rl.Rectangle) -> bool | int | None:
"""Render the widget within the given rectangle."""
def _update_state(self):
"""Optionally update the widget's non-layout state. This is called before rendering."""
def _update_layout_rects(self) -> None:
"""Optionally update any layout rects on Widget rect change."""