取消text控件的plain属性,由fText取代

This commit is contained in:
MrZ626
2021-02-12 16:23:07 +08:00
parent 74ba833b47
commit e911f4b9c5
2 changed files with 6 additions and 9 deletions

View File

@@ -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

View File

@@ -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