local a = love.graphics.print
lg.print('SOME TEXTS', ...) -- Call love.graphics.print first time
local b = love.graphics.print
lg.print('SOME TEXTS', ...) -- Call love.graphics.print second time
local c = love.graphics.print
print(a == b) -- false
print(a == c) -- false
print(b == c) -- true (Why only the first call change love.graphics.print?)
Last edited by yangshenghan on Sat Jul 12, 2014 5:40 pm, edited 1 time in total.
Indeed, the first time you call print(f) it checks if a font has been loaded, and if not, it loads the default one. As a sidenote, you shouldn't need to tostring the functions to compare them.
OK. This make sense. But no matter whether I set a font before calling any print function, it changes anyway. So, should I consider this action normal? That is, under any situation, love.graphics.print and love.graphics.printf will change at first call anyway?
By the way, the code is part of my test. I forgot omitting the tostring() function