Thread Tools Display Modes
12/10/14, 09:16 PM   #1
Carter_DC
 
Carter_DC's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 18
Tooltips

oyo, got a small issue with tooltips.
actually 2 issues, 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)
Code:
Btn:SetHandler("OnMouseEnter",function(AT_Guild_ChatBtn) ZO_Tooltips_ShowTextTooltip(AT_Guild_ChatBtn,BOTTOMRIGHT,AT_Guild.savedVariables.mainGuildName) end)
next issue, i don't get it, i can have a fully functionnal tooltip on a button control, but not on a Label ? thought they both inherit from control, right ? Or maybe i should use an other type of control to look like a label but allow me to have a tooltip ?
  Reply With Quote
12/10/14, 11:17 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Carter_DC View Post
oyo, got a small issue with tooltips.
actually 2 issues, 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)
Code:
Btn:SetHandler("OnMouseEnter",function(AT_Guild_ChatBtn) ZO_Tooltips_ShowTextTooltip(AT_Guild_ChatBtn,BOTTOMRIGHT,AT_Guild.savedVariables.mainGuildName) end)
next issue, i don't get it, i can have a fully functionnal tooltip on a button control, but not on a Label ? thought they both inherit from control, right ? Or maybe i should use an other type of control to look like a label but allow me to have a tooltip ?
As for the first issue I have no idea. Maybe it won't fit to the screen so tooltip is moved somewhere else?

As for the label - do you have enabled mouse events for that label? If you don't, it will not do anything.
XML:
XML Code:
  1. <Label name="whatever" mouseEnabled="true" />
Lua:
Lua Code:
  1. label:SetMouseEnabled(true)
  Reply With Quote
12/11/14, 07:05 AM   #3
Carter_DC
 
Carter_DC's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 18
Garkin, dude, u rule, as always. thx.
even though i feel like a morron everytime ^^
  Reply With Quote
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
12/11/14, 11:31 AM   #5
Carter_DC
 
Carter_DC's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 18
super great merlight, i was able to adjust the tooltip position exactly the way i wanted. Great advice !
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » Tooltips


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