Added a screenshot function.

feature-flyby
unfa 2021-11-21 23:34:41 +01:00
parent a32d3edfff
commit a178ba8b9a
2 changed files with 9 additions and 0 deletions

View File

@ -206,6 +206,10 @@ func _input(_event) -> void:
hud.scoretab(true)
elif Input.is_action_just_released("show_scoretab"):
hud.scoretab(false)
if Input.is_action_just_pressed("screenshot"):
var res = get_viewport().get_texture().get_image().save_exr('res://Screnshot.exr')
chat.chat_notification("Screenshot taken: " + str(res))
@rpc(any_peer, call_local, reliable) func game_over(winner):
if local_player:

View File

@ -164,6 +164,11 @@ show_scoretab={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777218,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
screenshot={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"store_command":true,"alt_pressed":false,"shift_pressed":false,"meta_pressed":false,"command_pressed":false,"pressed":false,"keycode":16777253,"physical_keycode":0,"unicode":0,"echo":false,"script":null)
]
}
[layer_names]