ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Help/Support (https://www.esoui.com/forums/forumdisplay.php?f=164)
-   -   Tooltips (https://www.esoui.com/forums/showthread.php?t=2511)

Carter_DC 12/10/14 09:16 PM

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 ?

Garkin 12/10/14 11:17 PM

Quote:

Originally Posted by Carter_DC (Post 13754)
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)

Carter_DC 12/11/14 07:05 AM

Garkin, dude, u rule, as always. thx.
even though i feel like a morron everytime ^^

merlight 12/11/14 09:44 AM

Quote:

Originally Posted by Carter_DC (Post 13754)
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())

Carter_DC 12/11/14 11:31 AM

super great merlight, i was able to adjust the tooltip position exactly the way i wanted. Great advice !


All times are GMT -6. The time now is 11:26 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI