From e911f4b9c51bd824d1026af2475db8250f21335a Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 12 Feb 2021 16:23:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88text=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E7=9A=84plain=E5=B1=9E=E6=80=A7=EF=BC=8C=E7=94=B1fText?= =?UTF-8?q?=E5=8F=96=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/widget.lua | 11 ++++------- parts/scenes/main.lua | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 4b26be05..177373ae 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -19,14 +19,12 @@ local text={ alpha=0, } function text:reset() - if not self.plain and type(self.text)=="string"then + if type(self.text)=="string"then self.text=gc.newText(getFont(self.font),self.text) elseif type(self.text)~="userdata"or self.text.type(self.text)~="Text"then self.text=gc.newText(getFont(self.font),self.name) - if not self.plain then - self.color=COLOR.dPurple - self.font=self.font-10 - end + self.color=COLOR.dPurple + self.font=self.font-10 end end function text:update() @@ -51,7 +49,7 @@ function text:draw() end end end -function WIDGET.newText(D)--name,x,y[,fText][,color][,font=30][,align="M"][,plain=false][,hide] +function WIDGET.newText(D)--name,x,y[,fText][,color][,font=30][,align="M"][,hide] local _={ name= D.name, x= D.x, @@ -61,7 +59,6 @@ function WIDGET.newText(D)--name,x,y[,fText][,color][,font=30][,align="M"][,plai color= D.color and(COLOR[D.color]or D.color)or COLOR.white, font= D.font or 30, align= D.align or"M", - plain= D.plain==true, hideCon=D.hide, } for k,v in next,text do _[k]=v end diff --git a/parts/scenes/main.lua b/parts/scenes/main.lua index 5cf2cc05..c3546591 100644 --- a/parts/scenes/main.lua +++ b/parts/scenes/main.lua @@ -104,8 +104,8 @@ function scene.draw() end scene.widgetList={ - WIDGET.newText{name=SYSTEM, x=610,y=50,color="white",font=30,align="L",plain=true}, - WIDGET.newText{name=VERSION_NAME,x=610,y=90,color="white",font=30,align="L",plain=true}, + WIDGET.newText{name="system", x=610,y=50,fText=SYSTEM,color="white",font=30,align="L"}, + WIDGET.newText{name="version", x=610,y=90,fText=VERSION_NAME,color="white",font=30,align="L"}, WIDGET.newButton{name="offline",x=150,y=220,w=200,h=140,color="lRed", font=40,code=goScene"mode"}, WIDGET.newButton{name="online", x=370,y=220,w=200,h=140,color="lCyan", font=40,code=function() if LOGIN then