gl.LoadFont() tempry freezes game when loading widget ingame
Posted: 11 Jun 2011, 18:18
I am done with a widget but I just noticed that if I disable it ingame and then enable it, the screem will freeze for 3-5 secs. After a lot if trial and error I came to the conclusion that this is due to loading four different fonts:
Is this to be expected? Some way to fix this?
Code: Select all
local gl, GL = gl, GL
local header1FontSize = 20
local header1Font = gl.LoadFont("fonts/texgyreheros-bold.otf", header1FontSize, 45, 25)
local header2FontSize = 20
local header2Font = gl.LoadFont("fonts/texgyreheros-bold.otf", header2FontSize)
local header3FontSize = 20
local header3Font = gl.LoadFont("fonts/UnDotum.ttf", header3FontSize)
local toolTipFontSize = 12
local toolTipFont = gl.LoadFont("fonts/UnDotum.ttf", toolTipFontSize, 12)