@@ -107,17 +107,16 @@ local function updatePowerInfo()
107
107
gc_clear (0 ,0 ,0 ,.25 )
108
108
if state ~= ' unknown' then
109
109
gc_setLineWidth (4 )
110
- local charging = state == ' charging'
111
110
if state == ' nobattery' then
112
111
gc_setColor (1 ,1 ,1 )
113
112
gc_setLineWidth (2 )
114
- gc_line (74 ,SCR . safeX + 5 ,100 ,22 )
113
+ gc_line (74 ,5 ,100 ,22 )
115
114
elseif pow then
116
- if charging then gc_setColor (0 ,1 ,0 )
117
- elseif pow > 50 then gc_setColor (1 ,1 ,1 )
118
- elseif pow > 26 then gc_setColor (1 ,1 ,0 )
119
- elseif pow == 26 then gc_setColor (.5 ,0 ,1 )
120
- else gc_setColor (1 ,0 ,0 )
115
+ if state == ' charging' then gc_setColor (0 ,1 ,0 )
116
+ elseif pow > 50 then gc_setColor (1 ,1 ,1 )
117
+ elseif pow > 26 then gc_setColor (1 ,1 ,0 )
118
+ elseif pow == 26 then gc_setColor (.5 ,0 ,1 )
119
+ else gc_setColor (1 ,0 ,0 )
121
120
end
122
121
gc .rectangle (' fill' ,76 ,6 ,pow * .22 ,14 )
123
122
if pow < 100 then
@@ -492,15 +491,16 @@ function love.lowmemory()
492
491
MES .new (' check' ," [auto GC] low MEM 设备内存过低" )
493
492
end
494
493
end
494
+
495
+ local onResize = NULL
495
496
function love .resize (w ,h )
496
497
if SCR .w == w and SCR .h == h then return end
497
498
SCR .resize (w ,h )
498
499
if BG .resize then BG .resize (w ,h )end
499
500
if SCN .resize then SCN .resize (w ,h )end
500
501
WIDGET .resize (w ,h )
501
502
FONT .reset ()
502
-
503
- SHADER .warning :send (' w' ,w * SCR .dpi )
503
+ onResize (w ,h )
504
504
end
505
505
506
506
local onFocus = NULL
858
858
859
859
function Z .setOnFocus (func )onFocus = assert (type (func )== ' function' and func ," Z.setOnFocus(func): func must be a function" )end
860
860
861
+ function Z .setOnResize (func )onResize = assert (type (func )== ' function' and func ," Z.setOnResize(func): func must be a function" )end
862
+
861
863
function Z .setOnQuit (func )onQuit = assert (type (func )== ' function' and func ," Z.setOnQuit(func): func must be a function" )end
862
864
863
865
return Z
0 commit comments