From 59f553b30d2bac337ab5d914ab452606de94fe10 Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Tue, 23 Jun 2026 11:13:25 +0000 Subject: [PATCH] [Auto] [Improve] Clarified window resolution vs size, resize mode, expressions, and keyboard conditions --- automated_updates_data.json | 4 ++ docs/gdevelop5/all-features/keyboard/index.md | 4 ++ docs/gdevelop5/all-features/window/index.md | 37 +++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/automated_updates_data.json b/automated_updates_data.json index eb14cff8ead..27b5ca461fc 100644 --- a/automated_updates_data.json +++ b/automated_updates_data.json @@ -92,6 +92,10 @@ { "date": "2026-04-22", "summary": "Improved resources-loading docs (named Preload scene action, documented SceneLoadingProgress expression and AreSceneAssetsLoaded condition, clarified custom loading screen approach) and added extension lifecycle functions table to events/functions docs" + }, + { + "date": "2026-06-23", + "summary": "Improved window docs (game resolution vs window size, resize mode, center window, window icon, fullscreen aspect ratio, useful expressions) and added 'Any key released' condition to keyboard docs" } ] } diff --git a/docs/gdevelop5/all-features/keyboard/index.md b/docs/gdevelop5/all-features/keyboard/index.md index a939ed6bcbe..1d5efb3b52d 100644 --- a/docs/gdevelop5/all-features/keyboard/index.md +++ b/docs/gdevelop5/all-features/keyboard/index.md @@ -9,6 +9,10 @@ GDevelop gives access to all inputs made on the keyboard. This includes conditio For this condition, the corresponding action/s will be performed if any key on the keyboard is pressed. +## Any key released + +For this condition, the corresponding action/s will be performed if any key on the keyboard is released. + ## Key pressed Whenever the key selected while setting this condition is pressed, the corresponding actions are performed. diff --git a/docs/gdevelop5/all-features/window/index.md b/docs/gdevelop5/all-features/window/index.md index c3ef482243a..e2adac4038b 100644 --- a/docs/gdevelop5/all-features/window/index.md +++ b/docs/gdevelop5/all-features/window/index.md @@ -8,6 +8,10 @@ The window of the game is the area in which the game is displayed. It DOES NOT r ## Fullscreen The "De/activate fullscreen" action allows you to toggle the game between fullscreen on/off. When the window is in fullscreen, it will take up as much area as possible. You can control the action using the "YES" and "NO" actions. +For HTML5 (web and mobile) games, this action has a second parameter to keep the aspect ratio of the game (enabled by default). When kept, black borders are added around the game so it is not stretched; when disabled, the game is stretched to fill the whole screen. + +The "Fullscreen activated?" condition lets you check whether the game is currently displayed in fullscreen. + ## Window margins The margin of the window is the distance between the side of the window and the game window displayed. Shown below is the preview of a game with 100 px margins on all 4 sides. @@ -15,6 +19,13 @@ The margin of the window is the distance between the side of the window and the Notice the black borders on all for sides of the window. The width of the borders is 100px. +## Game resolution and window size + +It's important to distinguish two different things: + +* The **game resolution** is the number of pixels rendered in the game area (the "virtual" size of your game). This is what the "Game resolution" action changes. Changing it does **not** change the size of the system window. +* The **window size** is the size, in pixels, of the actual system window on screen. This is what the "Game window size" action changes. Note that this only works on Windows, macOS and Linux: games running in a browser or on mobile can't change their window size (but they can still change their resolution). + ## Size of the window Size of the window is the number of pixels visible in the game. The "Width" field refers to the number of pixels in the horizontal directions while the "Height" field refers to the number of pixels in the vertical direction. @@ -39,6 +50,32 @@ By default, the game name is used for the executable name (on Windows, macOS and With the action to change the title, the title bar on Windows, macOS and Linux will be changed. Nothing will be visible on Android and iOS. For HTML5 games, the web page title will be changed. +## Resolution resize mode + +The "Game resolution resize mode" action controls what happens to the game resolution when the window or screen size changes: + +* `adaptWidth` updates the game width to fit the window or screen (keeping the height). +* `adaptHeight` updates the game height to fit the window or screen (keeping the width). +* An empty value disables automatic resizing. + +The "Automatically adapt the game resolution" action enables or disables this adaptation while the game is running (it only has an effect when the resize mode is set to adapt the width or height). + +## Center the game window + +The "Center the game window on the screen" action moves the window to the center of the screen. This only works on Windows, macOS and Linux (not in a web browser or on iOS/Android). + +## Window's icon + +The "Window's icon" action changes the icon of the game's window at runtime, using an image from your project's resources. + +## Useful expressions + +A few expressions are available to read sizes at runtime: + +* `SceneWindowWidth()` and `SceneWindowHeight()` return the size of the game canvas (the area in which the scene is rendered). +* `ScreenWidth()` and `ScreenHeight()` return the size of the screen (or the browser page for HTML5 games). +* `WindowTitle()` returns the current window title. + ## Reference All actions, conditions and expressions are listed in [the window reference page](/gdevelop5/all-features/window/reference/). \ No newline at end of file