Agent skill
uloop-screenshot
Capture screenshots of Unity Editor windows as PNG files. Use when you need to: (1) Screenshot Game View, Scene View, Console, Inspector, or other windows, (2) Capture current visual state for debugging or documentation, (3) Save editor window appearance as image files.
Install this agent skill to your Project
npx add-skill https://github.com/hatayama/unity-cli-loop/tree/main/Packages/src/Editor/Api/McpTools/Screenshot/Skill
SKILL.md
uloop screenshot
Take a screenshot of any Unity EditorWindow by name and save as PNG.
Usage
uloop screenshot [--window-name <name>] [--resolution-scale <scale>] [--match-mode <mode>] [--capture-mode <mode>] [--annotate-elements] [--elements-only] [--output-directory <path>]
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
--window-name |
string | Game |
Window name to capture. Ignored when --capture-mode rendering. |
--resolution-scale |
number | 1.0 |
Resolution scale (0.1 to 1.0) |
--match-mode |
enum | exact |
Window name matching mode: exact, prefix, or contains. Ignored when --capture-mode rendering. |
--capture-mode |
enum | window |
window=capture EditorWindow including toolbar, rendering=capture game rendering only (PlayMode required, coordinates match simulate-mouse) |
--output-directory |
string | "" |
Output directory path for saving screenshots. When empty, uses default path (.uloop/outputs/Screenshots/). Accepts absolute paths. |
--annotate-elements |
boolean | false |
Annotate interactive UI elements with index labels (A, B, C...) on the screenshot. Only works with --capture-mode rendering in PlayMode. |
--elements-only |
boolean | false |
Return only annotated element JSON without capturing a screenshot image. Requires --annotate-elements and --capture-mode rendering in PlayMode. |
Match Modes
| Mode | Description | Example |
|---|---|---|
exact |
Window name must match exactly (case-insensitive) | "Project" matches "Project" only |
prefix |
Window name must start with the input | "Project" matches "Project" and "Project Settings" |
contains |
Window name must contain the input anywhere | "set" matches "Project Settings" |
Window Name
The window name is the text displayed in the window's title bar (tab). Common names: Game, Scene, Console, Inspector, Project, Hierarchy, Animation, Animator, Profiler. Custom EditorWindow titles are also supported.
Global Options
| Option | Description |
|---|---|
--project-path <path> |
Target a specific Unity project (mutually exclusive with --port) |
-p, --port <port> |
Specify Unity TCP port directly (mutually exclusive with --project-path) |
Examples
# Take a screenshot of Game View (default)
uloop screenshot
# Capture game rendering (coordinates match simulate-mouse, PlayMode required)
uloop screenshot --capture-mode rendering
# Annotate interactive UI elements with index labels (for simulate-mouse workflow)
uloop screenshot --capture-mode rendering --annotate-elements
# Get UI element coordinates without capturing an image (fastest)
uloop screenshot --capture-mode rendering --annotate-elements --elements-only
# Take a screenshot of Scene View
uloop screenshot --window-name Scene
# Capture all windows starting with "Project" (prefix match)
uloop screenshot --window-name Project --match-mode prefix
# Save screenshot to a specific directory
uloop screenshot --output-directory /tmp/screenshots
# Combine options
uloop screenshot --window-name Scene --resolution-scale 0.5 --output-directory /tmp/screenshots
Output
Returns JSON with:
ScreenshotCount: Number of windows capturedScreenshots: Array of screenshot info, each containing:ImagePath: Absolute path to the saved PNG fileFileSizeBytes: Size of the saved file in bytesWidth: Captured image width in pixelsHeight: Captured image height in pixelsCoordinateSystem:"gameView"(image pixel coords that must be converted withResolutionScaleandYOffsetbefore using withsimulate-mouse) or"window"(EditorWindow capture)ResolutionScale: Resolution scale used for captureYOffset: Y offset used insim_y = image_y / ResolutionScale + YOffsetwhenCoordinateSystemis"gameView"AnnotatedElements: Array of annotated UI element metadata. Empty unless--annotate-elementsis used. Sorted by z-order (frontmost first). Each item contains:Label: Index label shown on the screenshot (A=frontmost,B=next, ...)Name: Element nameType: Element type (Button,Toggle,Slider,Dropdown,InputField,Scrollbar,Draggable,DropTarget,Selectable)SimX,SimY: Center position in simulate-mouse coordinates (use directly with--xand--y)BoundsMinX,BoundsMinY,BoundsMaxX,BoundsMaxY: Bounding box in simulate-mouse coordinatesSortingOrder: Canvas sorting order (higher = in front)SiblingIndex: Transform sibling index under the element's direct parent (not a reliable z-order signal across nested UI hierarchies)
Coordinate Conversion (gameView)
When CoordinateSystem is "gameView", convert image pixel coordinates to simulate-mouse coordinates:
sim_x = image_x / ResolutionScale
sim_y = image_y / ResolutionScale + YOffset
When ResolutionScale is 1.0, this simplifies to sim_x = image_x, sim_y = image_y + YOffset.
When multiple windows match (e.g., multiple Inspector windows or when using contains mode), all matching windows are captured with numbered filenames (e.g., Inspector_1_*.png, Inspector_2_*.png).
Notes
- Use
uloop focus-windowfirst if needed - Target window must be open in Unity Editor
- Window name matching is always case-insensitive
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
uloop-simulate-mouse-ui
Simulate mouse click, long-press, and drag on PlayMode UI elements via EventSystem screen coordinates. Use when you need to: (1) Click buttons or interactive UI elements during PlayMode testing, (2) Drag UI elements from one position to another, (3) Hold a drag at a position for inspection before releasing, (4) Long-press UI elements that respond to sustained pointer-down. For game logic that reads Input System (e.g. WasPressedThisFrame), use simulate-mouse-input instead.
uloop-execute-menu-item
Execute Unity Editor menu commands programmatically. Use when you need to: (1) Trigger menu commands like save, build, or refresh, (2) Automate editor actions via menu paths, (3) Run custom menu items defined in project scripts.
uloop-find-game-objects
Find GameObjects in the active scene by various criteria. Use when you need to: (1) Search for objects by name, regex, or path, (2) Find objects with specific components, tags, or layers, (3) Get currently selected GameObjects in Unity Editor. Returns matching GameObjects with hierarchy paths and components.
uloop-simulate-keyboard
Simulate keyboard key input in PlayMode via Input System. Use when you need to: (1) Press game control keys like WASD, Space, or Shift during PlayMode, (2) Hold keys down for continuous movement or actions, (3) Combine multiple held keys for complex input like Shift+W for sprint.
uloop-run-tests
Execute Unity Test Runner and get detailed results. Use when you need to: (1) Run EditMode or PlayMode unit tests, (2) Verify code changes pass all tests, (3) Diagnose test failures with error messages and stack traces. Auto-saves NUnit XML results on failure.
uloop-control-play-mode
Control Unity Editor play mode (play/stop/pause). Use when you need to: (1) Start play mode to test game behavior, (2) Stop play mode to return to edit mode, (3) Pause play mode for frame-by-frame inspection.
Didn't find tool you were looking for?