From Bohemia Interactive Community
Jump to navigation
Jump to search
Hover & click on the images for description
Description
- Description:
- Returns estimated width of the text based on font type and size. Similar to ctrlTextWidth but does not require a control and can be used to estimate text width for any control including buttons. Result does not include left and right margins (hardcoded at 0.008 each).
- Groups:
- GUI ControlStrings
Syntax
- Syntax:
- text getTextWidth [font, size]
- Parameters:
- text: String - text string to measure
- font: String - font type
- size: Number - font size
- Return Value:
- Number
Examples
- Example 1:
- Example 2:
- Example 3:
Additional Information
- See also:
- ctrlTextWidth
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here!
Add Note
- R3vo
- Posted on Oct 28, 2020 - 22:10 (UTC)
-
When working with multiline controls ctrlTextWidth or getTextWidth will not return a proper value since the text will be treated as one long line.
Solution (Execute in Eden Editor):