WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Resize frames with texture (https://www.wowinterface.com/forums/showthread.php?t=58765)

fullmoon_sulfuras 05-26-21 08:20 PM

Resize frames with texture
 
Hi there! I'm trying to understand why the following code won't create frames of different sizes:

Lua Code:
  1. local x
  2.  
  3. x = CreateFrame("Button", "LSSettings" .. "StanceIcon0x", UIParent, "ActionButtonTemplate")
  4. x:SetPoint("Topleft", 350, -200);
  5. x:EnableMouse(false);
  6. x:SetWidth(50);
  7. x:SetHeight(50);
  8. x:SetNormalTexture("Interface\\AddOns\\LunarSphere\\art\\mouse1")
  9.  
  10. x = CreateFrame("Button", "LSSettings" .. "StanceIcon0y", UIParent, "ActionButtonTemplate")
  11. x:SetPoint("Topleft", 350, -300);
  12. x:SetWidth(24);
  13. x:SetHeight(24);
  14. x:EnableMouse(false);
  15. x:SetNormalTexture("Interface\\AddOns\\LunarSphere\\art\\mouse1")
  16.  
  17. x = CreateFrame("Button", "LSSettings" .. "StanceIcon0z", UIParent, "ActionButtonTemplate")
  18. x:SetPoint("Topleft", 350, -400);
  19. x:SetWidth(10);
  20. x:SetHeight(10);
  21. x:EnableMouse(false);
  22. x:SetNormalTexture("Interface\\AddOns\\LunarSphere\\art\\mouse1")

Thanks!!!

Fizzlemizz 05-26-21 08:43 PM

It does. Are they being re-sized again somewhere else in your code?

Edit: You mean on Classic..

Fizzlemizz 05-26-21 08:55 PM

The ActionButtonTemplate is setting an absolute size for the NormalTexture rather than using SetPoint() relative to the frame.
Classic, #NoChanges ;)
Lua Code:
  1. local x, t
  2.  
  3. x = CreateFrame("Button", "LSSettings" .. "StanceIcon0x", UIParent, "ActionButtonTemplate")
  4. x:SetPoint("Topleft", 350, -200);
  5. x:EnableMouse(false);
  6. x:SetWidth(50);
  7. x:SetHeight(50);
  8. x:SetNormalTexture("Interface\\AddOns\\LunarSphere\\art\\mouse1")
  9. t = x:GetNormalTexture()
  10. t:SetSize(x:GetSize())
  11.  
  12. x = CreateFrame("Button", "LSSettings" .. "StanceIcon0y", UIParent, "ActionButtonTemplate")
  13. x:SetPoint("Topleft", 350, -300);
  14. x:SetWidth(24);
  15. x:SetHeight(24);
  16. x:EnableMouse(false);
  17. x:SetNormalTexture("Interface\\AddOns\\LunarSphere\\art\\mouse1")
  18. t = x:GetNormalTexture()
  19. t:SetSize(x:GetSize())
  20.  
  21. x = CreateFrame("Button", "LSSettings" .. "StanceIcon0z", UIParent, "ActionButtonTemplate")
  22. x:SetPoint("Topleft", 350, -400);
  23. x:SetWidth(10);
  24. x:SetHeight(10);
  25. x:EnableMouse(false);
  26. x:SetNormalTexture("Interface\\AddOns\\LunarSphere\\art\\mouse1")
  27. t = x:GetNormalTexture()
  28. t:SetSize(x:GetSize())


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

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI