![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Kad Gaming |
Essentially, I am trying to create a to-do list feature in Godot. I’m only 1 month into my game development journey and I’m beginning to become more serious. I learned it is a good idea to use lists to keep track of what you have to do in game dev, and this helps you stay organized and focused. I thought instead of just using one of the many programs that allow to-do lists, I could make my own in Godot which could be a fun new challenge that would help me learn. I started off with a simple 2D scene and created a background in a TextureRect, and also a LineEdit to allow user input to add to the lists. I created an ItemList where the list will be displayed and autoloaded that node. I connected a signal from LineEdit to a script that calls the add_to function in the ItemList script.
extends LineEdit func _on_LineEdit_text_entered(new_text: String) -> void:
GlobalItemList.add_to(new_text)
This is how I am doing the user input. The code from the Item List script is as follows.
extends ItemList func add_to(text):
self.add_item(text)
print(text)
At first, I would type something and enter it and nothing happened so I added the print to see if it was actually getting my input and it works, the text I enter is displayed in console. My question is how do I get it to display in a list, with each new item entered on a new line. Also, with the whole checking off items on a list part of the to-do list, I have no clue where to get started. I want either a checkbox next to every item on the list or allow for the text to be clicked on and then a line is drawn through it, how would I do something like that. Please help. Thank you.