-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Luanti version
Luanti 5.15.1
Operating system and version
GNU/Linux
Summary
The documentation claims that the scale argument of HUD text elements does this:
scale: Defines the bounding rectangle of the text, syntax is
{ x = <number>, y = <number> }.
A value such as{ x = 100, y = 100 }should work.
(NOTE: Don't confuse scale with size! size is for the font size!)
But no matter which values I pick, the text always renders the same. The documentation is vague, so I expect something like the text being cut off outside the bounding rectangle, or words wrapping. But whatever numbers I choose, nothing changes.
Steps to reproduce
- Install
luacmd - Run this command:
/lua hud = me:hud_add({type="text", text="Alpha beta gamma delta", scale={x=100, y=100}, position={x=0.5,y=0.8}}) - Now run this command:
/lua me:hud_change(hud, "scale", {x=10, y=10})
Repeat step 3 with a scale argument of your choosing. Experiment with large values, tiny values, negative values, anything to provoke a change in rendering.
I expect the text to render normally after step 2 and be cut off or wrapped after step 3.
But for me, the text looks identical after all steps and renders in full.
What do do?
I believe this feature has been broken like forever and may not be a regression. I can’t remember if scale has ever done anything to HUD text.
Implementing this feature after-the-fact is likely to break existing mods which unwittingly provided some bogus small scale "bounding" box and suddenly their HUD texts will be cut off.
Thus, instead of fixing this bug, another option would be to just delete the offending documentation and call it a day, because the documentation is false. This, however, begs the question what to do if it is ever decided to actually make bounding boxes work without breaking existing mods.