Replace or rename image from File System for code ,,, image ejm base.png to base1.png (I do not know English I'm sorry)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By legulax

enter image description here

:bust_in_silhouette: Reply From: Wakatta
var dir = Directory.new()
dir.copy("base.png", "base1.png")

Not too late if you want to learn

-------thanks------
The problem only works when running the game and closing it what I want is to press a key and change the image Trex Chrome is the game I imitated

legulax | 2021-12-31 15:48

Connect the button_pressed signal then run the above code snippet.

var dir = Directory.new()

func _on_button_pressed():
    dir.copy("base.png", "base1.png")

Wakatta | 2021-12-31 22:33

Thank you, I already try all this and it works but the changes are only seen if I close the game and reopen it again

Is there a way to make a selector of images that is in the file system?

legulax | 2022-01-02 15:29