From d7fe7d4565c6f37ea9fc724436df2e85ee8fced2 Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Fri, 27 Mar 2026 08:26:27 +0000 Subject: [PATCH] [Auto] [Update] Document JS type error preference and scroll position saving in JS events --- automated_updates_data.json | 2 +- docs/gdevelop5/events/js-code/index.md | 2 +- docs/gdevelop5/preferences.md | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/automated_updates_data.json b/automated_updates_data.json index 8a7b974c5c..b2aeca7c90 100644 --- a/automated_updates_data.json +++ b/automated_updates_data.json @@ -1,5 +1,5 @@ { - "last_automated_updates_commit": "50afd05049bc87c288dc4c7ccbce55388522fe53", + "last_automated_updates_commit": "ec1b477c74811b1dac3bb8aa7aa54040126d52a3", "last_improved_things": [ { "date": "2026-02-16", diff --git a/docs/gdevelop5/events/js-code/index.md b/docs/gdevelop5/events/js-code/index.md index 76534ffa5c..7e0cb0aa64 100644 --- a/docs/gdevelop5/events/js-code/index.md +++ b/docs/gdevelop5/events/js-code/index.md @@ -9,7 +9,7 @@ To add a JavaScript event, click on the + button in the Events Sheet toolbar, an ![](pasted/20230305-105515.png) -When added, click on the code to edit it. The code will be executed each time the event is reached by GDevelop. +When added, click on the code to edit it. The code will be executed each time the event is reached by GDevelop. The scroll position and cursor position are saved so that when you reopen the tab, you return to where you were. In all JavaScript events, you have access to a variable named `runtimeScene`. This variable represents the scene being played. Below is an example of a standard GDevelop event, and an equivalent event that uses a JavaScript: diff --git a/docs/gdevelop5/preferences.md b/docs/gdevelop5/preferences.md index 59bf36a165..2a6f40ccbf 100644 --- a/docs/gdevelop5/preferences.md +++ b/docs/gdevelop5/preferences.md @@ -44,6 +44,10 @@ If **Cancel changes** is selected, any edits in the current window are **abandon If **Apply changes** (default) is selected, any edits in the current window are **applied** (only available in some windows). +## JavaScript events + +In the preferences, you can enable **Show type errors in JavaScript events** to display type checking errors directly in the JavaScript code editor. This can help catch mistakes such as calling a method that doesn't exist on an object. It is off by default to keep the editor uncluttered while you write code. + ## Hints and explanations GDevelop displays hints and explanations for certain features. You can turn them off if you prefer.