View Single Post
05/22/14, 08:16 AM   #8
Tar000un
 
Tar000un's Avatar
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 47
Originally Posted by Garkin View Post
Everything is anchored to the UI (top level window), so it should be enough to move just UI.
Lua Code:
  1. UI:ClearAnchors()
  2. UI:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, defaults.x, defaults.y)
I mind too, but in fact, per reloadui, the command replace the UI the first time, an do nothing after.


Originally Posted by Garkin View Post
Also in my opinion both backdrop and texture needs two anchors:
Lua Code:
  1. UI:ClearAnchors()
  2. UI:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, defaults.x, defaults.y)
  3.  
  4. UI_BG:ClearAnchors()
  5. UI_BG:SetAnchor(TOPLEFT, UI, TOPLEFT, 0, 0)
  6. UI_BG:SetAnchor(BOTTOMRIGHT, UI, BOTTOMRIGHT, 0, 0)
  7. --or instead of two lines above use:
  8. --UI_BG:SetAnchorFill(UI)
  9.  
  10. UI_Texture:ClearAnchors()
  11. UI_Texture:SetAnchor(TOPLEFT, UI_BG, TOPLEFT, 0, 0)
  12. UI_Texture:SetAnchor(BOTTOMRIGHT, UI_BG, BOTTOMRIGHT, 0, 0)
  13. --or instead of two lines above use:
  14. --UI_Texture:SetAnchorFill(UI_BG)
  15.  
  16. UI_Label:ClearAnchors()
  17. UI_Label:SetAnchor(BOTTOM, UI_BG, BOTTOM, 0, 0)
I tryed your code, but still with the no reset problem, when triggered more than once. :/
  Reply With Quote