View Single Post
01-26-10, 05:02 PM   #14
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Bruners View Post
well its not that much now is it?

Code:
local _, player = UnitClass("player")
local colors = RAID_CLASS_COLORS
local r, g, b = colors[player].r*255, colors[player].g*255, colors[player].b*255
local string = "%d |cff%02x%02x%02xfps|r ||| %d |cff%02x%02x%02xms|r"
local fps = GetFramerate()
local ms = select(3, GetNetStats())
text:SetText(string.format(string, fps, r, g, b, ms, r, g, b))
And he can easily expand it or use the same variables elsewhere
Even though it technically would work, you're replacing the global string table with a local string value. It still works because the string library is set as the string's metatable.

There's also a new method that can be used, fontstring:SetFormattedText(formatstring,arg1,...)
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote