文本控件缺少文本时不会报错
This commit is contained in:
@@ -23,6 +23,10 @@ local text={
|
|||||||
function text:reset()
|
function text:reset()
|
||||||
if type(self.text)=="string"then
|
if type(self.text)=="string"then
|
||||||
self.text=gc.newText(getFont(self.font),self.text)
|
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
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function text:draw()
|
function text:draw()
|
||||||
|
|||||||
Reference in New Issue
Block a user