Advertisement
Guest User

Untitled

a guest
Apr 25th, 2023
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. --[[ Создание фрейма, который будет содержать текстуру иконки
  2. iconFrame1 = CreateFrame("FRAME", "myAddonIconFrame", WorldMapFrame)
  3. iconFrame1:SetSize(12, 12)
  4. iconFrame1.iconTexture = iconTexture1
  5. iconFrame1:SetScript("OnMouseUp", function() print("Clicked on myAddon icon!") end)
  6.  
  7. -- Создание текстуры иконки
  8. iconTexture1 = iconFrame:CreateTexture("myAddonIcon", "OVERLAY")
  9. iconTexture1:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
  10. iconTexture1:SetSize(12, 12)
  11. iconTexture1:SetPoint("CENTER", 110, 110)
  12. -- Установка позиции фрейма на карте/миникарте
  13. iconFrame1:SetHeight(12)
  14. iconFrame1:SetWidth(12)
  15. -- Показ фрейма на карте/миникарте
  16. iconFrame1:Show()
  17. --]]
  18. iconRis={}
  19. iconRisText={}
  20. function iconRis:configure(id,razmerX,razmerY,iconText)
  21.     self[id] = CreateFrame("FRAME", "myAddonIconFrame", WorldMapFrame)
  22.     self[id]:SetSize(razmerX, razmerY)
  23.     self[id].iconTexture = iconText
  24.     self[id]:SetScript("OnMouseUp", function() print("Clicked on myAddon icon!") end)
  25.     self[id]:Show()
  26. end
  27.  
  28. function iconRisText:configure(id,razmerX,razmerY,X,Y)
  29.     self[id] = iconRis[id]:CreateTexture("myAddonIcon", "OVERLAY")
  30.     self[id]:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
  31.     self[id]:SetSize(razmerX, razmerY)
  32.     self[id]:SetPoint("CENTER", X, Y)
  33.     self[id]:SetHeight(razmerX)
  34.     self[id]:SetWidth(razmerY)
  35. end
  36.  
  37. iconRis:configure(1,24,24,iconRisText[1])
  38. iconRisText:configure(1,24,24,111,111)
  39. iconRis[1]:Show()
  40. iconRisText[1]:Show()
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement