A visual UI editor for the Sexy framework used in Plants vs. Zombies, supporting both C++ and C# (.NET) code generation.
- π¨ Visual Design: Drag-and-drop interface for UI layout design
- π Dual Platform Support: Generate code for both C++ and C# (.NET) versions
- πΌοΈ Resource Management: Built-in image and font resource browser with preview
- π Code Generation: Automatic code generation with user code preservation
- π Extension System: Support for custom extension components
- π Internationalization: Multi-language support (English/Chinese)
- π― Event System: Visual event configuration with predefined actions
- π¦ Atlas Support: Automatic Atlas sub-image detection and preview for .NET version
- Python 3.8 or higher
- PyQt6
- Windows OS (tested on Windows 10/11)
- Clone the repository:
git clone https://github.com/yourusername/SexyUIEditor.git
cd SexyUIEditor- Install dependencies:
pip install PyQt6- Run the editor:
python main.py- Click File β New or press
Ctrl+N - Select target platform (C++ or C#)
- Design your interface using the component toolbox
- Configure widget properties in the property panel
- Save the project with
.sexyui(C++) or.cssexyui(C#) extension
- Add Widgets: Drag components from the toolbox to the canvas
- Select Widgets: Click on widgets to select them
- Move Widgets: Drag selected widgets to reposition
- Resize Widgets: Use the resize handles on selected widgets
- Delete Widgets: Press
Deletekey or use Edit menu
- Press
F6or click View β View Code to preview generated code - Click View β Export All Interfaces... to export all interfaces
- Generated code preserves user modifications in marked regions
- Select a widget in the object tree or canvas
- Click the event button in the property panel
- Add predefined actions or write custom code
- User code is preserved in
// [[[HANDLER_xxx]]]regions
SexyUIEditor/
βββ core/ # Core business logic
β βββ generators/ # Code generation modules
β βββ component_registry.py # Widget definitions
β βββ extension_manager.py # Extension component management
β βββ i18n.py # Internationalization
βββ ui/ # User interface components
βββ Content/ # .NET game resources
βββ SexyUIExtensions/ # Extension components
βββ docs/ # Documentation
βββ main.py # Application entry point
- ButtonWidget - Basic button
- EditWidget - Text input
- Checkbox - Checkbox control
- Slider - Slider control
- Dialog - Dialog window
- ListWidget - Scrollable list
- LawnStoneButton - PVZ stone-style button
- NewLawnButton - PVZ new-style button
- LawnDialog - PVZ dialog
- LawnEditWidget - PVZ edit control
- GameButton - PVZ game button
- Label - Custom text label with auto-wrapping
- ImageBox - Custom image box with scaling support
Create custom widgets by adding JSON definitions and source files to the SexyUIExtensions/ directory:
SexyUIExtensions/
βββ cpp/
β βββ MyWidget.json
β βββ MyWidget.h
β βββ MyWidget.cpp
βββ csharp/
βββ MyWidget.json
βββ MyWidget.cs
See CORE_ARCHITECTURE_EN.md for details.
Use the provided build script to create a standalone executable:
build.batThis creates a standalone executable in dist/main.dist/ with all dependencies included.
We welcome contributions! Here are some areas where you can help:
- More C++ formats: Support for different C++ coding styles and frameworks
- Assembly output: Add support for generating assembly code for low-level optimizations
- Other languages: Extend to support additional programming languages
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please read CORE_ARCHITECTURE_EN.md for architecture details before contributing.
Special thanks to PopCap Games for open-sourcing the Sexy framework, which made this editor possible.
Copyright (C) 2026 StackAndPointer
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions, please open an issue on GitHub.
Note: This editor is designed for the Sexy framework used in Plants vs. Zombies.
