Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Valdit |
Hi i’m working on a Cost Calculator and would like to know how I would get it to add on the numbers and such when you click the corresponding button, example you click 5 and it reads “5” click 2 and it adds 2 to it making it “52” than clicking . it’d add a . so it’d be “52.” than clicking 9 it’d ofc add 9 and make it “52.9” how would I do something like this?
Here is my current code.
extends Node2D
var subtotal
func _ready():
$CanvasLayer/SubTotalN.text = str(subtotal)
func _on_0Button_pressed():
subtotal + 0