From 25ab61f82a6e8266fc81a8b3fef7a040167f027f Mon Sep 17 00:00:00 2001 From: stmSi Date: Sat, 29 Apr 2023 23:16:38 +0630 Subject: Added note to used set_deferred while setting scroll values in _ready function. (cherry picked from commit 83626ab90db2dee1152d3e147e44aac658b92067) --- doc/classes/ScrollContainer.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index af39261e81..82d5c56d52 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -52,10 +52,20 @@ Deadzone for touch scrolling. Lower deadzone makes the scrolling more sensitive. - The current horizontal scroll value. + The current horizontal scroll value. + [b]Note:[/b] If you are setting this value in the [method Node._ready] function or earlier, it needs to be wrapped with [method Object.set_deferred], since scroll bar's [member Range.max_value] is not initialized yet. + [codeblock] + func _ready(): + set_deferred("scroll_horizontal", 600) + [/codeblock] The current vertical scroll value. + [b]Note:[/b] Setting it early needs to be deferred, just like in [member scroll_horizontal]. + [codeblock] + func _ready(): + set_deferred("scroll_vertical", 600) + [/codeblock] Controls whether vertical scrollbar can be used and when it should be visible. See [enum ScrollMode] for options. -- cgit v1.2.3