Thread: Fading Textures
View Single Post
08-16-18, 01:32 AM   #3
candrid
Premium Member
 
candrid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 61
Originally Posted by VincentSDSH View Post
UIFrameFadeIn()/Out() maybe? I use that in place of :Show()/:Hide() and it seems to work nicely.

Lua Code:
  1. UIFrameFadeIn(frame, timeToFade, startAlpha, endAlpha)
  2. UIFrameFadeOut(frame, timeToFade, startAlpha, endAlpha)
Hm, perhaps. Is there a way in Lua perhaps? I'm uncomfortable with XML. Trying to stay simple.

Lua Code:
  1. local addonName, addonData = ...
  2. local InstallerLogo = CreateFrame("Frame", addonName.."ILogo", UIParent);
  3. InstallerLogo:RegisterEvent("PLAYER_ENTERING_WORLD");
  4. InstallerLogo:SetScript("OnEvent", function(self,event,...)
  5.     self:SetSize(850, 480); -- the size of the splash
  6.     self:SetPoint("CENTER"); -- its position on the screen
  7.     if type(CharacterVar) ~= "number" then
  8.         CharacterVar = 1
  9.         InstallerLogo.texture = InstallerLogo:CreateTexture(nil, "HIGH");
  10.         InstallerLogo.texture:SetTexture("Interface\\Addons\\PawsUI\\Art\\Splash.tga");
  11.         InstallerLogo.texture:SetAllPoints();
  12.         InstallerLogo:SetAlpha(0)
  13.         InstallerLogo:SetMovable(true)
  14.         InstallerLogo:EnableMouse(true)
  15.         InstallerLogo:RegisterForDrag("LeftButton")
  16.         InstallerLogo:SetScript("OnDragStart", InstallerLogo.StartMoving)
  17.         InstallerLogo:SetScript("OnDragStop", InstallerLogo.StopMovingOrSizing)
  18.     else
  19.         if CharacterVar == 1 then
  20.             -- Do something post install. --
  21.         else
  22.             -- Do something post install. --
  23.         end
  24.         CharacterVar = CharacterVar + 1
  25.         if CharacterVar == 100 then
  26.             ChatFrame1:AddMessage('HOLY CRAP'.. UnitName("Player").."! You have used PawsUI *100* times before. THANK YOU! <3")
  27.         else
  28.             -- Do nothing. --
  29.         end
  30.     end
  31. end)

Ok, so this is what I have so far in the goal to fade in/out the splash minus that part. This part is trying to set a per character variable to 1. On 1 or below, the splash shows, 2 or higher - it doesn't. I don't want the splash / install to pop up on every loading screen / reloadui.

Last edited by candrid : 08-16-18 at 02:17 AM.
  Reply With Quote