utils/kuhy_credit/godot/tests/shot.gd
Krzysztof kuhy Rudnicki 826f9946e8 kuhy_credit: fix red-team findings, Flutter harness
Held Enter no longer opens the site (Tk, web), Godot exports
rebuild after _init, strict SVG parser, relative --dir.

Todo: 3a5477b9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 16:07:08 +01:00

27 lines
769 B
GDScript

extends SceneTree
## Screenshot helper (not a test): renders the demo closed and open, saves PNGs.
## godot --path kuhy_credit/godot --rendering-driver opengl3 \
## -s res://tests/shot.gd -- <out_dir> [--light]
const Demo = preload("res://demo/demo.tscn")
func _initialize() -> void:
_run.call_deferred()
func _run() -> void:
var args := OS.get_cmdline_user_args()
var out: String = args[0]
var theme := "light" if args.has("--light") else "dark"
var demo: Control = Demo.instantiate()
root.add_child(demo)
for state in ["closed", "open"]:
if state == "open":
demo.credit.logo.pressed.emit()
for _i in 5:
await process_frame
var img := root.get_texture().get_image()
img.save_png(out.path_join("godot-%s-%s.png" % [theme, state]))
quit()