10-08-2008, 06:46 PM
|
#1
|
A Ghoul
Join Date: Dec 2003
Server: Mith Marr
Posts: 17
|
Group Window Anchor Issues
I am trying to fix my Arcane Modded Group window but I cant get these stupid anchors figured out. Here is the code that I am working with.
Code:
<Button item="GW_GroupRolePuller1">
<ScreenID>GroupRolePuller1</ScreenID>
<RelativePosition>true</RelativePosition>
<Style_Transparent>false</Style_Transparent>
<Style_Checkbox>false</Style_Checkbox>
<ButtonDrawTemplate>
<NormalDecal>A_Puller</NormalDecal>
</ButtonDrawTemplate>
<DecalSize>
<CX>8</CX>
<CY>8</CY>
</DecalSize>
<LeftAnchorOffset>30</LeftAnchorOffset>
<TopAnchorOffset>2</TopAnchorOffset>
<RightAnchorOffset>15</RightAnchorOffset>
<BottomAnchorOffset>17</BottomAnchorOffset>
<AutoStretch>true</AutoStretch>
<LeftAnchorToLeft>false</LeftAnchorToLeft>
<RightAnchorToLeft>false</RightAnchorToLeft>
</Button>
I want to be able to move these around but when I change the numbers it will move a littlebit or disapear. Is there a way to move them with good old locations or do I have to use this anchor crap? With this code where is my anchor start? How big is area that I can move the object? If I have to anchor I want to start at upper left and be able to move it anywhere out til about 256,256 without hiding my other things in the UI. Possible?
Thanks
__________________
-=OUNVME=-
|
|
|
10-09-2008, 02:27 AM
|
#2
|
A Ghoul
Join Date: Dec 2003
Server: Mith Marr
Posts: 17
|
Here is the window I am working with....You can see where the icons are. The Main Tank icon is gone after changing the numbers. I want to be able to place the icons anywhere in this window but I just cant seem to get it. Do these buttons work like a regular button? I'd rather use a location and get rid of the ancor crap. Please help....
|
|
|
10-09-2008, 02:46 AM
|
#3
|
A Tundra Mammoth
Join Date: Mar 2004
Posts: 60
|
The anchors are just so they move when the window is resized. If you don't care about that you can make is look like below and just change the x and y locations to move it.
Code:
<Button item="GW_GroupRolePuller1">
<ScreenID>GroupRolePuller1</ScreenID>
<RelativePosition>true</RelativePosition>
<Style_Transparent>false</Style_Transparent>
<Style_Checkbox>false</Style_Checkbox>
<ButtonDrawTemplate>
<NormalDecal>A_Puller</NormalDecal>
</ButtonDrawTemplate>
<DecalSize>
<CX>8</CX>
<CY>8</CY>
</DecalSize>
<Size>
<CX>15</CX>
<CY>15</CY>
</Size>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
</Button>
|
|
|
10-09-2008, 02:50 AM
|
#4
|
A Predatory Creeper
Join Date: Aug 2002
Posts: 254
|
Yes, you can replace the anchors with the regular <Location> and <Size> parameters. All you have to do is switch AutoStretch to false.
Now, to understanding them...
The anchors mean "this distance from the edge of the window it's in". For example, LeftAnchorOffset 10 means the left side of the button is 10 pixels away from the left side of the window. This is basically the same as setting X in Location to 30.
HOWEVER... you don't have to anchor the left side of the button to the left side of the window -- you can hook it to the right side of the window instead. In the snippet you posted, LeftAnchorToLeft is false... which means the left side of this button is linked to the RIGHT side of the window. So when it says LeftAnchorOffset is 30, it means the left side of this button should be 30 pixels away from the right side of the window.
Your example snippet also says RightAnchorOffset 15... which means the right side of the button is 15 pixels away from the right side of the window. If you measure it out: left side 30 pixels away, right side 15 pixels away... the button itself is 15 pixels wide.
|
|
|
10-09-2008, 01:32 PM
|
#5
|
A Ghoul
Join Date: Dec 2003
Server: Mith Marr
Posts: 17
|
Since none of my UI pieces are sizable I will go with the standard locations. Good to know how this works tho. Thank you...
|
|
|
10-11-2008, 08:28 PM
|
#6
|
Warrior of Qeynos
Join Date: Jul 2004
Posts: 69
|
Quote:
Originally Posted by Sylphan
Yes, you can replace the anchors with the regular <Location> and <Size> parameters. All you have to do is switch AutoStretch to false.
Now, to understanding them...
The anchors mean "this distance from the edge of the window it's in". For example, LeftAnchorOffset 10 means the left side of the button is 10 pixels away from the left side of the window. This is basically the same as setting X in Location to 30.
HOWEVER... you don't have to anchor the left side of the button to the left side of the window -- you can hook it to the right side of the window instead. In the snippet you posted, LeftAnchorToLeft is false... which means the left side of this button is linked to the RIGHT side of the window. So when it says LeftAnchorOffset is 30, it means the left side of this button should be 30 pixels away from the right side of the window.
Your example snippet also says RightAnchorOffset 15... which means the right side of the button is 15 pixels away from the right side of the window. If you measure it out: left side 30 pixels away, right side 15 pixels away... the button itself is 15 pixels wide.
|
This helps me a little bit. I'm looking for an anchor course to fix my group and player windows. Is there a way to have an anchor attach to the bottom instead of the top?
|
|
|
10-11-2008, 08:54 PM
|
#7
|
A Tundra Mammoth
Join Date: Mar 2004
Posts: 60
|
Quote:
Originally Posted by akenta
This helps me a little bit. I'm looking for an anchor course to fix my group and player windows. Is there a way to have an anchor attach to the bottom instead of the top?
|
There are two parts to anchors. One part specifies which side the object is anchored to. The second part is the offset from that side.
<TopAnchorToTop> True means that the top offset is from the top. False means its from the bottom
<BottomAnchorToTop> True means that the bottom offset is from the top. False means its from the bottom.
<LeftAnchorToLeft> True means that the left offset is from the left. False means its from the right.
<RightAnchorToLeft> True means that the right offset is from the left. False means its from the right.
So if you want something to be 10 pixels high and 50 pixels wide, and want it to be 20 pixels from the bottom and to be 20 pixels from the right side it would look like.
Code:
<TopAnchorToTop>false</TopAnchorToTop> <!-- top is anchored to bottom -->
<TopAnchorOffset>30</TopAnchorOffset> <!-- 20 pixels from the bottom + 10 pixels high -->
<BottomAnchorToTop>false</BottomAnchorToTop> <!-- bottom is anchored to the bottom -->
<BottomAnchorOffset>20</BottomAnchorOffset> <!-- 20 pixels from the bottom -->
<LeftAnchorToLeft>false</LeftAnchorToLeft> <!-- left is anchored to the right -->
<LeftAnchorOffset>70</LeftAnchorOffset> <!-- 20 pixels from the right + 50 pixels high -->
<RightAnchorToLeft>false</RightAnchorToLeft> <!-- right is anchored to the right -->
<RightAnchorOffset>20</RightAnchorOffset> <!-- 20 pixels from the right -->
|
|
|
11-13-2008, 07:17 PM
|
#8
|
A Predatory Creeper
Join Date: Aug 2002
Posts: 254
|
Quote:
Originally Posted by akenta
This helps me a little bit. I'm looking for an anchor course to fix my group and player windows. Is there a way to have an anchor attach to the bottom instead of the top?
|
Yes. If you set BottomAnchorToTop to FALSE, then it is measured from the bottom of the window. Usually when you do that, you also set TopAnchorToTop to FALSE at the same time.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|