Skip to content

Aspect Ratio

App: apps/aspect_ratio_demo/

Demonstrates a fixed design resolution (1280×720) with letterbox scale mode. The game logic and GUI think in 1280×720; the engine scales to the window and adds black bars when the aspect ratio doesn’t match.

Terminal window
% ./plume3d aspect_ratio_demo

or

Terminal window
% ./../plume3d .
  • Sets in game.toml: design_width = 1280, design_height = 720, scale_mode = "letterbox".
  • A small GUI window shows the design size, current window size, and tells you to resize to see the letterbox bars.
  • WindowgetWidth(), getHeight() (window size); design size and scale mode come from config.
  • GuibeginWindow, layoutRowDynamic, label, endWindow.
[Window]
width = 800
height = 600
resizable = true
design_width = 1280
design_height = 720
scale_mode = "letterbox"