I am trying to make an app to add two numbers. I used LineEdits to put numbers and a label to show the answer. Unfortunately, something is wrong. Could anyone here help me?
So heres my example:
extends HBoxContainer # used HBoxContainer as parent for the other nodes
var num1 = 0
var num2 = 0
var result = 0
onready var res = get_node("OutputLabel")
# note that I've opted to use the _text_changed signal
num1 = int(new_text)
num2 = int(new_text)
result = num1 + num2
res.set_text(String("Result: ") + String(result))
Thanks a lot Megalomaniak. It's working!!!
Your _ready() is empty and none of your custom functions are triggered by anything based on what I can see. Also that extra indent on the highlighted line 16 could be removed.
edit: I suppose your signals might be triggering the functions if set up properly, but I can't be sure of that I mean.
Edit 2: Ok, so instead of using Str() you should use String() on line 19, and since you used the text entered signal from the LineEdits, after inputting/changing the text you need to hit enter too.
Rich Text Editor.
To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph.
An inline formatting menu will show up when you select text. Hit tab to get into that menu.
Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.