Skip to content

HUD text scale argument does nothing #17029

@Wuzzy2

Description

@Wuzzy2

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

  1. Install luacmd
  2. 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}})
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    @ DocumentationImprovements or additions to documentationBugIssues that were confirmed to be a bugLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions