2022-05-07 17:11:47 +00:00
|
|
|
extends TextureRect
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
pass # Replace with function body.
|
|
|
|
|
|
|
|
func _on_UploadButton_pressed():
|
|
|
|
HTML5File.load_image()
|
|
|
|
|
2023-09-10 03:45:00 +00:00
|
|
|
var image = await HTML5File.load_completed
|
2022-05-07 17:11:47 +00:00
|
|
|
|
|
|
|
var tex = ImageTexture.new()
|
2023-09-10 03:45:00 +00:00
|
|
|
tex.create_from_image(image) #,0
|
2022-05-07 17:11:47 +00:00
|
|
|
|
|
|
|
texture = tex;
|
|
|
|
|
|
|
|
func _on_DownloadButton_pressed():
|
2023-09-10 03:45:00 +00:00
|
|
|
var image : Image
|
|
|
|
image = get_viewport().get_texture().get_image()
|
2022-05-07 17:11:47 +00:00
|
|
|
HTML5File.save_image(image, "image.png")
|