Viewports: Blender 3D Game Engine



pageok

 
5.  Optional:  Add a Bool Property named Vertical
 
Note:

The optional bool property named Vertical allows you to change the position of the viewports.
Vertical = False (default)
Viewports occupy top and bottom half of game screen.
Vetical = True
Viewports occupy left and right sides of game screen.

Note:
Property must be named Vertical.  Can't be named Fred or vertical or anything else.  The python code looks for a Property attached to the camera named Vertical.

Add a Bool Property named Vertical to the Camera
Buttons Window menu >> Logic (F4)
Add Property button
Type:  Bool
Name:  Vertical

  
6.  Add Viewport.py to the Text Editor

Note:
If you downloaded either the starting blend or the finished blend, you can find Viewport249.py and Viewport250.py in the Text Editor.  

Download:

Text Editor menu >> Text >> Open
Rename Viewport249.txt to Viewport.py

 
  
7.  Add an always sensor set to run once

Camera selected

Buttons Window menu >> Logic (F4)
Sensors
Add
Always
Set to Run Once

 
   
8.  Add a Python Controller

Camera selected

Buttons Window menu >> Logic (F4)
Controllers
Add
Python
 Script:  Viewport.py

 

 
  
pageok