extends Node

func _input(_event):
	if Input.is_action_just_pressed("take_screenshot"):
		take_screenshot();

func take_screenshot():
	var timestamp = Time.get_datetime_string_from_system(false, true).replace(":", "-");
	await RenderingServer.frame_post_draw;
	var sshot = get_viewport().get_texture().get_image();
	var path = "user://screenshot" + timestamp + ".png";
	sshot.save_png(path);
	print("Saved Screenshot @: " + path);
