调整字体相关的一些东西
整理代码
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local gc=love.graphics
|
||||
local set=gc.setFont
|
||||
local fontCache={}
|
||||
local currentFontSize
|
||||
|
||||
@@ -8,7 +9,7 @@ function FONT.set(s)
|
||||
if not fontCache[s]then
|
||||
fontCache[s]=gc.setNewFont(s,'light',gc.getDPIScale()*SCR.k*2)
|
||||
end
|
||||
gc.setFont(fontCache[s])
|
||||
set(fontCache[s])
|
||||
currentFontSize=s
|
||||
end
|
||||
end
|
||||
@@ -33,7 +34,7 @@ function FONT.init(mainFont,secFont)
|
||||
fontCache[s]=gc.setNewFont(mainFont,s,'light',gc.getDPIScale()*SCR.k*2)
|
||||
fontCache[s]:setFallbacks(gc.setNewFont(secFont,s,'light',gc.getDPIScale()*SCR.k*2))
|
||||
end
|
||||
gc.setFont(fontCache[s])
|
||||
set(fontCache[s])
|
||||
currentFontSize=s
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user