Created
August 17, 2021 14:54
-
-
Save WolfgangSenff/461f00f9a325a8b709d3d2cd5a54d88f to your computer and use it in GitHub Desktop.
File open broken
This file contains 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 file = File.new() | |
var file_location = "user://cache_temp/icon.png" | |
if not file.file_exists(file_location): | |
var result = file.open(file_location, File.WRITE_READ) | |
var buffer = preload("res://icon.png").get_data().get_data() | |
file.store_buffer(buffer) | |
file.close() | |
else: | |
var result = file.open(file_location, File.READ) | |
var imageArray = file.get_buffer(file.get_len()) | |
print(imageArray) | |
file.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment