-
Posts
2 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by valizrt
-
-
6 hours ago, Finnael said:
Try replacing your AppendTextLine function with this:
def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE): textLine = ui.TextLine() textLine.SetParent(self) textLine.SetFontName(self.defFontName) textLine.SetPackedFontColor(color) textLine.SetText(text) textLine.SetOutline() textLine.SetFeather(FALSE) textLine.Show() if centerAlign: textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight) textLine.SetHorizontalAlignCenter() else: textLine.SetPosition(10, self.toolTipHeight) self.childrenList.append(textLine) self.toolTipHeight += self.TEXT_LINE_HEIGHT self.ResizeToolTip() return textLine
This function is ok for alignment, but the width of the tooltip will be generated according to the 'Title' text length and if the title text is too short, some longer bonus texts will get out of the tooltip. I tried to set the tooltip width using the longest text but no result so far. Any ideas?
How can i align text?
in Community Support - Questions & Answers
Posted · Edited by valizrt
try calling this function:
self.AlignHorizonalCenter()
in the body of the if statement.
It should look like this:
if self.toolTipWidth < textWidth: self.toolTipWidth = textWidth self.AlignHorizonalCenter()
Let me know if it works