TgaBuilder
Texture Panel Building Tool for TRLE
Latest Releases | Github Repository
Description
TgaBuilder is a Texture Panel Building tool for TRLE, which is intended to facilitate the process of texture panel creation. The tool is inspired by TBuilder by IceBerg but programmed from scratch in .NET, C# WPF by me.
If you have already worked with TBuilder in the past, you should get familiar with TgaBuilder very quickly. It should cover most of the features TBuilder also has and introduces a few things more, most prominently:
- Texture Panel Panning and Zooming
- Undo / Redo
- Window Resizable
- Extended dimensioning with panel hights up to 128 pages, panel widths up to 16 pages
- Better support for 128x128 or 256x256 pix texture sets
- Batch Loader to create texture panels from multiple single texture files at once
- Imported texture repacking to remove TE compiled atlas padding
- and others…
Installation
Move over to GitHub Releases.
For the latest releases there are two tool versions per release: The .NET 6.0 version of the tool and the .NET 8.0 version of the tool.
- Download the .NET 6.0 version of the tool (TgaBuilder-dotnet6), if you already have Tomb Editor Version 1.9 installed on your system and you do not wish to install another .NET runtime (as Tomb Editor Version 1.9 is using .NET 6.0 runtime as well)
- Download the .NET 8.0 version of the tool (TgaBuilder-dotnet8), if you have the .NET 8.0 runtime installed or do not mind to install it. This version has the slightly better performance.
Extract the files and start TgaBuilder.exe.
Requirements
- Windows 10/11
- .NET 6.0 or .NET 8.0 runtime installed (with Tomb Editor Version 1.9, you have the .NET 6.0 runtime already installed).
Please note that, as a .net WPF tool, TgaBuilder has significantly higher system resource requirements, particularly for RAM, than TBuilder, which was written in Delphi. If you are still satisfied using TBuilder, please continue using it. TgaBuilder is not intended as a substitute for it.
Usage
Title Bar
Source Loading
- Open image files as source texture panel
Supported formats: TGA, DDS, PNG, BMP, JPG, JPEG, PSD (Ctrl + E
)- … or simply drop a supported image file on source panel.
- Reopen recently used source image files
- Reload the current file in case of changes to load settings (Import Tab) or file changes
- Open previous file in current folder
- Open next file in current folder
Undo / Redo
- Undo:
Ctrl + Z
- Redo:
Ctrl + Y
Destination Loading / Saving
- Create a new texture panel:
Ctrl + N
- Open image files as destination texture panel
Supported formats: TGA, DDS, PNG, BMP, JPG, JPEG, PSD (Ctrl + D
)- … or simply drop a supported image file on destination panel.
- Reopen recently used destination image files
- Save the destination texture
Supported formats: TGA, DDS, PNG, BMP, JPG, JPEG (Ctrl + S
) - Save to a specified file
Formats: TGA, DDS, PNG, BMP, JPG, JPEG (Ctrl + Shift + S
)
Source Panel (Left)
- Left click a tile: copy into selection
- Left click + drag: copy area into selection
- Right click a tile: preview UV rotate (river rotate)
- Right click + drag: preview range-based animation of
AnimRange
- Left click + Alt + drag: copy ignoring grid
- Left click + Ctrl + drag: move panel
- Mouse wheel: scroll vertically
- Mouse wheel + Ctrl: zoom in/out
Destination Panel (Rigth)
Picking Mode
- Left click: copy into selection or apply transformation
- Left click + drag: copy area into selection
- Right click: preview UV rotate
- Right click + drag: preview animation range
- Middle click: move to Placing Mode directly
Placing Mode
- Left click: place selected tile and return to picking
- Right click: return to picking without placing
General Controls
- Left click + Ctrl + drag: move panel
- Mouse wheel: scroll vertically
- Mouse wheel + Ctrl: zoom
- Mouse wheel + Shift: change picker size
Selection Area
- With a click on the Preview Image you can manually switch to the Placing Mode on the Destination Panel
- Buttons to copy entire contents from Source to Destination panels or vice versa
- Fill selection with chosen color
- Copy selection to clipboard (
Ctrl + C
) - Paste clipboard into selection (
Ctrl + V
) - Auto-copy new selections to clipboard
- Auto-paste clipboard into selection when it has new image data
Animation Area
- Set animation speed
- Start / stop animation
- Close animation preview
Import Tab (Source Panel)
From left to rigth:
- Import atlas from Classic TR levels
Supports: TR1–TRC, TRLE, TRNG, TEN) (Ctrl + Q
) - Enable remapping for imports (removes padding in TE-built atlases)
- Set horizontal page count (1, 2, 4, 8, 16 pages)
- Open Batch Loader (
Ctrl + W
)
Please use Imports carefully and conscientiously when building own custom levels…
Batch File Loader
- Import multiple image files from folder
Supported formats: TGA, DDS, PNG, BMP, JPG, JPEG - Select or reopen folder
- … or simply drop a set of supported image files on preview panel.
- Set Range:
- First Texture Index
- Number of Textures
- Define square resize size for textures
Grid Tab (Source Panel)
- Set X offset
- Set Y offset
- Reset offset
- Toggle grid on/off
- Change layout
Format Tab (Source and Destination Panel)
This tab allows you to modify the format of the destination texture panel…
- BPP toggle
- Eyedropper to set color to replace
- Selected color to replace
- Replace selected color with magenta or transparency
- Auto-apply magenta or transparency replacement for new selections
View Tab (Source and Destination Panel)
- Fit panel width to viewport
- Fit panel height to viewport
- Set zoom to 100%
Placing Tab (Destination Panel)
- Enable Resize to Picker mode
- Enable Continuously Placing mode
- Enable Swap and Place mode
- Enable transparent overlay:
- Set Opacity for placed tile:
Size Tab (Destination Panel)
- Set destination panel height (in pages, max 128 pages)
- Set destination panel width (1, 2, 4, 8 or 16 pages)
- Enable texture rearranging during width changes
Mode Tab (Destination Panel)
- Standard tile placing
- Rotate tile
- Mirror tile horizontally
- Mirror tile vertically
- Tile Rally mode: move one tile and shift all tiles inbetween
- Swap Tile mode: swap two tiles
Keyboard Shortcuts
Key Combination | Description |
---|---|
Ctrl + A | Create a new texture panel |
Ctrl + C | Copy selection to clipboard |
Ctrl + V | Paste from clipboard to selection |
Ctrl + Z | Undo |
Ctrl + Y | Redo |
Ctrl + S | Save destination texture panel |
Ctrl + Shift + S | Save destination texture panel to new / other file |
Ctrl + E | Open source texture panel |
Ctrl + D | Open destination texture panel |
Ctrl + Q | Import from TR Level |
Ctrl + W | Open batch loader |
Limitations
- The height of any bitmap/texture panel handled by this tool is currently capped at 32,768 px or 128 pages (~256 px length per page). This limitation is required to avoid issues with the .NET WPF Bitmap containers.
- The height is always a multiple of 256 px, the standard TR page width, to ensure divisibility by picker sizes.
- Current supported destination texture panel widths: 256, 512, 1024, 2048, 4096 px (corresponding to 1, 2, 4, 8, and 16 pages).
- Current supported picker sizes: 8, 16, 32, 64, 128, 256 px
- Image files that do not meet these requirements will be automatically expanded or cropped. But you will always be able to open them.
License
This project is licensed under the MIT License.
Third-Party Libraries
For WPFZoomPanel I did some custom modifications and adapted it to .net 8. This modified project is included in this reporsitory as well.
Package | Version | Source | License | Project URL |
---|---|---|---|---|
WPFZoomPanel | - | GitHub | MIT | GitHub |
Pfim | 0.11.3 | NuGet | MIT | GitHub |
bzPSD | 0.1.0 | NuGet | BSD-3-Clause license | GitHub |
WPF UI | 4.0.3 | NuGet | MIT | GitHub |
Microsoft Dependency Injection | 9.0.6 | NuGet | MIT | Microsoft |
SharpZipLib | 1.4.2 | NuGet | MIT | GitHub |
I would like to express my gratitude to the TombEditor team and the authors of TRosettaStone. Their imppressive public contributions immensely helped me understanding the TR level file format.
Contributing
Contributions are welcome! If you find a bug or have a feature request, please open an issue.
If you want to contribute code, feel free to fork the repository and create a pull request.
Support
If you have any issues, please open a GitHub Issue.
To Do List
- Fix bugs
- Migrate from WPF to Win UI 3 or Avalonia