Skip to content

Instantly share code, notes, and snippets.

View ale2x72's full-sized avatar
🎯
< you are here

Alessio Erioli ale2x72

🎯
< you are here
View GitHub Profile
@ale2x72
ale2x72 / screenshot.gd
Last active January 6, 2024 18:24 — forked from jotson/screenshot.gd
Godot GDScript screenshot function
# This is a function for capturing screenshots with GDScript
# from: https://gist.github.com/jotson/84681c2064653d093083a690e9fa5998
# Adapted for Godot4.2.1 by ale2x72
func screenshot():
# Capture the screenshot
var image = get_viewport().get_texture().get_image()
# Setup path and screenshot filename
var date = Time.get_datetime_dict_from_system()