[UPBGE0.36]Mini map python

Опубликовано: 20 Май 2026
на канале: Blender [BGE] (Light Rays Underwater)
103
6

download .blend
https://drive.google.com/drive/folder...

python
--------------------
import bge

def setup_split_screen_with_minimap():
Get the current scene
scene = bge.logic.getCurrentScene()

Get the two camera objects (player view and minimap)
camera1 = scene.objects['Camera1'] # Main player view
camera2 = scene.objects['Camera2'] # Minimap view

Get the window size
width = bge.render.getWindowWidth()
height = bge.render.getWindowHeight()

Set viewport for Camera 1 (main player view, full screen)
camera1.useViewport = True
camera1.setViewport(0, 0, width, height) # Full screen

Set viewport for Camera 2 (minimap view in the bottom-left corner)
minimap_width = width // 4 # 1/4th of the screen width
minimap_height = height // 4 # 1/4th of the screen height

camera2.useViewport = True
Set the viewport to start from the bottom-left (0, 0)
camera2.setViewport(0, 0, minimap_width, minimap_height) # Bottom-left corner

Call the setup function
setup_split_screen_with_minimap()