You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having animation for GUIs is the logical next step. Such animations often contain some rotation of widgets.
Also playful menus sometimes rotate the buttons to present them in a game specific style.
Known issues:
Rect does not support rotation
Rect: In bounce checks do not support rotation
Rotating the content of a widget messes up the required space, so layouts are not able to deal with them
First Brainstorming
UIWidgets keep non rotated rect, but the inside content_rect can be rotated.
In this case it will shrink to stay within bounce of the rect (inc border and padding)
Such implementation will also not interfere with the layouts.
TL;DR: Rect is a doc issue + we're touching on larger hitbox / layout design which may need post-3.0 thought
Rect does not support rotation
Rect is an AABB. I merged @DigiDuncan's Rect PR without a thorough doc proof-reading pass because we needed the features ASAP.
I agree the current Rect could be clearer about the AABB. We could probably fit it in the first line of the docstring and after as something like this:
An Axis-Aligned Bounding Box (AABB).
Since it is axis-aligned, you will need to $WORLD_SPACE_TRANSFORM
I can work on this change in a bit. As to the larger set of concerns, I brought some of this up with the pyglet team in the past:
It would be good to have a HasLayoutProperties annotation as a Protocol type or similar:
Activity
eruvanos commentedon Sep 29, 2024
@DragonMoffon @pushfoo any thoughts?
pushfoo commentedon Oct 1, 2024
TL;DR: Rect is a doc issue + we're touching on larger hitbox / layout design which may need post-3.0 thought
Rectis an AABB. I merged @DigiDuncan'sRectPR without a thorough doc proof-reading pass because we needed the features ASAP.I agree the current
Rectcould be clearer about the AABB. We could probably fit it in the first line of the docstring and after as something like this:I can work on this change in a bit. As to the larger set of concerns, I brought some of this up with the pyglet team in the past:
HasLayoutPropertiesannotation as aProtocoltype or similar:The summary is:
radius = max(dist(pt, points.centroid) for pt in points)