Thread Tools Display Modes
02-28-20, 05:05 PM   #1
Kindosar
A Murloc Raider
Join Date: Feb 2020
Posts: 9
Arrow Tooltip and SetAlpha

Hello, I'm very new to creating scripts in an addon format. I'm not new to simply writing them. I created an account because I cannot find this information online, so I'm hoping the pros here can help.

I'm trying to write a script that sets the opacity of the tooltip to be 0.5. When I test it (while mousing over something and typing the script directly into the chat window), it works; however, as soon as I move away from the object I'm mousing over, it returns to be 100% opacity. Here is how I write the script in game:

GameTooltip:SetAlpha(0.5)

If I put this into my addon, it changes nothing, however when I put GameTooltip:SetScale(0.8) into the addon, it permanently changes the size of the tooltip without issue.

Can you explain why this is happening and what I can do to fix this issue?

Thank you in advance.
  Reply With Quote
02-28-20, 05:30 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
Various attributes of the GameTooltip can change each time it is shown although the scale is unlikely to be one of them.

Try hooking it's OnShow script

Code:
GameTooltip:HookScript("OnShow", function(self) self:SetAlpha(0.5) end)
It might depend on what other addons effecting tooltips you have installed.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-28-20 at 05:35 PM.
  Reply With Quote
02-28-20, 08:14 PM   #3
Kindosar
A Murloc Raider
Join Date: Feb 2020
Posts: 9
So this seems to work sometimes, but not all the time. It's strange how its reacting, then again, I'm very new to this...

I'll start by asking the following and hope that the other issues just solve themselves along the way:

Using the above script works great, but seems to only work perfectly on spells and abilities on my action bars.

Question: What can I do to make it work for other things such as items in my bags, equipment on my character screen, and spells in my spell book?

Other Observations: I initially tried to fix some other issues effecting the tooltip using a block of code to turn off the fading of the tooltip. When the tooltip fades, it goes to 100% opacity until it fades. Which seems to be causing other issues with it choosing if something is going to be at 50% opacity when you mouse over it. However, the block of code didn't fix all the issues, so I'm attempting to check if it could be something else by fixing the above question of items in bags, equipment on the character ui, and the spell in the book.

  Reply With Quote
02-28-20, 11:33 PM   #4
Terenna
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 105
What about securehooking GameTooltip_SetBackdropStyle ?
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Tooltip and SetAlpha

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