WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   :SetTexture() only works for abilities on actionbar. (https://www.wowinterface.com/forums/showthread.php?t=49021)

semlar 03-03-14 11:41 PM

The following code will never display a texture as long as "SetNonBlocking" is enabled unless the texture is loaded elsewhere.
Lua Code:
  1. local tx = UIParent:CreateTexture()
  2. tx:SetPoint('CENTER')
  3. tx:SetSize(64, 64)
  4. tx:SetNonBlocking(true)
  5.  
  6. local switch = true
  7. local texture1, texture2 = 'interface/icons/inv_mushroom_10', 'interface/icons/inv_mushroom_11'
  8. CreateFrame('frame'):SetScript('OnUpdate', function()
  9.     tx:SetTexture(switch and texture1 or texture2)
  10.     switch = not switch
  11. end)
If you use a single texture it will load but switching between two textures every other frame appears to prevent it from ever completing the loading process.


All times are GMT -6. The time now is 09:42 AM.

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