Part of TPG namespace
TPG.UI.Pill(text, font, x, y, h, accent, color, padX)📋 Has LDoc👁️ 0 viewsUpdated 1 month ago
Description
Draw a panel sized to its own label text, returning the width it used. Fixed-width pills don't survive contact with real strings: 132px fits "Control Points" and clips "King of the Hill", and the economy tag was wider than its box on the first render. Measuring means the box is right for whatever mode name or font the client actually ends up with. defaults to TPG.UI.S(14). comes next.
Parameters
| Name | Type | Description |
|---|---|---|
text | string | |
font | string | A font name already created by `TPG.UI.BuildFonts`. |
x | number | |
y | number | |
h | number | |
accent? | Color | Passed through to `TPG.UI.Panel`. |
color? | Color | Text colour; defaults to `C.Text`. |
padX? | number | Horizontal padding on each side of the text; |
Returns
| Type | Description |
|---|---|
number | The pill's total width, so the caller can lay out what |
Examples
No examples available.
Used In
No usages found in the codebase.