Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API FontString SetFormattedText

Last wiki revision 2023-08-21

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, ... ])

  • format : String - A string containing format specifiers (as with string.format).
  • arg : A list of values to be included in the formatted string.

The following snippet does set MyFontString to players attackspeed with 2 decimals.

The following code is to show that its possible to switch :SetText with :SetFormattedText

Source

https://warcraft.wiki.gg/wiki/API_FontString_SetFormattedText · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.