实现公告场景的功能
This commit is contained in:
@@ -2,8 +2,16 @@ local scene={}
|
||||
|
||||
function scene.enter()
|
||||
BG.set('cubes')
|
||||
if type(SCN.args[1])=='string' then
|
||||
scene.widgetList.texts:setTexts(SCN.args[1])
|
||||
local data=SCN.args[1]
|
||||
if data then
|
||||
local texts={}
|
||||
for i=1,#data do
|
||||
table.insert(texts,data[i].timestamp or "20??/??/??")
|
||||
table.insert(texts,data[i].content)
|
||||
table.insert(texts,"")
|
||||
table.insert(texts,"——————————————————————————")
|
||||
end
|
||||
scene.widgetList.texts:setTexts(texts)
|
||||
else
|
||||
scene.widgetList.texts:setTexts({"No data"})
|
||||
end
|
||||
@@ -27,7 +35,7 @@ function scene.keyDown(key)
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
WIDGET.newTextBox{name='texts',x=30,y=45,w=1000,h=640,font=20,fix=true},
|
||||
WIDGET.newTextBox{name='texts',x=30,y=45,w=1000,h=640,font=25,fix=true,lineH=45},
|
||||
WIDGET.newButton{name='back',x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user