Files
Techmino/parts/scenes/manual.lua
MrZ_26 06f4bb4e1a 整 理 代 码
(应该没有改到字符串里面的东西吧…)起码不直接影响运行
2022-10-01 11:32:11 +08:00

37 lines
1020 B
Lua

local scene={}
function scene.sceneInit()
BG.set('cubes')
local fileData=FILE.load('parts/language/manual_'..(SETTING.locale:find'zh' and 'zh' or SETTING.locale:find'ja' and 'ja' or 'en')..'.txt','-string')
if fileData then
WIDGET.active.texts:setTexts(fileData:split('\n'))
else
WIDGET.active.texts:setTexts{"[manual file not found]"}
end
end
function scene.wheelMoved(_,y)
WHEELMOV(y)
end
function scene.keyDown(key)
if key=='up' then
WIDGET.active.texts:scroll(-5)
elseif key=='down' then
WIDGET.active.texts:scroll(5)
elseif key=='pageup' then
WIDGET.active.texts:scroll(-20)
elseif key=='pagedown' then
WIDGET.active.texts:scroll(20)
elseif key=='escape' then
SCN.back()
end
end
scene.widgetList={
WIDGET.newTextBox{name='texts',x=30,y=45,w=1000,h=640,font=15,fix=true},
WIDGET.newButton{name='back',x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}
return scene