代码规范:把所有的tab换成空格
This commit is contained in:
@@ -6,95 +6,95 @@ local scene={}
|
||||
local backCounter
|
||||
local list,timer
|
||||
local function _push(mes)
|
||||
ins(list,{mes,120})
|
||||
timer=1
|
||||
ins(list,{mes,120})
|
||||
timer=1
|
||||
end
|
||||
|
||||
function scene.sceneInit()
|
||||
backCounter=5
|
||||
list={}
|
||||
timer=0
|
||||
backCounter=5
|
||||
list={}
|
||||
timer=0
|
||||
end
|
||||
|
||||
function scene.gamepadDown(key)
|
||||
_push("[gamepadDown] <"..key..">")
|
||||
_push("[gamepadDown] <"..key..">")
|
||||
end
|
||||
function scene.gamepadUp(key)
|
||||
_push{COLOR.H,"[gamepadUp] <"..key..">"}
|
||||
_push{COLOR.H,"[gamepadUp] <"..key..">"}
|
||||
end
|
||||
function scene.keyDown(key,isRep)
|
||||
if isRep then return end
|
||||
_push("[keyDown] <"..key..">")
|
||||
if key=="escape"then
|
||||
backCounter=backCounter-1
|
||||
if backCounter==0 then
|
||||
SCN.back()
|
||||
else
|
||||
MES.new('info',backCounter)
|
||||
end
|
||||
end
|
||||
if isRep then return end
|
||||
_push("[keyDown] <"..key..">")
|
||||
if key=="escape"then
|
||||
backCounter=backCounter-1
|
||||
if backCounter==0 then
|
||||
SCN.back()
|
||||
else
|
||||
MES.new('info',backCounter)
|
||||
end
|
||||
end
|
||||
end
|
||||
function scene.keyUp(key)
|
||||
_push{COLOR.H,"[keyUp] <"..key..">"}
|
||||
_push{COLOR.H,"[keyUp] <"..key..">"}
|
||||
end
|
||||
function scene.mouseClick(x,y)
|
||||
SYSFX.newRipple(.5,x,y,50)
|
||||
_push("[mouseClick]")
|
||||
SYSFX.newRipple(.5,x,y,50)
|
||||
_push("[mouseClick]")
|
||||
end
|
||||
function scene.mouseDown(x,y,k)
|
||||
SYSFX.newShade(.5,x-10,y-10,20,20)
|
||||
_push(("[mouseDown] <%d: %d, %d>"):format(k,x,y))
|
||||
SYSFX.newShade(.5,x-10,y-10,20,20)
|
||||
_push(("[mouseDown] <%d: %d, %d>"):format(k,x,y))
|
||||
end
|
||||
function scene.mouseMove(x,y)
|
||||
SYSFX.newShade(.5,x-3,y-3,6,6)
|
||||
SYSFX.newShade(.5,x-3,y-3,6,6)
|
||||
end
|
||||
function scene.mouseUp(x,y,k)
|
||||
SYSFX.newRectRipple(1,x-10,y-10,20,20)
|
||||
_push{COLOR.H,"[mouseUp] <"..k..">"}
|
||||
SYSFX.newRectRipple(1,x-10,y-10,20,20)
|
||||
_push{COLOR.H,"[mouseUp] <"..k..">"}
|
||||
end
|
||||
function scene.touchClick(x,y)
|
||||
SYSFX.newRipple(.5,x,y,50)
|
||||
_push("[touchClick]")
|
||||
SYSFX.newRipple(.5,x,y,50)
|
||||
_push("[touchClick]")
|
||||
end
|
||||
function scene.touchDown(x,y)
|
||||
SYSFX.newShade(.5,x-10,y-10,20,20)
|
||||
_push(("[touchDown] <%d, %d>"):format(x,y))
|
||||
SYSFX.newShade(.5,x-10,y-10,20,20)
|
||||
_push(("[touchDown] <%d, %d>"):format(x,y))
|
||||
end
|
||||
function scene.touchMove(x,y)
|
||||
SYSFX.newShade(.5,x-3,y-3,6,6)
|
||||
SYSFX.newShade(.5,x-3,y-3,6,6)
|
||||
end
|
||||
function scene.touchUp(x,y)
|
||||
SYSFX.newRectRipple(1,x-10,y-10,20,20)
|
||||
_push{COLOR.H,"[touchUp]"}
|
||||
SYSFX.newRectRipple(1,x-10,y-10,20,20)
|
||||
_push{COLOR.H,"[touchUp]"}
|
||||
end
|
||||
function scene.wheelMoved(dx,dy)
|
||||
_push(("[wheelMoved] <%d, %d>"):format(dx,dy))
|
||||
_push(("[wheelMoved] <%d, %d>"):format(dx,dy))
|
||||
end
|
||||
function scene.fileDropped(file)
|
||||
_push(("[fileDropped] <%s>"):format(file:getFilename()))
|
||||
_push(("[fileDropped] <%s>"):format(file:getFilename()))
|
||||
end
|
||||
function scene.directoryDropped(path)
|
||||
_push(("[directoryDropped] <%s>"):format(path))
|
||||
_push(("[directoryDropped] <%s>"):format(path))
|
||||
end
|
||||
|
||||
function scene.update(dt)
|
||||
if timer>0 then
|
||||
timer=timer-dt/.526
|
||||
end
|
||||
for i=#list,1,-1 do
|
||||
list[i][2]=list[i][2]-1
|
||||
if list[i][2]==0 then
|
||||
rem(list,i)
|
||||
end
|
||||
end
|
||||
if timer>0 then
|
||||
timer=timer-dt/.526
|
||||
end
|
||||
for i=#list,1,-1 do
|
||||
list[i][2]=list[i][2]-1
|
||||
if list[i][2]==0 then
|
||||
rem(list,i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function scene.draw()
|
||||
setFont(15)
|
||||
for i=1,#list do
|
||||
gc.setColor(1,1,1,list[i][2]/30)
|
||||
gc.print(list[i][1],20,20*i)
|
||||
end
|
||||
setFont(15)
|
||||
for i=1,#list do
|
||||
gc.setColor(1,1,1,list[i][2]/30)
|
||||
gc.print(list[i][1],20,20*i)
|
||||
end
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
|
||||
Reference in New Issue
Block a user