-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
@ Client rendering@ Script APIConcept approvedApproved by a core dev: PRs welcomed!Approved by a core dev: PRs welcomed!Feature requestIssues that request the addition or enhancement of a featureIssues that request the addition or enhancement of a feature
Description
Problem
Currently, if you display text with hud_add, you can set the font size with the size parameter like so:
player:hud_add({
-- [...]
type = "text",
size = { x = 2, y = 2 },
-- [...]
}
However, size.x only supports integer values, which means you can only double, triple, quadruple, etc. the text size and not increase it by like 25%. If you use the number 1.25 (for example), it gets rounded down to 1.
Note the visual font size difference between size 1 and size 2 is HUGE.
Solutions
Allow for more fine-grained text size control in HUD elements.
An obvious (and maybe naive?) change would be to recognize the numbers in the size argument as floating-point numbers, so that size = { x = 1.5, y = 1.5 } increases the size by 50%. But I don’t know if this could create issues with the rest of the HUD system.
Alternatives
- Add new argument
font_sizeinstead (to avoid changing the number type ofsize.xandsize.y)
Additional context
No response
Zughy and immagiov4
Metadata
Metadata
Assignees
Labels
@ Client rendering@ Script APIConcept approvedApproved by a core dev: PRs welcomed!Approved by a core dev: PRs welcomed!Feature requestIssues that request the addition or enhancement of a featureIssues that request the addition or enhancement of a feature