diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-09 10:44:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-09 10:44:43 +0200 |
commit | 02db5738a7880e7a79402c6a8d0ffdd2ea7bf5c8 (patch) | |
tree | 8d67aedf1aef06bb8b9c71c19829b61207b9889e /doc/classes/ScrollContainer.xml | |
parent | e0df3be64f5058f8c1c93b66fed769085fa0ef25 (diff) | |
parent | 83626ab90db2dee1152d3e147e44aac658b92067 (diff) | |
download | redot-engine-02db5738a7880e7a79402c6a8d0ffdd2ea7bf5c8.tar.gz |
Merge pull request #70564 from stmSi/cant-set-srollcontainer-scrollvalue-in-ready
Fix: Can't set ScrollContainer `scroll_*` value in _ready()
Diffstat (limited to 'doc/classes/ScrollContainer.xml')
-rw-r--r-- | doc/classes/ScrollContainer.xml | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index 65814d4359..cfc4ca6b4f 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -52,13 +52,23 @@ 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_horizontal_custom_step" type="float" setter="set_horizontal_custom_step" getter="get_horizontal_custom_step" default="-1.0"> Overrides the [member ScrollBar.custom_step] used when clicking the internal scroll bar's horizontal increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused. </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="scroll_vertical_custom_step" type="float" setter="set_vertical_custom_step" getter="get_vertical_custom_step" default="-1.0"> Overrides the [member ScrollBar.custom_step] used when clicking the internal scroll bar's vertical increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused. |