# Split Screen Resolution Problem (Game Engine)

So when I run the game with the Embedded Player the split screen works but when I run it Standalone the size of the camera is changed.

Embedded:

Standalone:

I would like to make the standalone look like the Embedded.

Here is the code for the split screen if that is needed:

from bge import logic, render
camList = logic.getCurrentScene().cameras

cont = logic.getCurrentController()
own = cont.owner
cam1 = camList[own['cam1']]
cam2 = camList[own['cam2']]

width = render.getWindowWidth()
height = render.getWindowHeight()

cam1.setViewport(0, 0, int(width/2), height)
cam2.setViewport(int(width/2), 0, width, height)

cam1.useViewport = True
cam2.useViewport = True


Thanks!

• Try the following with the mouse cursor over the 3D Viewport: 1st press Alt+F11 to switch to fullscreen mode; 2nd press Alt+F10 to maximize the viewport with no UI. This should display your in-blender results with the same resolution as the fullscreen stand-alone. – MarcClintDion May 31 '15 at 3:45

I have that problem too. Try making the focal area larger, although it may be an issue with having two cameras.

Although, the snarky answer would be to restore down the game window.

Or you could do it like MarcClintDion commented. But really, make a note of the position of each camera, and slowly move them until you get the results you want.

Also, check if it's only going to fail with width. See if you can't stack the screens on top of each other, and see what effect that has on the width.

• How exactly do you "stack screens"? – Blender Warrior Jun 6 '15 at 5:48
• He's trying to split the screen vertically. I'm wondering if he gets a similar effect if he tries to split the screen horizontally, so that the cut is across the x-axis. – Nefer007 Jun 7 '15 at 1:05

That's not actually a problem and this is normal. Its not the camera but its probably the game trying to stretch itself to fit the screen completely. Also, try zooming in the "3D Viewport" in the camera until all those dotted lines (if you have seen them before) are gone once they disapear imediatelly stop zooming. Should look like this:

The image below has dotted lines but if I zoom in just until the dotted lines go away.

Now here thats what happens when you zoom in (look at the image below) the camera until the dotted lines disappear.

Just keep adjusting your zoom on camera or the cameras perspective and run the game and repeat this over and over until your Standalone looks a little bit better. Everyone goes through "Trial and Error" eventually we make it and it works :D.

After reading for more than a year I am neither an expert nor a guru, but I have compiled many notes, of which I keep the ones that have been useful for me to learn or solve problems with bge

This is one, from which I did not find the page or more information, but maybe it is useful, I still do not apply it

Create a script for the top screen with the following: (you can name it"top_screen")

import *

own = GameLogic.getCurrentController().getOwner()

own.enableViewport(1)
own.setViewport(0, 384, 1024,768)

1. Create a camera or use the default one
2. In the logic key create a sensor then a controller
3. Make sure the controller is a "python" and name the script "top_screen" (or whatever name you have for the "top screen" script you created)

Note: Case sensitive names so make sure where it says (Script:) in the "controller/python" it is typed exactly the same as the name of the script you created)

Now create a script for the bottom screen with the following: (you can name it"bottom_screen")

import *

own = GameLogic.getCurrentController().getOwner()

own.enableViewport(1)
own.setViewport(0, 0, 1024, 384)

1. Create another camera
2. In the logic key create a sensor then a controller
3. Make sure the controller is a "python" and name the script "bottom_screen" or whatever name you have for the bottom screen script you created

There now test!!!! At least make sure you have like a stage or something that is colourful or at least so you can tell its split screen

Note: Make sure your header is pulled all the way down for full results of the split screen code

now you can play around with the python and see what it does pretty simple yet complicated... (oh yeah the thing to play around with is highlighted green).

• @hehehehaah you use something like this youtu.be/-TtTBGSOii4 – user55877 May 11 '18 at 17:59
• i show you something like a THATIMST3R ttps://youtu.be/A2PxbXsu5oY – user55877 May 11 '18 at 18:02

Change the resolution (width) of the embedded player to half of the standalone resolution and it will work!

set the resolution (width) of embedded player half of the standalone player & vice versa for vertical split.﻿

• Could you provide a bit more details to make it clear what you mean for the OP? For example, why does that work? Why doesn't his? – JakeD Dec 10 '16 at 13:05
• i had the same problem exact smae problem – Parveen Saksena Dec 12 '16 at 4:10
• and this fixed it – Parveen Saksena Dec 12 '16 at 4:10
• the youtube tutorial from where he took the code a\has it(the solution to the problem) in the comments. at least try too see if it works it did for me – Parveen Saksena Dec 12 '16 at 4:11
• and can u help me with blender.stackexchange.com/questions/69005/… – Parveen Saksena Dec 12 '16 at 4:11