summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorstmSi <stm1998sithumyo@gmail.com>2023-04-29 23:16:38 +0630
committerRĂ©mi Verschelde <rverschelde@gmail.com>2023-05-12 12:31:21 +0200
commit25ab61f82a6e8266fc81a8b3fef7a040167f027f (patch)
treec1c6b39c843f646b7b6b9d816e2d40a91d2f352f /doc/classes
parentb2364048d2b89f5d7781cb25a9d340f0a302c732 (diff)
Added note to used set_deferred while setting scroll values in _ready function.
(cherry picked from commit 83626ab90db2dee1152d3e147e44aac658b92067)
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/ScrollContainer.xml12
1 files changed, 11 insertions, 1 deletions
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.
</member>
<member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0">
- 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]
</member>
<member name="scroll_vertical" type="int" setter="set_v_scroll" getter="get_v_scroll" default="0">
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]
</member>
<member name="vertical_scroll_mode" type="int" setter="set_vertical_scroll_mode" getter="get_vertical_scroll_mode" enum="ScrollContainer.ScrollMode" default="1">
Controls whether vertical scrollbar can be used and when it should be visible. See [enum ScrollMode] for options.