Last week I did work on the building UI. It was a complete nightmare!
I wanted the UI to show you a preview of the building that you are going to build. Therefore if the user creates there own building the UI will automatically create a preview for that building for you to see. It was a pain.
Now for the technical bit for you who are interested.
- The end result is the building is render to a back-buffer.
- Then take this image and find the nearest pixels to each edge of the texture.
- Remove the rest of the image just leaving the rendered building
- Scale that texture to the correct size.
The result is something I am happy with. Its not to bad on performance either.