The API is no longer being updated here until further notice. |
Sets the text displayed in the font string using format specifiers. Equivalent to :SetText(string.format("format", value)), but does not create a throwaway Lua string object, resulting in greater memory-usage efficiency.
FontString:SetFormattedText("format" [, arg1, arg2, ... ])
Arguments[]
- format
- String - A string containing format specifiers (as with string.format()).
- arg
- A list of values to be included in the formatted string.
Example[]
The following snippet does set MyFontString to players attackspeed with 2 decimals.
local mhSpeed, ohSpeed = UnitAttackSpeed("player");
fontString:SetFormattedText("%.2f", mhSpeed)
The following code is to show that its possible to switch :SetText with :SetFormattedText
fontString:SetFormattedText("Hello World")
Patch changes[]
- Patch 2.4.0 (2008-03-25): Added.