diff --git a/automated_updates_data.json b/automated_updates_data.json index 2fa8e494dbb..09d9b4c983a 100644 --- a/automated_updates_data.json +++ b/automated_updates_data.json @@ -104,6 +104,10 @@ { "date": "2026-07-07", "summary": "Improved keyboard docs: added 'Key just pressed' (held vs one-frame) and 'Any key released' conditions, control-remapping note, and a reference list of valid key names" + }, + { + "date": "2026-07-24", + "summary": "Improved filesystem docs (added Read a directory action, User's Home and executable-file expressions, and path-parsing expressions), fixed text entry reference link, and clarified screenshot .png auto-append and platform support" } ] } diff --git a/docs/gdevelop5/all-features/filesystem/index.md b/docs/gdevelop5/all-features/filesystem/index.md index a53d7d5ad6a..a50a213b569 100644 --- a/docs/gdevelop5/all-features/filesystem/index.md +++ b/docs/gdevelop5/all-features/filesystem/index.md @@ -192,6 +192,15 @@ It is advised to use the expressions for special folders (see below) to keep you ** (Optional) Result variable: ** Variable to store the result. It can either hold the value 'ok': the task was successful or 'error': an error occurred. The variable will be updated, at the moment the file operation has finished. +--- + +#### Read a directory +This action reads the contents of a directory (all files and sub-directories) and stores them in an array variable. +== Parameters == +** Directory path: ** The absolute path of the directory to read. + +** Variable to store the result: ** It is set to `"error"` if an error occurred, otherwise it is filled with an array containing the names of all files and sub-directories present in the directory. + ## Expressions These expressions return the path to special folders on the users' operating system. If you use these expressions for loading and saving files it will be guaranteed to work on all supported operating systems. (Currently Windows, Linux, and macOS) !!! tip @@ -202,8 +211,10 @@ This expression returns the operating system independent path to the _Desktop_ f #### Documents folder This expression returns the operating system independent path to the _Documents_ folder of the user that runs your game. This is the standard folder for storing documents. -#### This games executable folder +#### Game executable folder This expression returns the operating system independent path to the folder where your game is being executed from. +#### Game executable file +This expression returns the operating system independent path to your game's executable file itself (not just the folder that contains it). #### Pictures folder This expression returns the operating system independent path to the _Pictures_ folder of the user that runs your game. This is the standard folder for storing images. @@ -213,10 +224,21 @@ This folder is used for temporary files that your operating system can delete at #### Userdata folder This expression returns the operating system independent path to the _UserData_ folder of the user that runs your game. This folder is used for storing application settings. +#### User's Home folder +This expression returns the operating system independent path to the current user's _Home_ folder. #### Path delimiter This expression returns the operating system independent path delimiter character. ("\" on Windows and "/" on Linux and macOS). Use this expression to build cross-platform file paths that can be accessed on all supported operating systems. +The following expressions help you extract parts of an existing path, which is convenient when you list a directory or process file paths chosen by the player: + +#### Get directory name from a path +This expression returns the portion of a path that represents the directories, without the ending file name. +#### Get file name from a path +This expression returns the name of the file (with its extension, if any) from a path. +#### Get the extension from a file path +This expression returns the extension of the file designated by the given path, including the leading period (for example: `.txt`). + ## Example In order to save a screenshot to the _Pictures_ directory you could write: diff --git a/docs/gdevelop5/all-features/screenshot/index.md b/docs/gdevelop5/all-features/screenshot/index.md index bb4518a4228..cb27df8a61c 100644 --- a/docs/gdevelop5/all-features/screenshot/index.md +++ b/docs/gdevelop5/all-features/screenshot/index.md @@ -19,7 +19,11 @@ Use this action to save a screenshot of everything which is currently drawn on t The save path needs to be an absolute path on the file system (Like "C:\MyFolder\MyScreenshot.png" on Windows)' -Relative paths are not supported. +Relative paths are not supported. If the path does not end with `.png`, this extension automatically appends it. + +!!! note + + Taking a screenshot only works on games exported for Windows, Linux and macOS. It is not supported on web or mobile games. !!! note diff --git a/docs/gdevelop5/objects/text_entry/index.md b/docs/gdevelop5/objects/text_entry/index.md index 69032879432..fa1ed769432 100644 --- a/docs/gdevelop5/objects/text_entry/index.md +++ b/docs/gdevelop5/objects/text_entry/index.md @@ -51,4 +51,4 @@ Using events, it is possible to enable or disable the "Text entry" object. Event ## Reference -All actions, conditions and expressions are listed in [the shape painter reference page](/gdevelop5/all-features/text-entry-object/reference/). \ No newline at end of file +All actions, conditions and expressions are listed in [the text entry object reference page](/gdevelop5/all-features/text-entry-object/reference/). \ No newline at end of file