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.
Metadata
Release files for gui-converter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gui_converter-1.0.0.tar.gz | 11.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gui_converter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / gui_converter-1.0.0.tar.gz
| Download URL | gui_converter-1.0.0.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
929ad59f2a1a847cb6a70ce6c30c071bb0124f589ae8ab2c3f918d458f097cf3
|
|
BLAKE2b-256 checksum How to use checksums |
11a8058267561dd5150ae0865d52f79d716eb592fbf28ac6496afa296e21f930
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / gui_converter-1.0.0-py3-none-any.whl
| Download URL | gui_converter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e3c4b36663c56a3caa9ab94c7aca3891578331bf9aa73b2f10e4db63e8cc0b9
|
|
BLAKE2b-256 checksum How to use checksums |
9ada455802d17dc7901fe8adee7d321cefffe24023bb99594b4453281292ab4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for gui-converter 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.