IconMode
ItemList.swift:37enum IconModeenum IconModeimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class ItemListA vertical list of selectable items with one or multiple columns.
case topIcon is drawn above the text.
case leftIcon is drawn to the left of the text.
override class var godotClassName: StringName { get }final var allowReselect: Bool { get set }If true, the currently selected item can be selected again.
final var allowRmbSelect: Bool { get set }If true, right mouse button click can select items.
final var allowSearch: Bool { get set }If true, allows navigating the ItemList with letter keys through incremental search.
final var autoHeight: Bool { get set }If true, the control will automatically resize the height to fit its content.
var emptyClicked: Signal2 { get }Triggered when any mouse click is issued within the rect of the list but on empty space.
final var fixedColumnWidth: Int32 { get set }The width all columns will be adjusted to.
final var fixedIconSize: Vector2i { get set }The size all icons will be adjusted to.
final var iconMode: ItemList.IconMode { get set }The icon position, whether above or to the left of the text. See the IconMode constants.
final var iconScale: Double { get set }The scale of icon applied after fixedIconSize and transposing takes effect.
var itemActivated: Signal5 { get }Triggered when specified list item is activated via double-clicking or by pressing [kbd]Enter[/kbd].
var itemClicked: Signal3 { get }Triggered when specified list item has been clicked with any mouse button.
final var itemCount: Int32 { get set }The number of items currently in the list.
var itemSelected: Signal1 { get }Triggered when specified item has been selected.
final var maxColumns: Int32 { get set }Maximum columns the list will have.
final var maxTextLines: Int32 { get set }Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display.
var multiSelected: Signal4 { get }Triggered when a multiple selection is altered on a list allowing multiple selection.
final var sameColumnWidth: Bool { get set }Whether all columns will have the same width.
final var selectMode: ItemList.SelectMode { get set }Allows single or multiple item selection. See the SelectMode constants.
final var textOverrunBehavior: TextServer.OverrunBehavior { get set }Sets the clipping behavior when the text exceeds an item’s bounding rectangle. See TextServer.OverrunBehavior for a description of all modes.
final func addIconItem(icon: Texture2D?, selectable: Bool = true) -> Int32 Adds an item to the item list with no text, only an icon. Returns the index of an added item.
final func addItem(text: String, icon: Texture2D? = nil, selectable: Bool = true) -> Int32 Adds an item to the item list with specified text. Returns the index of an added item.
final func clear() Removes all items from the list.
final func deselect(idx: Int32) Ensures the item associated with the specified index is not selected.
final func deselectAll() Ensures there are no items selected.
final func ensureCurrentIsVisible() Ensure current selection is visible, adjusting the scroll position as necessary.
final func forceUpdateListSize() Forces an update to the list size based on its items. This happens automatically whenever size of the items, or other relevant settings like autoHeight, change. The method can be used to trigger the update ahead of next drawing pass.
final func getItemAtPosition(_ position: Vector2, exact: Bool = false) -> Int32 Returns the item index at the given position.
final func getItemCustomBgColor(idx: Int32) -> Color Returns the custom background color of the item specified by idx index.
final func getItemCustomFgColor(idx: Int32) -> Color Returns the custom foreground color of the item specified by idx index.
final func getItemIcon(idx: Int32) -> Texture2D? Returns the icon associated with the specified index.
final func getItemIconModulate(idx: Int32) -> Color Returns a Color modulating item’s icon at the specified index.
final func getItemIconRegion(idx: Int32) -> Rect2 Returns the region of item’s icon used. The whole icon will be used if the region has no area.
final func getItemLanguage(idx: Int32) -> String Returns item’s text language code.
final func getItemMetadata(idx: Int32) -> Variant Returns the metadata value of the specified index.
final func getItemRect(idx: Int32, expand: Bool = true) -> Rect2 Returns the position and size of the item with the specified index, in the coordinate system of the ItemList node. If expand is true the last column expands to fill the rest of the row.
final func getItemText(idx: Int32) -> String Returns the text associated with the specified index.
final func getItemTextDirection(idx: Int32) -> Control.TextDirection Returns item’s text base writing direction.
final func getItemTooltip(idx: Int32) -> String Returns the tooltip hint associated with the specified index.
final func getSelectedItems() -> PackedInt32Array Returns an array with the indexes of the selected items.
final func getVScrollBar() -> VScrollBar? Returns the vertical scrollbar.
final func isAnythingSelected() -> Bool Returns true if one or more items are selected.
final func isItemDisabled(idx: Int32) -> Bool Returns true if the item at the specified index is disabled.
final func isItemIconTransposed(idx: Int32) -> Bool Returns true if the item icon will be drawn transposed, i.e. the X and Y axes are swapped.
final func isItemSelectable(idx: Int32) -> Bool Returns true if the item at the specified index is selectable.
final func isItemTooltipEnabled(idx: Int32) -> Bool Returns true if the tooltip is enabled for specified item index.
final func isSelected(idx: Int32) -> Bool Returns true if the item at the specified index is currently selected.
final func moveItem(fromIdx: Int32, toIdx: Int32) Moves item from index fromIdx to toIdx.
final func removeItem(idx: Int32) Removes the item specified by idx index from the list.
final func select(idx: Int32, single: Bool = true) Select the item at the specified index.
final func setItemCustomBgColor(idx: Int32, customBgColor: Color) Sets the background color of the item specified by idx index to the specified Color.
final func setItemCustomFgColor(idx: Int32, customFgColor: Color) Sets the foreground color of the item specified by idx index to the specified Color.
final func setItemDisabled(idx: Int32, disabled: Bool) Disables (or enables) the item at the specified index.
final func setItemIcon(idx: Int32, icon: Texture2D?) Sets (or replaces) the icon’s Texture2D associated with the specified index.
final func setItemIconModulate(idx: Int32, modulate: Color) Sets a modulating Color of the item associated with the specified index.
final func setItemIconRegion(idx: Int32, rect: Rect2) Sets the region of item’s icon used. The whole icon will be used if the region has no area.
final func setItemIconTransposed(idx: Int32, transposed: Bool) Sets whether the item icon will be drawn transposed.
final func setItemLanguage(idx: Int32, language: String) Sets language code of item’s text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
final func setItemMetadata(idx: Int32, metadata: Variant) Sets a value (of any type) to be stored with the item associated with the specified index.
final func setItemSelectable(idx: Int32, selectable: Bool) Allows or disallows selection of the item associated with the specified index.
final func setItemText(idx: Int32, text: String) Sets text of the item associated with the specified index.
final func setItemTextDirection(idx: Int32, direction: Control.TextDirection) Sets item’s text base writing direction.
final func setItemTooltip(idx: Int32, tooltip: String) Sets the tooltip hint for the item associated with the specified index.
final func setItemTooltipEnabled(idx: Int32, enable: Bool) Sets whether the tooltip hint is enabled for specified item index.
final func sortItemsByText() Sorts items in the list by their text.
enum SelectModeclass Signal1Signal support.
class Signal2Signal support.
class Signal3Signal support.
class Signal4Signal support.
class Signal5Signal support.
protocol CaseIterableA type that provides a collection of all of its values.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol RawRepresentable<RawValue>A type that can be converted to and from an associated raw value.
init?(rawValue: Int64) var debugDescription: String { get }A textual representation of this instance, suitable for debugging
var hashValue: Int { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)