Hi there, I'm trying to build a screen like this a...
# compose
c
Hi there, I'm trying to build a screen like this and it works fine in two player mode (see the video) because when it's rotated 180 degrees the dimensions are the same, but the 4 player mode (see the screenshot) is giving me a hard time. I know that the graphics layer is what does the rotation, so it doesn't adjust the layout after rotation, but I was wondering if anyone could help me figure out a way to get it to work. Thanks in advance!
a
You can use something like:
Copy code
Modifier
    .layout { measurable, constraints ->
        val placeable = measurable.measure(
            Constraints.fixed(width = constraints.maxHeight, height = constraints.maxWidth)
        )
        layout(constraints.maxWidth, constraints.maxHeight) {
            placeable.place(
                (constraints.maxWidth - placeable.width) / 2,
                (constraints.maxHeight - placeable.height) / 2
            )
        }
    }
    .rotate(90f)
c
This works great! Thanks so much!