sysSetMonitor

Category: System

Syntax:

sysSetMonitor:Void(monitor:Int)


Parameters

Returns

Void



Summary

Chooses which monitor the window will open on.

Takes monitor (the monitor number, zero-based).

Returns nothing.

Must be called BEFORE b2dGraphics - it selects where the window is created, so it has no effect once the window exists. Monitors are numbered from ZERO, so a valid monitor number is 0 to sysGetMonitors() - 1. An out-of-range number returns 0.

Linux edition only - this function has no Windows counterpart, so it is not in the online documentation.



Example
; Open fullscreen on the second monitor at its exact resolution,
; so the frame fills it 1:1 with no letterboxing.
If sysGetMonitors() > 1 Then
	sysSetMonitor(1)
EndIf
Local m:Int = sysGetMonitor()
b2dGraphics(sysGetMonitorWidth(m), sysGetMonitorHeight(m), 0)

BambooBasic © 2026 Michael Denathorn