View Single Post
12/06/16, 06:15 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
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