Latest Posts

Topic: SVG menu images

brupje
Avatar
Topic Opener
Joined: 2023-02-08, 19:46
Posts: 1
Ranking
Just found this site
Posted at: 2023-02-08, 20:02

Hope this is the right place to post as it is also a bit code related.

I had a hard time understanding the icons in the game. Both because they are small on my monitor and because they are not clear to me.

I though using SVG files instead of png files would make more sense nowadays and it should also make it easier to scale menus on different monitor sizes.

So I forked the github and added support for SVG files and implemented most icons in the main menu as SVG: https://github.com/brupje/widelands As SDL already supports SVG the change was fairly easy, I only changed a hardcoded value for the menu height which might be better moved to an option or something.

Here are some screenshots of the results so far:

https://pasteboard.co/wDewqeEnkV4I.png https://pasteboard.co/jApuI5My07YX.png https://pasteboard.co/8FkvBKBDSMdJ.png https://pasteboard.co/h30JZPxGtgxY.png https://pasteboard.co/QiuAECImRGoJ.png

Is this something that would be accepted a pull request at some point?


Top Quote
tothxa
Avatar
Joined: 2021-03-24, 12:44
Posts: 482
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2023-02-08, 23:13

Hi brupje and welcome to the forum.

Yes, I think it's a good idea to switch to SVG images wherever we can. However personally I'd prefer keeping closer to the current look at least for the more elaborate icons, which would need quite a bit of artful graphical work.

I'm surprised you didn't have to change anything in the image handling code. I tried to look up SDL_image's handling of SVG and it looks like SDL rasterises the image on loading, so if I'm not mistaken, we will need code to load menu icons at the required size on theme loading. But icons that are scaled in-game with the map and could be switched to SVG (e.g. building space icons1 and soldier level indicators) will need some kind of scaling code that handles loading the images at multiple sizes.

Replacing the hardcoded sizes with themed values is already on the todo list.


  1. Building space icons are actually rendered images, but I think they could be traced in Inkscape to SVG 


Top Quote