15 lines
396 B
GDScript
15 lines
396 B
GDScript
extends Node
|
|
|
|
func _ready() -> void:
|
|
var path := "assets/Images/"
|
|
|
|
_check_and_create_dir(path)
|
|
|
|
await RenderingServer.frame_post_draw
|
|
get_viewport().get_texture().get_image().save_png(path + "img.png")
|
|
|
|
func _check_and_create_dir(path: String) -> void:
|
|
var dir_path := path.get_base_dir()
|
|
if not DirAccess.dir_exists_absolute(dir_path):
|
|
DirAccess.make_dir_recursive_absolute(dir_path)
|