WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Make border for icon. (https://www.wowinterface.com/forums/showthread.php?t=58989)

darhanger 11-27-21 10:07 AM

Make border for icon.
 
Wanna make blizzlike border for my addon without any libs. Any can help ? Cuz i try just insert some code from LibDBIcon - but is shouldn work. Like scada icon.



Lua Code:
  1. local mmb_name = ni.utils.GenerateRandomName();
  2. main_ui.minimap_icon = CreateFrame("Button", mmb_name, Minimap);
  3. local mm = main_ui.minimap_icon;
  4. mm:SetHeight(25);
  5. mm:SetWidth(25);
  6. mm:SetFrameStrata("MEDIUM");
  7. mm:SetMovable(true);
  8. mm:SetUserPlaced(true);
  9. main_ui.minimap_toggle = function(bool)
  10.     if bool then
  11.         mm:SetNormalTexture("Interface\\BUTTONS\\UI-GroupLoot-Pass-Up.blp");
  12.         mm:SetPushedTexture("Interface\\BUTTONS\\UI-GroupLoot-Pass-Down.blp");
  13.     else
  14.         mm:SetNormalTexture("Interface\\BUTTONS\\UI-GroupLoot-Coin-Up.blp");
  15.         mm:SetPushedTexture("Interface\\BUTTONS\\UI-GroupLoot-Coin-Down.blp");
  16.     end
  17. end
  18. mm:SetHighlightTexture("Interface\\Minimap\\UI-Minimap-Background.blp");
  19. mm:SetPoint("CENTER", 20, 45);
  20. mm:SetScript("OnMouseDown", function(self, button)
  21.     if button == "LeftButton" then
  22.         if main_ui.main:IsShown() then
  23.             main_ui.main:Hide();
  24.         else
  25.             main_ui.main:Show();
  26.         end
  27.     elseif button == "RightButton" then
  28.         self:SetScript("OnUpdate", moveIcon);
  29.     end
  30. end);
  31. mm:SetScript("OnMouseUp", function(self)
  32.     self:SetScript("OnUpdate", nil);
  33. end);

darhanger 11-28-21 03:52 AM

thats all of i make



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

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