Go to file
John McCardle d0e02d5b83 feat: generate comprehensive .pyi type stubs for IDE support (#108)
Created complete type stub files for the mcrfpy module to enable:
- Full IntelliSense/autocomplete in IDEs
- Static type checking with mypy/pyright
- Better documentation tooltips
- Parameter hints and return types

Implementation details:
- Manually crafted stubs for accuracy (15KB, 533 lines)
- Complete coverage: 19 classes, 112 functions/methods
- Proper type annotations using typing module
- @overload decorators for multiple signatures
- Type aliases for common patterns (UIElement union)
- Preserved all docstrings for IDE help
- Automation module fully typed
- PEP 561 compliant with py.typed marker

Testing:
- Validated Python syntax with ast.parse()
- Verified all expected classes and functions
- Confirmed type annotations are well-formed
- Checked docstring preservation (80 docstrings)

Usage:
- VS Code: Add stubs/ to python.analysis.extraPaths
- PyCharm: Mark stubs/ directory as Sources Root
- Other IDEs will auto-detect .pyi files

This significantly improves the developer experience when using
McRogueFace as a Python game engine.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 09:59:19 -04:00
.archive feat(Grid): add customizable background_color property (#50) 2025-07-06 15:58:17 -04:00
assets Whoops, never commited the UI icons spritesheet 2025-03-08 20:33:55 -05:00
deps/platform Windows build 2024-02-25 15:38:38 -05:00
modules Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup 2024-02-24 22:48:39 -05:00
src docs: add comprehensive parameter documentation to all API methods (#86) 2025-07-08 09:51:51 -04:00
stubs feat: generate comprehensive .pyi type stubs for IDE support (#108) 2025-07-08 09:59:19 -04:00
tests feat(viewport): complete viewport-based rendering system (#8) 2025-07-07 10:28:50 -04:00
.gitignore Squashed commit of the following: [alpha_streamline_1] 2025-07-05 18:56:02 -04:00
.gitmodules Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup 2024-02-24 22:48:39 -05:00
ALPHA_STREAMLINE_WORKLOG.md feat(rendering): implement RenderTexture base infrastructure and UIFrame clipping (#6) 2025-07-06 16:13:12 -04:00
CMakeLists.txt Iterators, other Python C API improvements 2025-05-31 09:11:51 -04:00
GNUmakefile Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
LICENSE.md Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup 2024-02-24 22:48:39 -05:00
PHASE_1_2_3_COMPLETION_SUMMARY.md docs: add Phase 1-3 completion summary 2025-07-06 08:53:30 -04:00
README.md Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
RENDERTEXTURE_DESIGN.md docs: create RenderTexture overhaul design document 2025-07-06 16:00:11 -04:00
ROADMAP.md docs: mark issue #85 as completed in Phase 7 2025-07-08 09:34:48 -04:00
SFML_3_MIGRATION_RESEARCH.md research: SFML 3.0 migration analysis 2025-07-06 13:08:52 -04:00
SFML_EXPOSURE_RESEARCH.md research: SFML exposure options analysis (#14) 2025-07-06 12:49:11 -04:00
STRATEGIC_VISION.md docs: comprehensive alpha_streamline_2 plan and strategic vision 2025-07-05 22:16:52 -04:00
_test.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
automation_example.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
automation_exec_examples.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
base_position_uicaption_test.png refactor: move position property to UIDrawable base class (UICaption) 2025-07-07 17:45:53 -04:00
base_position_uiframe_test.png refactor: move position property to UIDrawable base class (UIFrame) 2025-07-07 17:38:11 -04:00
base_position_uisprite_test.png refactor: move position property to UIDrawable base class (UISprite) 2025-07-07 17:54:47 -04:00
build.sh Squashed commit of the following: [alpha_streamline_1] 2025-07-05 18:56:02 -04:00
caption_invisible.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_moved.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_opacity_0.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_opacity_25.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_opacity_50.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_visible.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
clean.sh feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
compile_commands.json Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
css_colors.txt Squashed commit of the following: [standardize_color_handling] 2024-03-30 21:20:40 -04:00
example_automation.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
example_config.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
example_monitoring.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
exec_flag_implementation.cpp feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
frame_clipping_animated.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
frame_clipping_nested.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
frame_clipping_resized.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
frame_clipping_test.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
generate_color_table.py Squashed commit of the following: [standardize_color_handling] 2024-03-30 21:20:40 -04:00
generate_stubs.py feat: generate comprehensive .pyi type stubs for IDE support (#108) 2025-07-08 09:59:19 -04:00
generate_stubs_v2.py feat: generate comprehensive .pyi type stubs for IDE support (#108) 2025-07-08 09:59:19 -04:00
gitea_issues.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
viewport_center_mode.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
viewport_fit_mode.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
viewport_fit_tall.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
viewport_fit_wide.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
viewport_stretch_mode.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
wikicrayons_colors.txt Squashed commit of the following: [standardize_color_handling] 2024-03-30 21:20:40 -04:00
xkcd_colors.txt Squashed commit of the following: [standardize_color_handling] 2024-03-30 21:20:40 -04:00

README.md

McRogueFace

Blame my wife for the name

A Python-powered 2D game engine for creating roguelike games, built with C++ and SFML.

Pre-Alpha Release Demo: my 7DRL 2025 entry "Crypt of Sokoban" - a prototype with buttons, boulders, enemies, and items.

Tenets

  • Python & C++ Hand-in-Hand: Create your game without ever recompiling. Your Python commands create C++ objects, and animations can occur without calling Python at all.
  • Simple Yet Flexible UI System: Sprites, Grids, Frames, and Captions with full animation support
  • Entity-Component Architecture: Implement your game objects with Python integration
  • Built-in Roguelike Support: Dungeon generation, pathfinding, and field-of-view via libtcod (demos still under construction)
  • Automation API: PyAutoGUI-inspired event generation framework. All McRogueFace interactions can be performed headlessly via script: for software testing or AI integration
  • Interactive Development: Python REPL integration for live game debugging. Use mcrogueface like a Python interpreter

Quick Start

# Clone and build
git clone <wherever you found this repo>
cd McRogueFace
make

# Run the example game
cd build
./mcrogueface

Example: Creating a Simple Scene

import mcrfpy

# Create a new scene
mcrfpy.createScene("intro")

# Add a text caption
caption = mcrfpy.Caption((50, 50), "Welcome to McRogueFace!")
caption.size = 48 
caption.fill_color = (255, 255, 255)

# Add to scene
mcrfpy.sceneUI("intro").append(caption)

# Switch to the scene
mcrfpy.setScene("intro")

Documentation

For comprehensive documentation, tutorials, and API reference, visit: https://mcrogueface.github.io

Requirements

  • C++17 compiler (GCC 7+ or Clang 5+)
  • CMake 3.14+
  • Python 3.12+
  • SFML 2.5+
  • Linux or Windows (macOS untested)

Project Structure

McRogueFace/
├── src/           # C++ engine source
├── scripts/       # Python game scripts
├── assets/        # Sprites, fonts, audio
├── build/         # Build output directory
└── tests/         # Automated test suite

Contributing

PRs will be considered! Please include explicit mention that your contribution is your own work and released under the MIT license in the pull request.

The project has a private roadmap and issue list. Reach out via email or social media if you have bugs or feature requests.

License

This project is licensed under the MIT License - see LICENSE file for details.

Acknowledgments

  • Developed for 7-Day Roguelike 2023, 2024, 2025 - here's to many more
  • Built with SFML, libtcod, and Python
  • Inspired by David Churchill's COMP4300 game engine lectures