From 4800afa0db05247e7d40689cbef906fc7097bffc Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 28 Dec 2020 17:53:23 +0800 Subject: [PATCH] =?UTF-8?q?text=E6=8E=A7=E4=BB=B6=E5=A2=9E=E5=8A=A0plain?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/widget.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 5adf2e1a..e6e3c253 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -18,12 +18,14 @@ local text={ alpha=0, } function text:reset() - if type(self.text)=="string"then + if not self.plain and 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) - self.color=COLOR.dPurple - self.font=self.font-10 + if not self.plain then + self.color=COLOR.dPurple + self.font=self.font-10 + end end end function text:update() @@ -48,7 +50,7 @@ function text:draw() end end end -function WIDGET.newText(D)--name,x,y[,color][,font=30][,align="M"][,hide] +function WIDGET.newText(D)--name,x,y[,color][,font=30][,align="M"][,plain=false][,hide] local _={ name= D.name, x= D.x, @@ -56,6 +58,7 @@ function WIDGET.newText(D)--name,x,y[,color][,font=30][,align="M"][,hide] 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 @@ -777,7 +780,7 @@ function WIDGET.newTextBox(D)--name,x,y,w[,h][,font][,secret][,regex],hide }, font= D.font or int(D.h/7-1)*5, - secret= D.secret, + secret= D.secret==true, regex= D.regex, hide= D.hide, }