Split-screen layouts for local multiplayer
In your harnessGodot componentMIT
Compute view rectangles for one to many local players (halves, one wide plus two, grids with full-width last rows), with gaps between views, and place Control nodes such as SubViewportContainers on them.
ATTRIBUTION.mdLICENSEREADME.mdbaltor_test.gdcomponent.jsoninspect_gdscript.pyrun_tests.gdsplit_screen_layout.gdtest_package.pytests/test_split_screen_layout.gdverification/native.json
Full files in your harness.
What it takes and gives
- Class
- BaltorSplitScreen, extends RefCounted
- Methods
- layout(count: int, screen: Rect2, stacked: bool = false, gap: float = 0.0) -> Array[Rect2]; arrange(controls: Array, screen: Rect2, stacked: bool = false, gap: float = 0.0) -> int
- Placement
- res://baltor/godot_components/split_screen_layout/
Limits. Rectangles only; creating SubViewports, cameras and input routing per player is up to you. Views in a grid differ in size when the last row is short. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.
Details
- Kind
- Godot component
- Engine
- Godot 4.3 or later
- Files
- 11 files, 72.0 KB
- Licence
- MIT
- Declared effects
- reads files, runs commands
- Checked with
- Godot 4.7.2, headless
- Checks
- godot parse check only, godot gdscript tests, godot tests reject gutted component, godot editor import, godot contract reflection, godot readme usage compiles
- Techniques
- screen partitioning, grid layout with gaps
- Tags
- split screen, multiplayer, local coop, layout, viewport, ui
- Identity
library.supply.creative_originals.a116c107c84ec658ebd6c7d5.27a7684b0b5adfb3- Version
27a7684b0b5adfb3a8c7ea49bad041f3c858b7902f4bb485f380d4a17605b802
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.