Skip to content
EtchStable · 2.15.0
Etch on GitHub

Zoom and resolution

Choose the screen size the preview lays a window out at, and zoom in or out without changing it.

Zoom, 7 s, silent. The pointer rests just above the province view's tabs. Ctrl+mouse wheel zooms the preview in two whole steps, 200 % and 300 %, around the pointer, game pixels sharp; a click on the zoom level fits it again.

Two things set how big a window looks in the preview. The preview resolution is the size of the game’s screen the window is laid out at, as on a player’s monitor. The zoom only makes the drawing bigger or smaller in the panel, and never changes the layout.

By default the preview uses the resolution in your game’s settings.txt, else your monitor’s. The resolution button in the toolbar shows it, such as 1920×1080. Point at it to read where it comes from.

The resolution changes what the game itself changes with the screen size:

  • which of a _large pair the game creates: the small widget on a screen less than 814 pixels high, the _large one from 814 pixels;
  • the if_resolution blocks of a .gui file, such as the ones in the base game’s countrydecisionsview.gui;
  • the Screen height selector in Selectors… of View ▾, for a window with a window profile.
  1. Click the resolution button in the toolbar, or run Etch: Choose the Preview Resolution from the Command Palette (Ctrl+Shift+P). The list opens on your current choice: it is first, under Current, with a check mark, so Enter keeps it.
  2. Choose one:
    • Default: your game’s settings.txt, else your monitor;
    • Native: your monitor’s resolution;
    • one of the sizes under Corpus resolutions, the screen sizes at which Etch’s drawing is compared with the game’s: 1280×720, 1366×768, 1600×900, 1680×1050, 1920×1080, 2560×1440, 3440×1440 or 3840×2160;
    • any other size: type its width × height in pixels in the box at the top of the list, such as 2560x1440. The size shows as the first item as soon as you have typed it; press Enter to choose it. Custom…, at the end of the list, asks for the size in a box of its own instead.

The preview lays the window out again at that size, and the resolution button shows it.

Etch keeps your choice in the setting etch.previewResolution: default, native, or a width × height such as 1920x1080. When your workspace settings already have it (for a folder you opened, its .vscode/settings.json), Etch changes it there. Otherwise it saves it in your user settings, which hold for every folder you open. You can also type it in the settings yourself. When Etch cannot read the value, a notice above the window says so, and the preview uses the default.

The preview opens at Fit window: the window you preview fills the panel, in its middle, but never above 100 %. A small window, such as a bar of 390 × 32 pixels, shows at 100 % in the middle of the panel, not in a corner of the whole screen. Fit screen fits the whole game screen instead. The grey backdrop fills the panel, and a dashed line marks the edge of the game screen.

When you select a widget outside the panel, in the source or the Widget Outline, the preview moves to it at the same zoom level. Under Fit window this happens to a widget placed beyond the window’s size: the preview leaves Fit window and keeps its zoom level, such as 100 %.

At 100 %, one pixel of the game’s screen is one pixel of your monitor, as the game shows it. Above 100 % only whole steps are offered, 200 % to 800 %, so that pixels stay sharp.

To Do this
Zoom in or out around the pointer Ctrl + mouse wheel, or Ctrl+= and Ctrl+-
Zoom in or out around the middle click + or − in the toolbar
Go to 100 % Ctrl+0
Fit the window into the panel Ctrl+Shift+0
Fit the whole screen into the panel Ctrl+Shift+0 again
Fit the window or the screen, or pick 50 %, 100 %, 200 % or 400 % click the zoom level, such as “Fit window · 100 %”, and pick in its menu
Move around a zoomed screen the mouse wheel (Shift + wheel sideways), or drag

Ctrl with the numeric keypad’s +, − and 0 works too. After you click in the preview, these keys zoom the preview instead of VS Code.

  • Drag with the left or the middle mouse button. A drag does not count as a click on a widget.
  • Clicking a widget, pointing at it and the outline of the highlighted widget work at any zoom. When the widget you highlight from the editor or the Widget Outline is outside the visible part of the preview, the preview moves to put it in the middle.
  • The preview keeps its zoom when VS Code reloads its window.
  • The preview lays windows out at UI scale 1.0 only. When your game’s settings.txt sets another game_ui_scale, a notice says so, and the preview still draws at 1.0.
  • 3840×2160 has not been checked against the game: the list marks it “not yet measured against the game”.
  • Zoom never changes the layout. To see a window at another screen size, change the resolution.