Splitscreen

An asset by organicpencil
The page banner background of a mountain and forest
Splitscreen hero image

Quick Information

0 ratings
Splitscreen icon image
organicpencil
Splitscreen

# godot-splitscreenThis addon provides the boilerplate for a standard 1-4 player splitscreen viewport setup. It can add/remove players on-the-fly and responds to changes in window size.Made for Godot 3.1## UsageFirst, instance `res://addons/organicpencil.splitscreen/splitscreen.tscn` somewhere in the tree. Set desired `border_width` and `vertical`.And then...```gdscript# Add a player. Possible values 0 - 3. Returns a TextureRect with some extra goodies attachedvar render = $Splitscreen.add_player(0)# Assign a camera to the viewportvar cam = Camera.new() # Probably want to store a ref to this camera so you can move it laterrender.viewport.add_child(cam)# Add your HUDvar hud = preload("res://path/to/my_hud.tscn").instance()render.add_child(hud)# Player 2render = $Splitscreen.add_player(1)...```Cleaning up when a player leaves:```gdscript$Splitscreen.remove_player(0)```The viewport can be moved to a different parent if you need to change worlds```gdscriptvar viewport = $Splitscreen.get_player(0).viewportviewport.get_parent().remove_child(viewport)my_other_world.add_child(viewport)```Random notes:- The borders aren't actually drawn, so you can just throw whatever behind it to change the color.- You may want to change the settings in `addons/organicpencil.splitscreen/player_viewport.tscn`, depending on your project.

Supported Engine Version
3.1
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
5 years ago
Git URL
Issue URL

godot-splitscreen

This addon provides the boilerplate for a standard 1-4 player splitscreen viewport setup. It can add/remove players on-the-fly and responds to changes in window size.

Made for Godot 3.1

Usage

First, instance res://addons/organicpencil.splitscreen/splitscreen.tscn somewhere in the tree.
Set desired border_width and vertical.

And then...

# Add a player. Possible values 0 - 3. Returns a TextureRect with some extra goodies attached
var render = $Splitscreen.add_player(0)

# Assign a camera to the viewport
var cam = Camera.new() # Probably want to store a ref to this camera so you can move it later
render.viewport.add_child(cam)

# Add your HUD
var hud = preload("res://path/to/my_hud.tscn").instance()
render.add_child(hud)

# Player 2
render = $Splitscreen.add_player(1)
...

Cleaning up when a player leaves:

$Splitscreen.remove_player(0)

The viewport can be moved to a different parent if you need to change worlds

var viewport = $Splitscreen.get_player(0).viewport
viewport.get_parent().remove_child(viewport)
my_other_world.add_child(viewport)

Random notes:

  • The borders aren't actually drawn, so you can just throw whatever behind it to change the color.
  • You may want to change the settings in addons/organicpencil.splitscreen/player_viewport.tscn, depending on your project.

# godot-splitscreen
This addon provides the boilerplate for a standard 1-4 player splitscreen viewport setup. It can add/remove players on-the-fly and responds to changes in window size.

Made for Godot 3.1

## Usage
First, instance `res://addons/organicpencil.splitscreen/splitscreen.tscn` somewhere in the tree.
Set desired `border_width` and `vertical`.

And then...
```gdscript
# Add a player. Possible values 0 - 3. Returns a TextureRect with some extra goodies attached
var render = $Splitscreen.add_player(0)

# Assign a camera to the viewport
var cam = Camera.new() # Probably want to store a ref to this camera so you can move it later
render.viewport.add_child(cam)

# Add your HUD
var hud = preload("res://path/to/my_hud.tscn").instance()
render.add_child(hud)

# Player 2
render = $Splitscreen.add_player(1)
...
```

Cleaning up when a player leaves:
```gdscript
$Splitscreen.remove_player(0)
```

The viewport can be moved to a different parent if you need to change worlds
```gdscript
var viewport = $Splitscreen.get_player(0).viewport
viewport.get_parent().remove_child(viewport)
my_other_world.add_child(viewport)
```

Random notes:
- The borders aren't actually drawn, so you can just throw whatever behind it to change the color.
- You may want to change the settings in `addons/organicpencil.splitscreen/player_viewport.tscn`, depending on your project.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Splitscreen icon image
organicpencil
Splitscreen

# godot-splitscreenThis addon provides the boilerplate for a standard 1-4 player splitscreen viewport setup. It can add/remove players on-the-fly and responds to changes in window size.Made for Godot 3.1## UsageFirst, instance `res://addons/organicpencil.splitscreen/splitscreen.tscn` somewhere in the tree. Set desired `border_width` and `vertical`.And then...```gdscript# Add a player. Possible values 0 - 3. Returns a TextureRect with some extra goodies attachedvar render = $Splitscreen.add_player(0)# Assign a camera to the viewportvar cam = Camera.new() # Probably want to store a ref to this camera so you can move it laterrender.viewport.add_child(cam)# Add your HUDvar hud = preload("res://path/to/my_hud.tscn").instance()render.add_child(hud)# Player 2render = $Splitscreen.add_player(1)...```Cleaning up when a player leaves:```gdscript$Splitscreen.remove_player(0)```The viewport can be moved to a different parent if you need to change worlds```gdscriptvar viewport = $Splitscreen.get_player(0).viewportviewport.get_parent().remove_child(viewport)my_other_world.add_child(viewport)```Random notes:- The borders aren't actually drawn, so you can just throw whatever behind it to change the color.- You may want to change the settings in `addons/organicpencil.splitscreen/player_viewport.tscn`, depending on your project.

Supported Engine Version
3.1
Version String
1.0.0
License Version
MIT
Support Level
community
Modified Date
5 years ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers