Loading images with noise distortion.

This commit is contained in:
2026-01-06 21:01:53 +01:00
commit f7714b14db
13 changed files with 290 additions and 0 deletions

19
run/main.gd Normal file
View File

@@ -0,0 +1,19 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
%LoadImageButton.pressed.connect(show_image_load_dialog)
%LoadImageDialog.file_selected.connect(load_image)
func show_image_load_dialog():
%LoadImageDialog.visible = true
func load_image(path: String) -> bool:
var image = Image.load_from_file(path)
if image == null:
return false
var tex = ImageTexture.create_from_image(image)
%PreviewImage.texture = tex
%LoadImageButton.text = path.get_file()
return true