UI Toolkit on Splitscreen

So. I have some questions regarding wether UI Toolkit is capable enough for a splitscreen game.

Right now, using the new input system, you have a Multiplayer Event System for each player. That manages it’s canvas.

How does that work with the UI Toolkit? Does it even work or can’t I have multiple players interacting with it’s own UI?

How can you set up a splitscreen UI? Right now with the other method, you set it as Screen Space - Camera and each camera renders it’s UI.

Thanks

You can set some visual element in the root to be at { top=0, bottom = 50%, left=0, right=50%, position=absolute} and it will fit into a quarter of the screen. If the rest of the UI is using flex to place the element, the layout will be good.

What will be more complicated is to manage the events, as there can only be one active click/button at a time. What you will have to do is to keep track of the active/pressed/etc state of the UI, implement your own focus ring if needed, add the necessary class to the object depending on the current state. And possibly set the remapping function so that the pointer does not influence the UI with over states etc…

This is currently quite a piece of work. We need an abstraction for supporting multiples, independent UI right now and it is being under consideration here: https://portal.productboard.com/rcczqdfvurr8zuws3eth2ift/c/1568-support-for-multiplayer-ui

You can upvote the issue to help us prioritize this feature’s development.

Thanks for the input!

It seems overly complicated, and even “useless” doing all of that when we are probably going to need to refractor or redo all of that once it gets implemented. It would be nice a first version just to settle it even if it can change in the future.

I understand that it’s not easy task, but I hope it gets implemented. Thanks