主菜单ui再重做,词典入口移至主菜单
This commit is contained in:
@@ -41,10 +41,9 @@ end
|
||||
scene.widgetList={
|
||||
WIDGET.newImage{name="pay1", x=20, y=20},
|
||||
WIDGET.newImage{name="pay2", x=1014, y=20},
|
||||
WIDGET.newButton{name="manual", x=1140, y=350,w=220,h=70,font=35,code=goScene"manual"},
|
||||
WIDGET.newButton{name="dict", x=1140, y=430,w=220,h=70,font=35,code=goScene"dict"},
|
||||
WIDGET.newButton{name="staff", x=1140, y=510,w=220,h=70,font=35,code=goScene"staff"},
|
||||
WIDGET.newButton{name="his", x=1140, y=590,w=220,h=70,font=35,code=goScene"history"},
|
||||
WIDGET.newButton{name="manual", x=1140, y=400,w=220,h=70,font=35,code=goScene"manual"},
|
||||
WIDGET.newButton{name="staff", x=1140, y=490,w=220,h=70,font=35,code=goScene"staff"},
|
||||
WIDGET.newButton{name="his", x=1140, y=580,w=220,h=70,font=35,code=goScene"history"},
|
||||
WIDGET.newButton{name="qq", x=1140, y=670,w=220,h=70,font=35,code=function()love.system.openURL("tencent://message/?uin=1046101471&Site=&Menu=yes")end,hide=MOBILE},
|
||||
WIDGET.newButton{name="back", x=640, y=600,w=170,h=80,font=35,code=backScene},
|
||||
}
|
||||
|
||||
@@ -2,14 +2,31 @@ local gc=love.graphics
|
||||
|
||||
local scene={}
|
||||
|
||||
local tipLength=540
|
||||
local tip=gc.newText(getFont(30),"")
|
||||
local scrollX
|
||||
|
||||
local cmdEntryThread=coroutine.create(function()
|
||||
while true do
|
||||
while true do
|
||||
if YIELD()~="c"then break end
|
||||
SFX.play("ren_6")
|
||||
if YIELD()~="m"then break end
|
||||
SFX.play("ren_9")
|
||||
if YIELD()~="d"then break end
|
||||
SFX.play("ren_10")
|
||||
if YIELD()~="k"then break end
|
||||
SFX.play("ren_11")
|
||||
SCN.go("app_cmd")
|
||||
end
|
||||
end
|
||||
end)
|
||||
function scene.sceneInit()
|
||||
tip:set(text.getTip())
|
||||
scrollX=1000
|
||||
scrollX=tipLength
|
||||
|
||||
BG.set()
|
||||
coroutine.resume(cmdEntryThread)
|
||||
|
||||
--Create demo player
|
||||
destroyPlayers()
|
||||
@@ -20,12 +37,24 @@ function scene.sceneInit()
|
||||
PLAYERS[1]:setPosition(560,50,.95)
|
||||
end
|
||||
|
||||
function scene.mouseDown(x,y)
|
||||
if x>=550 and x<=840 and y>=50 and y<=620 then
|
||||
coroutine.resume(cmdEntryThread,
|
||||
x<610 and y>560 and"c"or
|
||||
x>780 and y>560 and"m"or
|
||||
x<610 and y<110 and"d"or
|
||||
x>780 and y<110 and"k"or
|
||||
"x"
|
||||
)
|
||||
end
|
||||
end
|
||||
scene.touchDown=scene.mouseDown
|
||||
function scene.keyDown(key)
|
||||
if key=="q"then
|
||||
loadGame(STAT.lastPlay,true)
|
||||
elseif key=="p"then
|
||||
if key=="1"then
|
||||
SCN.go("mode")
|
||||
elseif key=="m"then
|
||||
elseif key=="q"then
|
||||
loadGame(STAT.lastPlay,true)
|
||||
elseif key=="a"then
|
||||
if not LATEST_VERSION then
|
||||
TEXT.show(text.notFinished,370,380,60,"flicker")
|
||||
SFX.play("finesseError")
|
||||
@@ -48,18 +77,26 @@ function scene.keyDown(key)
|
||||
else
|
||||
SCN.go("login")
|
||||
end
|
||||
elseif key=="escape"then
|
||||
SCN.back()
|
||||
elseif key=="z"then
|
||||
SCN.go("customGame")
|
||||
elseif key=="-"then
|
||||
SCN.go("setting_game")
|
||||
elseif key=="p"then
|
||||
SCN.go("stat")
|
||||
elseif key=="l"then
|
||||
SCN.go("music")
|
||||
elseif key==","then
|
||||
SCN.go("help")
|
||||
elseif key=="application"then
|
||||
SCN.go("dict")
|
||||
elseif key=="ralt"then
|
||||
SCN.go("lang")
|
||||
elseif key=="f1"then
|
||||
SCN.go("manual")
|
||||
elseif key=="c"then
|
||||
SCN.go("customGame")
|
||||
elseif key=="s"then
|
||||
SCN.go("setting_game")
|
||||
else
|
||||
WIDGET.keyPressed(key)
|
||||
elseif key=="escape"then
|
||||
SCN.back()
|
||||
elseif key=="c"or key=="m"or key=="d"or key=="k"or key=="x"then
|
||||
coroutine.resume(cmdEntryThread,key)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -68,22 +105,26 @@ function scene.update(dt)
|
||||
PLAYERS[1]:update(dt)
|
||||
scrollX=scrollX-2.6
|
||||
if scrollX<-tip:getWidth()then
|
||||
scrollX=1000
|
||||
scrollX=tipLength
|
||||
tip:set(text.getTip())
|
||||
end
|
||||
end
|
||||
|
||||
local function tipStencil()
|
||||
gc.rectangle("fill",0,0,1000,42)
|
||||
gc.rectangle("fill",0,0,tipLength,42)
|
||||
end
|
||||
function scene.draw()
|
||||
gc.setColor(1,1,1)
|
||||
--Version
|
||||
setFont(30)
|
||||
gc.setColor(.6,.6,.6)
|
||||
gc.printf(SYSTEM,640,30,600,"right")
|
||||
gc.printf(VERSION_NAME,640,70,600,"right")
|
||||
|
||||
--Title
|
||||
gc.setColor(1,1,1)
|
||||
gc.draw(TEXTURE.title_color,20,20,nil,.43)
|
||||
|
||||
--Quick play
|
||||
setFont(30)
|
||||
local L=text.modes[STAT.lastPlay]
|
||||
gc.print(L[1],365,300)
|
||||
gc.print(L[2],365,340)
|
||||
@@ -92,7 +133,7 @@ function scene.draw()
|
||||
gc.push("transform")
|
||||
gc.translate(40,650)
|
||||
gc.setLineWidth(2)
|
||||
gc.rectangle("line",0,0,1000,42)
|
||||
gc.rectangle("line",0,0,tipLength,42)
|
||||
gc.stencil(tipStencil,"replace",1)
|
||||
gc.setStencilTest("equal",1)
|
||||
gc.draw(tip,0+scrollX,0)
|
||||
@@ -105,19 +146,19 @@ function scene.draw()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
WIDGET.newText{name="system", x=1245,y=40,fText=SYSTEM, color="white", font=30,align="R"},
|
||||
WIDGET.newText{name="version", x=1245,y=80,fText=VERSION_NAME, color="white", font=30,align="R"},
|
||||
WIDGET.newButton{name="offline",x=50,y=210,w=600,h=100, color="lRed", font=45,align="R", code=pressKey"p"},
|
||||
WIDGET.newButton{name="qplay", x=50,y=330,w=600,h=100, color="lCyan", font=45,align="R", code=pressKey"q"},
|
||||
WIDGET.newButton{name="online", x=50,y=450,w=600,h=100, color="lBlue", font=45,align="R", code=pressKey"m"},
|
||||
WIDGET.newButton{name="custom", x=50,y=570,w=600,h=100, color="white", font=45,align="R", code=pressKey"c"},
|
||||
WIDGET.newButton{name="setting",x=1230,y=210,w=600,h=100, color="lYellow",font=40,align="L", code=pressKey"s"},
|
||||
WIDGET.newButton{name="stat", x=1230,y=330,w=600,h=100, color="lOrange",font=40,align="L", code=goScene"stat"},
|
||||
WIDGET.newButton{name="music", x=1290,y=450,w=480,h=100, color="grape", font=30,align="L", code=goScene"music"},
|
||||
WIDGET.newButton{name="sound", x=1290,y=570,w=480,h=100, color="pink", font=30,align="L", code=goScene"sound"},
|
||||
WIDGET.newButton{name="help", x=950,y=450,w=170,h=100, color="blue", font=35, code=goScene"help"},
|
||||
WIDGET.newButton{name="lang", x=950,y=570,w=170,h=100, color="lCyan", font=40, code=goScene"lang"},
|
||||
WIDGET.newButton{name="quit", x=1170,y=670,w=190,h=70, color="grey", font=40, code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end},
|
||||
WIDGET.newButton{name="offline",x=20,y=210,w=600,h=100, color="lR", font=45,align="R",edge=30, code=pressKey"1"},
|
||||
WIDGET.newButton{name="qplay", x=50,y=330,w=600,h=100, color="lM", font=45,align="R",edge=30, code=pressKey"q"},
|
||||
WIDGET.newButton{name="online", x=80,y=450,w=600,h=100, color="lPurple",font=45,align="R",edge=30, code=pressKey"a"},
|
||||
WIDGET.newButton{name="custom", x=110,y=570,w=600,h=100, color="lSea", font=45,align="R",edge=30, code=pressKey"z"},
|
||||
|
||||
WIDGET.newButton{name="setting",x=1170,y=210,w=600,h=100, color="lOrange",font=40,align="L",edge=30, code=pressKey"-"},
|
||||
WIDGET.newButton{name="stat", x=1200,y=330,w=600,h=100, color="lLame", font=40,align="L",edge=30, code=pressKey"p"},
|
||||
WIDGET.newButton{name="music", x=1230,y=450,w=600,h=100, color="lGreen", font=40,align="L",edge=30, code=pressKey"l"},
|
||||
WIDGET.newButton{name="help", x=1260,y=570,w=600,h=100, color="lC", font=40,align="L",edge=30, code=pressKey","},
|
||||
|
||||
WIDGET.newButton{name="lang", x=720,y=670,w=200,h=70, color="Y", font=40, code=goScene"lang"},
|
||||
WIDGET.newButton{name="dict", x=940,y=670,w=200,h=70, color="orange", font=35, code=goScene"dict"},
|
||||
WIDGET.newButton{name="quit", x=1160,y=670,w=200,h=70, color="R", font=40, code=function()VOC.play("bye")SCN.swapTo("quit","slowFade")end},
|
||||
}
|
||||
|
||||
return scene
|
||||
Reference in New Issue
Block a user