extends SceneTree ## Photograph the radial emote dial, resting and with a wedge aimed at. ## ## godot --path . --windowed --resolution 1280x720 \ ## -s res://debug/emote_wheel_capture.gd -- ## ## Two shots, because the hover state is the one that goes wrong: a wedge whose ## fill changes without its label changing with it is the exact failure the ## theme's contrast work exists to prevent, and it is invisible in a shot of the ## wheel at rest. var _out := "." func _initialize() -> void: var args := OS.get_cmdline_user_args() if args.size() > 0: _out = String(args[0]) _run() func _run() -> void: await process_frame UITheme.apply_global(self) var layer := CanvasLayer.new() root.add_child(layer) # Something behind it, so the ink edges are being judged against a real # backdrop rather than against black. var back := ColorRect.new() back.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) back.color = Color(0.42, 0.55, 0.72) layer.add_child(back) var wheel := EmoteWheel.new() layer.add_child(wheel) wheel.open() for _i in 30: await process_frame await process_frame root.get_texture().get_image().save_png("%s/emote_wheel_rest.png" % _out) print("emote_wheel_capture: saved rest") # Aim up-and-right, which lands on the second wedge. wheel.aim_by_vector(Vector2(0.7, -0.7)) for _i in 12: await process_frame await process_frame root.get_texture().get_image().save_png("%s/emote_wheel_hover.png" % _out) print("emote_wheel_capture: saved hover, picked=%d" % wheel._hover) quit(0)