mirror of
https://github.com/godotengine/godot.git
synced 2026-02-07 11:21:49 +00:00
ItemList support center_on_current().
This commit is contained in:
@@ -32,6 +32,15 @@
|
||||
If [param selectable] is [code]true[/code], the list item will be selectable.
|
||||
</description>
|
||||
</method>
|
||||
<method name="center_on_current">
|
||||
<return type="void" />
|
||||
<param index="0" name="center_verically" type="bool" default="true" />
|
||||
<param index="1" name="center_horizontally" type="bool" default="true" />
|
||||
<description>
|
||||
Ensures the currently selected item (the first selected item if multiple selection is enabled) is visible, adjusting the scroll position as necessary to place the item at the center of the list if possible. See also [method ensure_current_is_visible].
|
||||
Fails and prints an error if both arguments are [code]false[/code].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
@@ -54,7 +63,7 @@
|
||||
<method name="ensure_current_is_visible">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Ensure current selection is visible, adjusting the scroll position as necessary.
|
||||
Ensures the currently selected item (the first selected item if multiple selection is enabled) is visible, adjusting the scroll position as necessary. See also [method center_on_current].
|
||||
</description>
|
||||
</method>
|
||||
<method name="force_update_list_size">
|
||||
@@ -240,7 +249,7 @@
|
||||
<param index="0" name="idx" type="int" />
|
||||
<param index="1" name="single" type="bool" default="true" />
|
||||
<description>
|
||||
Select the item at the specified index.
|
||||
Selects the item at the specified index.
|
||||
[b]Note:[/b] This method does not trigger the item selection signal.
|
||||
</description>
|
||||
</method>
|
||||
|
||||
Reference in New Issue
Block a user