New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
size of hotbar background textures #9580
Comments
The relevant source file: https://github.com/minetest/minetest/blob/master/src/client/hud.cpp |
I am using a default game window size 1024x600 on a desktop PC.
I cannot see either of these happening. I do not think you can state that the textures in MTGame are incorrect, they are fine for me, and it seems that sfan5 suggests this may depend on device. |
On newer versions of Minetest (5.1.x and above, I believe), gui_formbg.png is a 9-slice texture with a border width of 10 pixels. If you don't intend to support older clients, then you can use whatever resolution you want as long as you design your texture with that border width in mind. And honestly, you probably won't be able to make a background that scales scales properly in all cases on older clients because the size and aspect ratio of prepended formspecs are arbitrary. This is why we use 9-slice textures now. I don't think gui_hb_bg.png has a set size... It's a 1x1 formspec image, so it's the size of an inventory slot. The size will vary by device, so I'd pick something consistent with other formspec images of that size. If you're making a TP, that means probably the size of icons like the furnace arrow. If you're making a game, you'll want to pick a number that looks good and stick to it. |
Here are two textures that are pixel-perfect on my system: All these sizes change with the DPI(*), but textures are always scaled to the sizes the HUD expects:
(*) The size of the black square is calculated as
The window size is irrelevant by the way |
the background looks flawless, but the selection frame is odd on the left border. but now i noticed something else: looking for alternate screens for comparison, i viewed it on my phone and it happens there too. although in different places and less noticeable (my phone has a much higher screen resolution than my notebook). but i still need to know something: |
I explained the exact sizes of the borders in my post, no idea how you arrive at 1/6 or 1/8. |
Do you mean that the right side of the frame is compressed slightly in size? If so, yes that is visible in MTGame for me, but is due to what appears to be texture scaling, it is not 'cut off'.
Ok i see what you mean. This is not noticeable in MTGame when i use it. I am not sure these textures deserve dimension documentation, as everyone will want different appearences anyway, and they can analyse the MTgame textures if they want some guidance. So 'low priority' i think. |
i calculated it based on your sizes. |
i was able to scale it down to half size, with slots being 24 pixels. it is possible to get a few other sizes by thinning the borders, but none of those are compatible with 16x textures. while 24x slot size is the smallest possible, i found the 48x slot size more fitting with 16x textures, as the smaller one doesn't allow enough detail on the borders.
since the MTG hotbar is just grey lines, the smaller scale with 24x slot size would be enough, it's easier to analyze. |
Not a problem =) |
Problem
There is no documentation about the size of the hotbar (or the recommended size for custom hotbar textures).
Not that those are needed to play the game, but it is an essential feature for Texture Packs and Games, and since there is support for custom textures, it should be documented somewhere.
I tried to make a template for custom textures using the sizes I read from the hotbar textures provided in Minetest Game, but even those "official" textures are not of the correct size.
The 'gui_hotbar_selected.png' image gets cut off on the right side, and the item item slots in 'gui_hotbar.png' are gradually misplaced as the selection frame moves towards the right side.
these are the templates i made based on the textures from Minetest Game:
Solutions
Someone decided the design on the hotbar; and even if that person is no longer around, someone must be able read that code and tell what size the hotbar textures are scaled to.
Furthermore, the textures used in Minetest Game should be updated accordingly, but that's an MTG issue i guess...
Additional context
While we are at it, i would also like to know the same stuff for the formspec textures 'gui_formbg.png' and 'gui_hb_bg.png'.
They don't concern my project yet, but eventually they will. (for the same reason)
The text was updated successfully, but these errors were encountered: