Add Unit icons and IconRenderBooth #114
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds icons for all units and a dev render booth to render them.
Icon Overview
Build Menu
Replaces the single letter buttons with the icons.
Readability should likely be improved further with some labels or better backdrops.
Icon Render Booth
The icons are rendered with a special
IconRenderBooth
scene in the util folder.Below the render Viewport each unit has a Node3D with the same name as the unit. The node has its own Camera3D child and whatever custom setup needs to be made visible as well.
When the scene is played it goes through each node, makes it visible and activates the child camera and takes a snapshot image of the unit. The image is stored inside the
res://assets/ui/icons/
folder as a png.Notes
Due the the way that the unit scene file stores their geometry with all kinds of gameplay extras this wasn't very clean. I ended up making the unit geometry unique and discarding everything that got in the camera's way. This naturally lead to some resource duplication now like meshes stored inside the scene file. Imo this should be cleaned up and improved on the unit level by having the visible unit geometry like meshes split from the rest of the unit. This is already partially done for the structure-geometries.
@Scony the "grid" texture that I ended up using for the ground is from the kenney prototype textures pack.
https://www.kenney.nl/assets/prototype-textures