Added note to used set_deferred while setting scroll values in _ready function.
(cherry picked from commit 83626ab90d
)
This commit is contained in:
parent
42d2187f38
commit
96d658638a
1 changed files with 10 additions and 0 deletions
|
@ -47,12 +47,22 @@
|
|||
</member>
|
||||
<member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0">
|
||||
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_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" default="true">
|
||||
If [code]true[/code], enables horizontal scrolling.
|
||||
</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_enabled" type="bool" setter="set_enable_v_scroll" getter="is_v_scroll_enabled" default="true">
|
||||
If [code]true[/code], enables vertical scrolling.
|
||||
|
|
Loading…
Reference in a new issue