Jump to content
  • 0

Set fixed postion for tooltip affect image


ReFresh

Question

  • Silver

Hey guys,

I have small question. Someone know how to set fixed position for the text in this function to not overflow the left side of the game screen? Now, if I'll change any value for x postion, it will overflow to the left. The text position is affected by affect image, so it looks like, 1st image has x position and 2nd image has x+20 position, I want to set all the texts at one selected position.

Spoiler
#uiaffectshower.py
def SetToolTipText(self, text, x = 0, y = -19):

		if not self.toolTipText:
			textLine = ui.TextLine()
			textLine.SetParent(self)
			textLine.SetSize(0, 0)
			textLine.SetOutline()
			textLine.Hide()
			self.toolTipText = textLine

		self.toolTipText.SetText(text)
		w, h = self.toolTipText.GetTextSize()
		self.toolTipText.SetPosition(max(0, x + self.GetWidth()/2 - w/2), y)

 

Thanks for answers!

Sincerely,

ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

Try this:
 

	def SetToolTipText(self, text, x = 0, y = -19):
		if not self.toolTipText:
			textLine = ui.TextLine()
			textLine.SetParent(self)
			textLine.SetHorizontalAlignCenter()
			textLine.SetSize(0, 0)
			textLine.SetOutline()
			textLine.Hide()
			self.toolTipText = textLine

		self.toolTipText.SetText(text)
		w, h = self.toolTipText.GetTextSize()
		self.toolTipText.SetPosition(max(0, x + self.GetWidth()/2 - w/2), y)

 

Link to comment
Share on other sites

  • 0
  • Silver

@dumita123 Nope, it still does the same thing. The text is still overflowing the left side of the game screen. For example, if you hover over autopotion the text will overflow. I'm wondering why it's happening. Looks like mentioned function has nothing to do with that, but I can't see anything else what could cause this problem.

I'll be always helpful! 👊 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • 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.