|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
Dlean Jeans |
I couldn’t find any solutions for this except for all the posts linking to the so-called deleted demo project split_screen_platformer
(link: https://github.com/godotengine/godot-demo-projects/tree/master/2d/split_screen_platformer ).
|
|
|
|
Reply From: |
SIsilicon |
I created a split screen before in 3D.
All I did was create two viewports, each with their own camera, and show their textures in two texture_rects.
The same should apply in 2D, except you would need to use a camera2D instead (duh). And you may need to clear the world2D that it comes with.
view_port.world_2D = null
By the way I was basing that statement off of the viewport document, which looks kinda outdated; so you may want test that out yourself.
|
|
|
|
Reply From: |
Dlean Jeans |
After looking at the source code of the deleted demo project,
this is what works for me:
And the script:
var world = $ViewportContainer/Viewport.find_world_2d()
$ViewportContainer2/Viewport.world_2d = world
Old demo links:
The code for parallax and split modes is also available in the last link.