Thread: Tooltips
View Single Post
12/11/14, 09:44 AM   #4
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by Carter_DC View Post
first one, I can't get to have my tooltip on the BOTOMRIGHT... BOTOM works like a charm, but botomright displays the tooltip on the right... not botom... (that's not a really big issue)
This is due to how ZO_Tooltips_ShowTextTooltip translates the anchor point:
Lua Code:
  1. local SIDE_TO_TOOLTIP_SIDE =
  2. {
  3.     [TOP] = BOTTOM,
  4.     [BOTTOM] = TOP,
  5.     [left] = RIGHT,
  6.     [right] = LEFT,
  7. }
  8.  
  9. function ZO_Tooltips_ShowTextTooltip(control, side, ...)
  10.     if side == nil then
  11.         InitializeTooltip(InformationTooltip)
  12.         ZO_Tooltips_SetupDynamicTooltipAnchors(InformationTooltip, control)
  13.     else
  14.         InitializeTooltip(InformationTooltip, control, SIDE_TO_TOOLTIP_SIDE[side], OFFSETS_X[side], OFFSETS_Y[side])
  15.     end
  16.  
  17.     for i = 1, select("#", ...) do
  18.         local line = select(i, ...)
  19.         InformationTooltip:AddLine(line, "", ZO_TOOLTIP_DEFAULT_COLOR:UnpackRGB())
  20.     end
  21. end

You can do the calls yourself for better control:
Lua Code:
  1. InitializeTooltip(InformationTooltip, AT_Guild_ChatBtn, TOPLEFT, 0, 5, --[[ optional ]] BOTTOMRIGHT)
  2. InformationTooltip:AddLine(AT_Guild.savedVariables.mainGuildName, "", ZO_TOOLTIP_DEFAULT_COLOR:UnpackRGB())
  Reply With Quote