Version of Files : XXX
Hi i have a problem with the short textes, the appendtextline align long textes and all below them, but if the first bonus or the title is shorter it doesnt align
GIF
here is the part of code
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()
(textWidth, textHeight)=textLine.GetTextSize()
textWidth += 55
textHeight += 5
if self.toolTipWidth < textWidth:
self.toolTipWidth = textWidth
self.childrenList.append(textLine)
if centerAlign:
textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
textLine.SetHorizontalAlignCenter()
else:
textLine.SetPosition(10, self.toolTipHeight)
self.toolTipHeight += textHeight
self.ResizeToolTip()
return textLine
def __AppendAttributeInformation(self, attrSlot, itemAbsChance = 0):
if 0 != attrSlot:
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
type = attrSlot[i][0]
value = attrSlot[i][1]
if 0 == value:
continue
affectString = self.__GetAffectString(type, value)
if app.ENABLE_SASH_SYSTEM:
if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_SASH and itemAbsChance:
value = self.CalcSashValue(value, itemAbsChance)
affectString = self.__GetAffectString(type, value)
if affectString:
affectColor = self.__GetAttributeColor(i, value)
self.AppendTextLine(affectString, affectColor)
Thanks, Sincerly,
iShadoW