I am trying to use an ItemList to create a clickable text menu. I could not find any tutorial on the subject, nor easy and clear explanation, so I really expected it to be as simple a using a list of buttons, but I think I was wrong.
My ItemList
has two items: item01
and item02
and was set to send an item_selected(index int)
signal
I am trying to get at least a print command working after item01
or item02
gets selected.
So far I tried things similar to:
func _on_ItemList_item_selected(index):
if $ItemList.is_selected(1) = true:
print("Item 01 selected")
but nothing works.
So, I have two questions.
1. How to detect that item01
is selected/clicked in
func _on_ItemList_item_selected(index)
:?
2. Why is it so different from the idea of button pressing detection etc. (at least it looks like that at first)? ;)