Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Initial run at a hitbox editor, not quite finished
  • Loading branch information
Cleptomania committed Mar 14, 2026
commit 4a19d7dc9789298973a5e0008d2f566582853e4a
4 changes: 4 additions & 0 deletions arcade/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,8 @@ def run(self) -> int:
def run_arcade_cli():
cli = CLI()
cli.register_command(InfoCommand)

from arcade.hitbox_editor.commands import HitBoxEditorCommand
cli.register_command(HitBoxEditorCommand)

return cli.run()
32 changes: 32 additions & 0 deletions arcade/hitbox_editor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""HitBox Editor - A visual tool for creating and editing sprite hitbox regions."""

from __future__ import annotations

from pathlib import Path


def run_editor(
texture_path: str | Path | None = None,
hitbox_path: str | Path | None = None,
width: int = 1280,
height: int = 720,
) -> int:
"""Launch the HitBox Editor application.

Args:
texture_path: Optional path to a texture image file to load on startup.
hitbox_path: Optional path to an existing hitbox JSON file to load.
width: Window width in pixels.
height: Window height in pixels.

Returns:
Exit code (0 for success).
"""
import arcade
from arcade.hitbox_editor.app import HitBoxEditorView

window = arcade.Window(width, height, "HitBox Editor", resizable=True)
view = HitBoxEditorView(texture_path=texture_path, hitbox_path=hitbox_path)
window.show_view(view)
arcade.run()
return 0
Loading
Loading