GUI Converter Tool for KotOR - converts GUI files between games
Project description
GUI Resizer CLI Tool
Overview
This is a simple command-line interface (CLI) tool designed to adjust and scale GUI (Graphical User Interface) files based on different screen resolutions. The tool reads .gui files from the popular game Star Wars: Knights of the Old Republic and adjusts the layout to fit various resolutions and aspect ratios. It supports multiple resolutions and can handle batch processing of files.
Features
- Multi-Resolution Support: The tool can adjust GUI files to fit several resolutions across different aspect ratios, such as 16:9, 16:10, 4:3, 5:4, 21:9, 3:2, and 1:1.
- Batch Processing: You can process multiple GUI files at once, making it easy to adjust a whole directory of files.
- Logging: Outputs logs to track the processing of files, including which resolutions were processed and where the output files are saved.
- Cross-Platform: Works on Windows, Linux, and macOS with Python 3.8+.
Installation
To use this tool, you'll need to have Python 3.8 or higher installed on your system.
-
Clone the Repository:
git clone <repository-url> cd <repository-directory>
-
Install Dependencies: Ensure you have the necessary Python packages installed. You may need to install
pykotor, a package that handles.gfffiles, as well as any other dependencies.pip install -r requirements.txt
Usage
Basic Command
To run the tool, use the following command:
python3 gui_resizer.py --input <input-path> --output <output-path> --resolution <resolution>
Parameters
--input: The path to the.guifile(s) you want to process. You can specify a single file or a directory containing multiple.guifiles.--output: The directory where the processed files will be saved.--resolution: The target resolution(s). Use the formatWIDTHxHEIGHT(e.g.,1920x1080). You can also specifyALLto process all common resolutions.
Example
To convert all .gui files in the directory input_files/ to fit a 1920x1080 resolution and save them to the output_files/ directory, run:
python3 gui_resizer.py --input input_files/ --output output_files/ --resolution 1920x1080
Logging
If logging is enabled, a log file named output.log will be created in the specified output directory. This file will contain details of the processing operations performed.
How It Works
-
Input Handling: The tool takes in
.guifiles or directories containing these files and reads them using thepykotorlibrary. -
Resolution Scaling: The tool scales the GUI elements based on the specified target resolution(s). It calculates scale factors based on the original dimensions of the GUI and applies these factors to resize elements accordingly.
-
Output Generation: The processed GUI files are then saved to the specified output directory, organized by resolution.
Requirements
- Python: 3.8 or higher
- OS: Windows, Linux, or macOS
- Dependencies: Listed in
requirements.txt(to be created based on the imports)
Notes
- Ensure that your
.guifiles are compatible with the Star Wars: Knights of the Old Republic game or any other project you're working on. - The tool supports adding more aspect ratios and resolutions by modifying the
ASPECT_RATIO_TO_RESOLUTIONdictionary in the script.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gui_converter-1.0.0.tar.gz.
File metadata
- Download URL: gui_converter-1.0.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
929ad59f2a1a847cb6a70ce6c30c071bb0124f589ae8ab2c3f918d458f097cf3
|
|
| MD5 |
f54d06e7679504c032f61be18d17fbe4
|
|
| BLAKE2b-256 |
11a8058267561dd5150ae0865d52f79d716eb592fbf28ac6496afa296e21f930
|
File details
Details for the file gui_converter-1.0.0-py3-none-any.whl.
File metadata
- Download URL: gui_converter-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e3c4b36663c56a3caa9ab94c7aca3891578331bf9aa73b2f10e4db63e8cc0b9
|
|
| MD5 |
cd29f23ec36850e2848ce6eb646c9cd1
|
|
| BLAKE2b-256 |
9ada455802d17dc7901fe8adee7d321cefffe24023bb99594b4453281292ab4d
|