draw_circle
Draw circles on Aseprite canvas by specifying center coordinates, radius, color, and fill options for pixel art creation.
Instructions
Draw a circle on the canvas.
Args: filename: Name of the Aseprite file to modify center_x: X coordinate of circle center center_y: Y coordinate of circle center radius: Radius of the circle in pixels color: Hex color code (default: "#000000") fill: Whether to fill the circle (default: False)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| center_x | Yes | ||
| center_y | Yes | ||
| radius | Yes | ||
| color | No | #000000 | |
| fill | No |
Implementation Reference
- aseprite_mcp/tools/drawing.py:159-200 (handler)The `draw_circle` function acts as the MCP tool handler, validating inputs and invoking the `LuaBuilder` to generate and execute the Lua script for Aseprite.
async def draw_circle(filename: str, center_x: int, center_y: int, radius: int, color: str = "#000000", fill: bool = False) -> str: """Draw a circle on the canvas. Args: filename: Name of the Aseprite file to modify center_x: X coordinate of circle center center_y: Y coordinate of circle center radius: Radius of the circle in pixels color: Hex color code (default: "#000000") fill: Whether to fill the circle (default: False) """ try: # Validate inputs file_path = validate_file_path(filename, must_exist=True) color = validate_color(color) if radius < 1: raise ValidationError("radius", radius, "Radius must be at least 1") # Build Lua script builder = LuaBuilder() builder.add_line('local spr = app.activeSprite') builder.if_condition('not spr') builder.add_line('error("No active sprite")') builder.end_if() builder.add_line() builder.begin_transaction() builder.draw_circle(center_x, center_y, radius, color, fill) builder.end_transaction() builder.save_sprite() # Execute script cmd = get_command() success, output = cmd.execute_lua_script(builder.build(), str(file_path)) return f"Circle drawn successfully in {file_path}" except (ValidationError, AsepriteError) as e: return f"Failed to draw circle: {e}" except Exception as e: return f"Unexpected error: {e}"