Hi all,
the next error I am trying to fix is this.
This happens when I try to change fonts attributes calling the function in this way:
Lua Code:
....
gmfontset["Roboto"] = {"Roboto-Regular.ttf", "Roboto-Bold.ttf", "Roboto-Italic.ttf", "Roboto-BoldItalic.ttf"}
....
GMFONTS["N"] = fontpath .. gmfontset[text][1]
GMFONTS["B"] = fontpath .. gmfontset[text][2]
GMFONTS["BI"] = fontpath .. gmfontset[text][3]
GMFONTS["I"] = fontpath .. gmfontset[text][4]
GMFONTS["NR"] = fontpath .. gmfontset[text][1]
......
local function SetFont(obj, font, size, style, r, g, b, sr, sg, sb, sox, soy)
obj:SetFont(font, size, style)
if sr and sg and sb then obj:SetShadowColor(sr, sg, sb) end
if sox and soy then obj:SetShadowOffset(sox, soy) end
if r and g and b then obj:SetTextColor(r, g, b)
elseif r then obj:SetAlpha(r) end
end
.....
SetFont("AchievementFont_Small",GMFONTS["B"], 12)
SetFont("FriendsFont_Large",GMFONTS["N"], 15, nil, nil, nil, nil, 0, 0, 0, 1, -1)
.... a lot of fonts names here and down :) ....
The error is this:
Lua Code:
40x gmFonts\core.lua:40: attempt to call method 'SetFont' (a nil value)
[string "@gmFonts\core.lua"]:40: in function <gmFonts\core.lua:39>
[string "@gmFonts\core.lua"]:61: in function <gmFonts\core.lua:47>
[string "@gmFonts\core.lua"]:92: in function <gmFonts\core.lua:79>
Locals:
obj = "AchievementFont_Small"
font = "Addons\gmFonts\fonts\Candarab.ttf"
size = 12
style = nil
r = nil
g = nil
b = nil
sr = nil
sg = nil
sb = nil
sox = nil
soy = nil
(*temporary) = nil
(*temporary) = "AchievementFont_Small"
(*temporary) = "Addons\gmFonts\fonts\Candarab.ttf"
(*temporary) = 12
(*temporary) = nil
(*temporary) = "attempt to call method 'SetFont' (a nil value)"
It should be that the fonts names are not global anymore ?
Thanks for any advices