Add screenshot functionality and new level scene to game manager
This commit is contained in:
8
scripts/screenshot.gd
Normal file
8
scripts/screenshot.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
extends Node
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if OS.is_debug_build() and Input.is_action_just_pressed("screenshot"):
|
||||
var img := get_viewport().get_texture().get_image()
|
||||
var id := OS.get_unique_id() + "_" + Time.get_datetime_string_from_system()
|
||||
var path := "user://screenshot_" + str(id) + ".png"
|
||||
img.save_png(path)
|
1
scripts/screenshot.gd.uid
Normal file
1
scripts/screenshot.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bydv4g1n5s3nf
|
Reference in New Issue
Block a user