修复字符串扩展模块时间转换方法问题
微调音乐室ui 修复更换字体后左上时间歪了
This commit is contained in:
@@ -13,7 +13,7 @@ function FONT.set(s)
|
|||||||
currentFontSize=s
|
currentFontSize=s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function FONT.get(s)print(1)
|
function FONT.get(s)
|
||||||
if not fontCache[s]then
|
if not fontCache[s]then
|
||||||
fontCache[s]=gc.setNewFont(s,'light',gc.getDPIScale()*SCR.k*2)
|
fontCache[s]=gc.setNewFont(s,'light',gc.getDPIScale()*SCR.k*2)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ local function updatePowerInfo()
|
|||||||
gc_draw(batteryImg,58,3)
|
gc_draw(batteryImg,58,3)
|
||||||
end
|
end
|
||||||
FONT.set(25)
|
FONT.set(25)
|
||||||
gc_print(os.date("%H:%M"),5,-2)
|
gc_print(os.date("%H:%M"),5,-3)
|
||||||
gc_pop()
|
gc_pop()
|
||||||
gc.setCanvas()
|
gc.setCanvas()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ function STRING.time(t)
|
|||||||
if t<60 then
|
if t<60 then
|
||||||
return format("%.3f\"",t)
|
return format("%.3f\"",t)
|
||||||
elseif t<3600 then
|
elseif t<3600 then
|
||||||
return format("%d'%05.2f\"",int(t/60),int(t%60))
|
return format("%d'%05.2f\"",int(t/60),t%60)
|
||||||
else
|
else
|
||||||
return format("%d:%.2d'%05.2f\"",int(t/3600),int(t/60%60),int(t%60))
|
return format("%d:%.2d'%05.2f\"",int(t/3600),int(t/60%60),t%60)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ function scene.draw()
|
|||||||
gc.print(BGM.nowPlay,710,508)
|
gc.print(BGM.nowPlay,710,508)
|
||||||
setFont(35)
|
setFont(35)
|
||||||
gc.setColor(1,sin(t*2.6)*.5+.5,sin(t*2.6)*.5+.5)
|
gc.setColor(1,sin(t*2.6)*.5+.5,sin(t*2.6)*.5+.5)
|
||||||
gc.print(author[BGM.nowPlay]or"MrZ",680,465)
|
gc.print(author[BGM.nowPlay]or"MrZ",670,465)
|
||||||
|
|
||||||
local a=-t%2.3/2
|
local a=-t%2.3/2
|
||||||
if a<1 then
|
if a<1 then
|
||||||
@@ -92,7 +92,7 @@ function scene.draw()
|
|||||||
gc.setColor(COLOR.Z)
|
gc.setColor(COLOR.Z)
|
||||||
local cur=BGM.playing:tell()
|
local cur=BGM.playing:tell()
|
||||||
local dur=BGM.playing:getDuration()
|
local dur=BGM.playing:getDuration()
|
||||||
gc.print(STRING.time_simp(cur%dur).." / "..STRING.time_simp(dur),500,626)
|
gc.print(STRING.time_simp(cur%dur).." / "..STRING.time_simp(dur),480,626)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ scene.widgetList={
|
|||||||
WIDGET.newText{name="title", x=30,y=30,font=80,align='L'},
|
WIDGET.newText{name="title", x=30,y=30,font=80,align='L'},
|
||||||
WIDGET.newText{name="arrow", x=270,y=360,font=45,align='L'},
|
WIDGET.newText{name="arrow", x=270,y=360,font=45,align='L'},
|
||||||
WIDGET.newText{name="now", x=700,y=500,font=50,align='R',hideF=function()return not BGM.nowPlay end},
|
WIDGET.newText{name="now", x=700,y=500,font=50,align='R',hideF=function()return not BGM.nowPlay end},
|
||||||
WIDGET.newSlider{name="slide",x=500,y=600,w=400,
|
WIDGET.newSlider{name="slide",x=480,y=600,w=400,
|
||||||
disp=function()return BGM.playing:tell()/BGM.playing:getDuration()%1 end,
|
disp=function()return BGM.playing:tell()/BGM.playing:getDuration()%1 end,
|
||||||
show=false,
|
show=false,
|
||||||
code=function(v)BGM.playing:seek(v*BGM.playing:getDuration())end,
|
code=function(v)BGM.playing:seek(v*BGM.playing:getDuration())end,
|
||||||
|
|||||||
Reference in New Issue
Block a user