Skip to content

Conversation

@heytherewill
Copy link
Contributor

This implements a pretty basic, but extensible, layout constraint system.

Right now one can snap the UI on any of the four sides of the screen, center it vertically or horizontally and also force a width or height. We can implement relative layout and other constraints on future iterations.

I'm using the CollisionComponent as the way of indicating the size while using a PositionComponent to indicate where on the screen the UI will be rendered. Do let me know if there are better candidates for either.

Needless to say, this assumes the target batch is a UI batch, since values are based on the size of the screen and are ignoring the camera (though one could make it work by wrapping all components in a parent component that is aware of the camera and moves along with it).

@heytherewill heytherewill force-pushed the will/constraint-layout branch from 41e3814 to 2562964 Compare January 30, 2024 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant