![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | start123 |
I don’t understand anything in singleton.
I need the data from the scene to go to another.
How can this be done with pictures or numbers?
How can I split this script into two so that it works?
extends Node2D
#This should be the first script.
const appleimage = "res://icon.png"
var word1 = "It's"
var word2 = " apples"
var applenumber = "2"
#This should be the second script.
func _ready():
$appleimage.texture = load(appleimage)
$apple.text = word1+word2
func _on_button1_pressed():
$applenumber.text = applenumber+" apples left"
And also, why this command doesn’t work?
$apple.text = word1\nword2
Parser Error: Parse error: Expected newline after ''.