View Single Post
10-14-20, 02:45 PM   #2
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
I have tried also to change the function in this way (taken by Phanx addon):

Lua Code:
  1. local function SetFont(obj, font, size, style, r, g, b, sr, sg, sb, sox, soy)
  2.     if not obj then return end -- TODO: prune things that don't exist anymore
  3.     obj:SetFont(font, size, style)
  4.     if sr and sg and sb then
  5.         obj:SetShadowColor(sr, sg, sb)
  6.     end
  7.     if sox and soy then
  8.         obj:SetShadowOffset(sox, soy)
  9.     end
  10.     if r and g and b then
  11.         obj:SetTextColor(r, g, b)
  12.     elseif r then
  13.         obj:SetAlpha(r)
  14.     end
  15. end

But I got:

Lua Code:
  1. 10x gmFonts\core.lua:41: attempt to call method 'SetFont' (a nil value)
  2. [string "@gmFonts\core.lua"]:41: in function <gmFonts\core.lua:39>
  3. [string "@gmFonts\core.lua"]:69: in function <gmFonts\core.lua:55>
  4. [string "@gmFonts\core.lua"]:100: in function <gmFonts\core.lua:87>
  5.  
  6. Locals:
  7. obj = "AchievementFont_Small"
  8. font = "Addons\gmFonts\fonts\Candarab.ttf"
  9. size = 12
  10. style = nil
  11. r = nil
  12. g = nil
  13. b = nil
  14. sr = 0
  15. sg = 0
  16. sb = 0
  17. sox = 1
  18. soy = -1
  19. (*temporary) = nil
  20. (*temporary) = "AchievementFont_Small"
  21. (*temporary) = "Addons\gmFonts\fonts\Candarab.ttf"
  22. (*temporary) = 12
  23. (*temporary) = nil
  24. (*temporary) = "attempt to call method 'SetFont' (a nil value)"

Thanks again.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote