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
Treat built-in hotbar, nametags, minimap, crosshair like Lua HUD elements #9270
Comments
Lines 1263 to 1266 in 4445889
If this does not work, please rephrase this as a bug report. |
Oops, according to the doc, it should be Well, I tested it both ways and it behaved the same... |
All the Lua-defined HUD elements are all drawn together at https://github.com/minetest/minetest/blob/master/src/client/render/core.cpp#L90, so they are always above the crosshair and hotbar, and always beneath the nametags and minimap. |
You are right that it's currently impossible to change the order of C++-defined HUD elements. They would need to be treated like Lua HUD elements (or even added from Lua rather than C++). |
Actually defining them in Lua would be awesome, because not only could they then be subject to the same sorting rules, but it would also provide a template for replacing them, or creating additional elements that connect with them properly. Right now, defining Lua HUD elements that align properly with the built-in ones is a lot of guess-work and fine-tuning, and requires taking into account things like custom font sizes, different screen sizes and DPI, and different scaling options, and in some cases it's not possible to reliably align elements at all. |
+1 for unhardcoding anything that can be unhardcoded. The hearts bar belongs in minetest_game and it's just a nuisance otherwise. So is the built-in concept of "health" or "breath". |
For minimap, see #9079. |
👍 I need this for MCL2 when the player wears a pumpkin as head armor. The screen is supposed to Personally, I don't care whether crosshair and hotbar are hardcoded or not. Obviously, unhardcoding would be nice, but is no means neccessary. For a quick lazy fix: Render crosshair and hotbar after all Lua HUD elements are those are critical. I can see no use case for obstructing those, tbh. |
I've had this exact issue recently, and ended up having to make my own hotbar element
Custom damage/poison colors. Styling that only partially obscures |
Yeah, right. My quick lazy fix was dumb. So there is no quick lazy fix, apparently. |
Minetest version
OS / Hardware
Operating system:
Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux
CPU:
Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
Summary
Unable to draw HUDs beneath built-in HUDs using z_index.
Steps to reproduce
Minimal test case mod
init.lua
:Applied on top of MTG (or probably most other games).
Expected result
A full-screen black HUD covers the entire screen, with all existing built-in HUD elements drawn over top of it.
Actual result
The text was updated successfully, but these errors were encountered: