Created
April 3, 2023 13:14
-
-
Save brettchalupa/59dc55ff29d71fec7cb92e929c56a528 to your computer and use it in GitHub Desktop.
Godot Read from Disk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hello, world! I'm from an external file. | |
| And I'm a new line! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extends Node2D | |
| func _ready() -> void: | |
| var label_text_res = "res://greeting.txt" | |
| var file = FileAccess.open(label_text_res, FileAccess.READ) | |
| var text = file.get_as_text() | |
| $Label.text = text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment