Class SplitScreenLayoutCalculator
Pure computation of per-player ViewportRect slots from a player count and a
requested SplitScreenLayout. All rects use the engine viewport convention
where Y=0 is the BOTTOM of the screen and Y increases upward (Unity's Camera.rect
normalized space), not the top-left-origin convention common in UI layout.
Inherited Members
Namespace: Serenity.GameCamera.Domain.Services
Assembly: Serenity.GameCamera.Domain.dll
Syntax
public static class SplitScreenLayoutCalculator
Remarks
Edge-case precedence: extreme player counts win over the requested layout. A count of 1 always yields a single full-screen rect regardless of layout; a count above 4 always degrades to one full-screen rect per player (see Compute(int, SplitScreenLayout) for details), even when Quadrants was explicitly requested.
Methods
Compute(int, SplitScreenLayout)
Computes the ordered list of viewport rects for each player, index 0 first.
Declaration
public static IReadOnlyList<ViewportRect> Compute(int playerCount, SplitScreenLayout layout)
Parameters
| Type | Name | Description |
|---|---|---|
| int | playerCount | Number of active players; must be greater than zero. |
| SplitScreenLayout | layout | The requested split-screen layout. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<ViewportRect> | A list of exactly
|
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when |