Jump to content

Multi Textline


Recommended Posts

  • Active Member

M2 Download Center

This is the hidden content, please
( 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)

 

  • Metin2 Dev 11
  • Good 4
  • Love 9
Link to comment
Share on other sites

  • 5 months later...

Announcements



  • Similar Content

  • Similar Content

  • Similar Content

  • Tags

  • Activity

    1. 113

      Ulthar SF V2 (TMP4 Base)

    2. 2

      Feeding game source to LLM

    3. 0

      Target Information System

    4. 2

      Feeding game source to LLM

    5. 2

      anti exp explanation pls

    6. 2

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.