Originally Posted by Tar000un
The parts about the concerned code :
Lua Code:
UI_Texture:ClearAnchors(); UI_Label:ClearAnchors(); UI_BG:ClearAnchors(); UI:ClearAnchors(); UI:SetAnchor( TOPLEFT, GuiRoot, TOPLEFT, defaults.x, defaults.y ); UI_BG:SetAnchor(TOPLEFT, UI, TOPLEFT, 0, 0); UI_Texture:SetAnchor(TOPLEFT, UI_BG, TOPLEFT, 0, 0); UI_Label:SetAnchor(BOTTOM, UI_BG, BOTTOM, 0, 0);
The XML:
Code:
<Controls>
<Backdrop name="$(parent)_BGcompassTiny"
inherits="ZO_CenterlessBackdrop" edgeColor="000000"
centerColor="000000" alpha="0">
<AnchorFill />
</Backdrop>
<Texture name="$(parent)_TextureCompassTiny" />
<Label name="$(parent)_LabelCompassTiny"
verticalAlignment="BOTTOM" horizontalAlignment="CENTER"
text="Label" alpha="1"
/>
</Controls>
|
Everything is anchored to the UI (top level window), so it should be enough to move just UI.
Lua Code:
UI:ClearAnchors()
UI:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, defaults.x, defaults.y)
Also in my opinion both backdrop and texture needs two anchors:
Lua Code:
UI:ClearAnchors()
UI:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, defaults.x, defaults.y)
UI_BG:ClearAnchors()
UI_BG:SetAnchor(TOPLEFT, UI, TOPLEFT, 0, 0)
UI_BG:SetAnchor(BOTTOMRIGHT, UI, BOTTOMRIGHT, 0, 0)
--or instead of two lines above use:
--UI_BG:SetAnchorFill(UI)
UI_Texture:ClearAnchors()
UI_Texture:SetAnchor(TOPLEFT, UI_BG, TOPLEFT, 0, 0)
UI_Texture:SetAnchor(BOTTOMRIGHT, UI_BG, BOTTOMRIGHT, 0, 0)
--or instead of two lines above use:
--UI_Texture:SetAnchorFill(UI_BG)
UI_Label:ClearAnchors()
UI_Label:SetAnchor(BOTTOM, UI_BG, BOTTOM, 0, 0)