Active Member Koray 2002 Posted October 13, 2015 Active Member Share Posted October 13, 2015 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Code: class MultiTextLine(ui.TextLine): def __init__(self, parent, text, x, y, range = 15): ui.TextLine.__init__(self) self.TextList = [] self.CreateUI(parent, text, x, y, range) def __del__(self): del self.TextList ui.TextLine.__del__(self) def CreateUI(self, parent, text, x, y, range): if "\n" in str(text): self.first_text = ui.TextLine() self.first_text.SetParent(parent) self.first_text.SetPosition(x, y) self.first_text.SetText(text.split("\n")[0]) self.first_text.Show() self.TextList.append(self.first_text) for i in xrange(text.count("\n")): self.i = ui.TextLine() self.i.SetParent(parent) self.i.SetPosition(x, (i + 1) * range + y) self.i.SetText(text.split("\n")[i+1]) self.i.Show() self.TextList.append(self.i) def SetText(self, text): tmpMiktar = 0 if "\n" in str(text): for i in self.TextList: if i == self.TextList[0]: i.SetText(text.split("\n")[0]) else: i.SetText(text.split("\n")[tmpMiktar]) tmpMiktar += 1 def Close(self): for i in self.TextList: i.Hide() self.__del__() Usage: Syntax: veriable = MultiTextLine(parent, text , x, y, range[optional]) Example: self.TestText = MultiTextLine(self, 'Test1\nTest2\nTest3\nTest4\nTest5', 60, 35, 15) 12 4 9 Link to comment Share on other sites More sharing options...
marek38 1 Posted October 15, 2015 Share Posted October 15, 2015 (edited) no explanation - anlatım yok Edited October 15, 2015 by marek38 Link to comment Share on other sites More sharing options...
llReonas 29 Posted October 15, 2015 Share Posted October 15, 2015 no explanation - anlatım yok lol Link to comment Share on other sites More sharing options...
Mr.Oz J. 5 Posted March 15, 2016 Share Posted March 15, 2016 apologize for my limitate knowledge Where should i have to add this DEF ? i m sorry for the disturb Link to comment Share on other sites More sharing options...
ScreamMyName 100 Posted March 15, 2016 Share Posted March 15, 2016 in ui.py Link to comment Share on other sites More sharing options...
Recommended Posts