Thread Tools Display Modes
12/17/15, 12:23 AM   #1
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Control Anchors Bug?

Has the game has always done this & I just never noticed or is this a bug?

If I anchor a control to guiRoot, in any way, say BOTTOMRIGHT to BOTTOMLEFT and then move the control around the screen it doesn't just update the offsets, but it also changes the anchor points. For example if I move the control near the top left corner of the screen the anchor becomes TOPLEFT to TOPLEFT, move it near the top right corner of the screen and it becomes TOPRIGHT to TOPRIGHT, exc..

If I resize the control it seems to change the anchor points as well. Dragging one side of the control seems to change the anchor to the side/direction your dragging it in. Grab the bottom of the control & drag it up and it reanchors TOP to TOP, grab the left side & drag it to the right and it reanchors RIGHT to RIGHT, exc...




It seems like a bug because if you use ResizeToFitDescendents the controls growth direction depends on its anchor so moving it around the screen causes the control to grow in different directions. As it stands I have to reanchor the controls every OnMoveStop so it keeps the correct anchors & grows in the correct direction.
  Reply With Quote
12/17/15, 05:15 PM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
I don't know whether it's intended. What you describe kind of makes sense for a simple case. For example a box with a label that grows/shrinks with the contained text. If I put that box near the right edge, I expect it to grow to the left when the text gets longer, so that it doesn't run off the screen. If I place the box near the left edge, I expect it to grow to the right.
  Reply With Quote
12/17/15, 11:09 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
Originally Posted by merlight View Post
I don't know whether it's intended. What you describe kind of makes sense for a simple case. For example a box with a label that grows/shrinks with the contained text. If I put that box near the right edge, I expect it to grow to the left when the text gets longer, so that it doesn't run off the screen. If I place the box near the left edge, I expect it to grow to the right.
Yeah I thought about that and I can see situations where it could be useful like that, but it also means if you want it to grow in a certain direction you have to re-anchor it every time its moved. From the coders point of view I set the anchor point a certain way on purpose, I don't want the game changing them. Its kind of like saying the game knows better than I do so it will just do whatever it wants and re-anchor my controls however it thinks is best, which seems wrong to me.

Anyhow re-anchoring the controls at every OnMoveStop works, I was just curious if it had always done this & I never noticed.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Control Anchors Bug?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off