Thread Tools Display Modes
Prev Previous Post   Next Post Next
12/06/16, 06:15 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,581
ZO_Tooltips_ShowTextTooltip also just calls AddLine:
Lua Code:
  1. function ZO_Tooltips_ShowTextTooltip(control, side, ...)
  2.     if side == nil then
  3.         InitializeTooltip(InformationTooltip)
  4.         ZO_Tooltips_SetupDynamicTooltipAnchors(InformationTooltip, control)
  5.     else
  6.         InitializeTooltip(InformationTooltip, control, SIDE_TO_TOOLTIP_SIDE[side], OFFSETS_X[side], OFFSETS_Y[side])
  7.     end
  8.  
  9.     for i = 1, select("#", ...) do
  10.         local line = select(i, ...)
  11.         InformationTooltip:AddLine(line, "", ZO_TOOLTIP_DEFAULT_COLOR:UnpackRGB())
  12.     end
  13. end

The last parameter of AddLine is called setToFullSize:
AddLine(string text, string font, number r, number g, number b, AnchorPosition lineAnchor, ModifyTextType modifyTextType, TextAlignment textAlignment, bool setToFullSize)
My guess is, that you need to add an element that is wider than your text in order for text alignment to work when you have setToFullSize set to false. Try adding a line of whitespaces.
You could also try to set a width constraint and setToFullSize, but you should only do that if you have created the tooltip control yourself (never on the built in InformationTooltip and others).
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Tooltip text alignment

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off